chore: auto-fix lint & formatting [skip ci]

This commit is contained in:
github-actions[bot] authored and GitHub committed 2026-10-03 14:55:16 +00:00
1 parent fbbff669a3
commit 37d2eb3636
13 files changed
+840 -97

No files matched your search

+49 -3
View File
@@ -26,7 +26,53 @@ const { toasts, dismiss } = useToasts();
</script>
<style scoped>
.recloud-toasts { position: fixed; z-index: 70; right: 1rem; bottom: 1rem; display: grid; width: min(calc(100vw - 2rem), 390px); gap: .65rem; }
.recloud-toast { display: flex; align-items: center; gap: .7rem; cursor: pointer; box-shadow: 0 16px 38px rgb(var(--wh-text) / .14); } .recloud-toast :deep(.rc-card-body) { display: flex; width: 100%; align-items: center; gap: .7rem; padding: .1rem; } .recloud-toast :deep(svg) { flex: none; color: rgb(var(--wh-ok)); } .recloud-toast.bad :deep(svg) { color: rgb(var(--wh-bad)); } .recloud-toast span { flex: 1; font-size: .8rem; font-weight: 700; } .recloud-toast .toast-close { color: rgb(var(--wh-faint)); }
.toast-enter-active, .toast-leave-active { transition: opacity 180ms ease, transform 180ms ease; } .toast-enter-from, .toast-leave-to { opacity: 0; transform: translateX(16px); }
.recloud-toasts {
position: fixed;
z-index: 70;
right: 1rem;
bottom: 1rem;
display: grid;
width: min(calc(100vw - 2rem), 390px);
gap: 0.65rem;
}
.recloud-toast {
display: flex;
align-items: center;
gap: 0.7rem;
cursor: pointer;
box-shadow: 0 16px 38px rgb(var(--wh-text) / 0.14);
}
.recloud-toast :deep(.rc-card-body) {
display: flex;
width: 100%;
align-items: center;
gap: 0.7rem;
padding: 0.1rem;
}
.recloud-toast :deep(svg) {
flex: none;
color: rgb(var(--wh-ok));
}
.recloud-toast.bad :deep(svg) {
color: rgb(var(--wh-bad));
}
.recloud-toast span {
flex: 1;
font-size: 0.8rem;
font-weight: 700;
}
.recloud-toast .toast-close {
color: rgb(var(--wh-faint));
}
.toast-enter-active,
.toast-leave-active {
transition:
opacity 180ms ease,
transform 180ms ease;
}
.toast-enter-from,
.toast-leave-to {
opacity: 0;
transform: translateX(16px);
}
</style>
+322 -41
View File
@@ -3,7 +3,9 @@
<aside class="console-sidebar">
<NuxtLink class="console-brand" to="/">
<AppLogo :size="32" />
<span><strong>WebHooker</strong><small>{{ t("app.tagline") }}</small></span>
<span
><strong>WebHooker</strong><small>{{ t("app.tagline") }}</small></span
>
</NuxtLink>
<p class="console-nav-label">{{ t("app.tagline") }}</p>
<nav class="console-nav">
@@ -30,24 +32,42 @@
<h1>{{ pageTitle }}</h1>
</div>
<div class="console-actions">
<RcBadge v-if="!needLogin && loadingAny" variant="soft" size="sm" dot class="console-status">
<RcBadge
v-if="!needLogin && loadingAny"
variant="soft"
size="sm"
dot
class="console-status"
>
{{ t("status.loading") }}
</RcBadge>
<RcButton v-if="view === 'overview'" variant="ghost" size="sm" @click="refreshOverview"><RefreshCw :size="15" />{{ t("metrics.refresh") }}</RcButton>
<RcButton v-if="view === 'overview'" variant="ghost" size="sm" @click="refreshOverview"
><RefreshCw :size="15" />{{ t("metrics.refresh") }}</RcButton
>
<ThemeToggle />
<RcButton variant="ghost" size="sm" @click="toggle"><Languages :size="15" />{{ t("app.langToggle") }}</RcButton>
<RcButton variant="ghost" size="sm" @click="toggle"
><Languages :size="15" />{{ t("app.langToggle") }}</RcButton
>
<RcButton
v-if="!needLogin && selectedGroup && canEditRoutes(selectedGroup.id)"
@click="openNew"
><Plus :size="16" />{{ t("app.newRoute") }}</RcButton>
><Plus :size="16" />{{ t("app.newRoute") }}</RcButton
>
<RcButton
v-if="!needLogin && !selectedGroup && view === 'groups' && isSuper"
@click="openNewGroup"
><Plus :size="16" />{{ t("app.newGroup") }}</RcButton>
><Plus :size="16" />{{ t("app.newGroup") }}</RcButton
>
</div>
</header>
<div class="console-mobile-nav"><RcTabs :model-value="activeNav" :items="mobileNav" @update:model-value="switchView($event as View)" /></div>
<div class="console-mobile-nav">
<RcTabs
:model-value="activeNav"
:items="mobileNav"
@update:model-value="switchView($event as View)"
/>
</div>
<main class="console-content">
<div v-if="needLogin" class="console-login">
@@ -55,7 +75,9 @@
<template #header><LockKeyhole :size="24" /></template>
<h2>{{ t("login.title") }}</h2>
<p>{{ forbidden ? t("login.forbidden") : t("login.prompt") }}</p>
<a href="/admin/login"><RcButton size="lg"><LogIn :size="17" />{{ t("login.button") }}</RcButton></a>
<a href="/admin/login"
><RcButton size="lg"><LogIn :size="17" />{{ t("login.button") }}</RcButton></a
>
</RcCard>
</div>
@@ -74,10 +96,14 @@
<template v-else-if="selectedGroup">
<section class="console-context-bar">
<div>
<RcButton variant="ghost" size="sm" @click="exitGroup"><ArrowLeft :size="15" />{{ t("group.back") }}</RcButton>
<RcButton variant="ghost" size="sm" @click="exitGroup"
><ArrowLeft :size="15" />{{ t("group.back") }}</RcButton
>
<p>{{ t("group.routesIn", { name: selectedGroup.name }) }}</p>
</div>
<RcBadge :variant="groupRoutesLoading ? 'soft' : 'success'" size="sm" dot>{{ groupRoutes.length }}</RcBadge>
<RcBadge :variant="groupRoutesLoading ? 'soft' : 'success'" size="sm" dot>{{
groupRoutes.length
}}</RcBadge>
</section>
<p v-if="groupRoutesError" class="err">{{ groupRoutesError }}</p>
@@ -100,7 +126,9 @@
<section v-if="!groupRoutesLoading && !groupRoutes.length" class="console-empty">
<RcEmptyState :title="t('routes.emptyGroup')">
<RcButton v-if="canEditRoutes(selectedGroup.id)" @click="openNew"><Plus :size="16" />{{ t("routes.createFirst") }}</RcButton>
<RcButton v-if="canEditRoutes(selectedGroup.id)" @click="openNew"
><Plus :size="16" />{{ t("routes.createFirst") }}</RcButton
>
</RcEmptyState>
</section>
@@ -120,8 +148,13 @@
<template v-else-if="view === 'groups'">
<section class="console-context-bar">
<div><p>{{ t("kpi.groups") }}</p><strong>{{ groups.length }}</strong></div>
<RcBadge v-if="groupsLoading" variant="soft" size="sm" dot>{{ t("status.loading") }}</RcBadge>
<div>
<p>{{ t("kpi.groups") }}</p>
<strong>{{ groups.length }}</strong>
</div>
<RcBadge v-if="groupsLoading" variant="soft" size="sm" dot>{{
t("status.loading")
}}</RcBadge>
</section>
<p v-if="groupsError" class="err">{{ groupsError }}</p>
@@ -137,20 +170,28 @@
:style="{ animationDelay: i * 45 + 'ms' }"
@click="enterGroup(g)"
>
<template #header><div class="card-head"><div class="card-title">
<span class="route-name">{{ g.name || t("route.untitled") }}</span>
<span class="route-id">{{ g.id }}</span>
<RcBadge v-if="roleOf(g.id)" variant="brand" size="xs">{{ t("role.badge", { role: t("roles." + roleOf(g.id)) }) }}</RcBadge>
</div>
<div v-if="canEditGroup(g.id)" class="card-actions" @click.stop>
<RcButton
variant="ghost" size="icon"
:title="t('groupEditor.editTitle')"
@click="openEditGroup(g)"
><Pencil :size="15" /></RcButton>
<RcButton variant="ghost" color="error" size="icon" @click="onDeleteGroup(g)"><Trash2 :size="15" /></RcButton>
</div>
</div></template>
<template #header
><div class="card-head">
<div class="card-title">
<span class="route-name">{{ g.name || t("route.untitled") }}</span>
<span class="route-id">{{ g.id }}</span>
<RcBadge v-if="roleOf(g.id)" variant="brand" size="xs">{{
t("role.badge", { role: t("roles." + roleOf(g.id)) })
}}</RcBadge>
</div>
<div v-if="canEditGroup(g.id)" class="card-actions" @click.stop>
<RcButton
variant="ghost"
size="icon"
:title="t('groupEditor.editTitle')"
@click="openEditGroup(g)"
><Pencil :size="15"
/></RcButton>
<RcButton variant="ghost" color="error" size="icon" @click="onDeleteGroup(g)"
><Trash2 :size="15"
/></RcButton>
</div></div
></template>
<div class="target">
<span
><b>{{ t("groups.members") }}</b
@@ -165,17 +206,27 @@
}}</code></span
>
</div>
<template #footer><span class="console-open"><ArrowRight :size="15" />{{ t("groups.open") }}</span></template>
<template #footer
><span class="console-open"
><ArrowRight :size="15" />{{ t("groups.open") }}</span
></template
>
</RcCard>
</section>
<section v-if="!groupsLoading && !groups.length" class="console-empty">
<RcEmptyState :title="t('groups.empty')"><RcButton v-if="isSuper" @click="openNewGroup"><Plus :size="16" />{{ t("groups.createFirst") }}</RcButton></RcEmptyState>
<RcEmptyState :title="t('groups.empty')"
><RcButton v-if="isSuper" @click="openNewGroup"
><Plus :size="16" />{{ t("groups.createFirst") }}</RcButton
></RcEmptyState
>
</section>
</template>
<template v-else-if="view === 'logs'">
<section v-if="logsLoading" class="console-context-bar"><RcBadge variant="soft" size="sm" dot>{{ t("status.loading") }}</RcBadge></section>
<section v-if="logsLoading" class="console-context-bar">
<RcBadge variant="soft" size="sm" dot>{{ t("status.loading") }}</RcBadge>
</section>
<SendLogs
:logs="logs"
:loading="logsLoading"
@@ -297,7 +348,9 @@ const nav = computed(() => [
{ id: "metrics" as View, label: t("tab.metrics"), path: "/admin/metrics" },
]);
const mobileNav = computed(() => nav.value.map(({ id, label }) => ({ value: id, label, icon: navIcon(id) })));
const mobileNav = computed(() =>
nav.value.map(({ id, label }) => ({ value: id, label, icon: navIcon(id) })),
);
function navIcon(id: View) {
const icons = {
@@ -594,14 +647,242 @@ async function onDeleteGroup(group: Group): Promise<void> {
</script>
<style scoped>
.console-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: rgb(var(--wh-bg)); color: rgb(var(--wh-text)); }
.console-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; border-right: 1px solid rgb(var(--wh-border)); background: linear-gradient(165deg, rgb(var(--wh-surface)), rgb(var(--wh-surface-2))); padding: 1.25rem .85rem; }
.console-brand { display: flex; align-items: center; gap: .7rem; padding: .45rem .55rem 1.75rem; color: rgb(var(--wh-text)); text-decoration: none; } .console-brand :deep(svg) { color: rgb(var(--wh-accent)); } .console-brand span { display: grid; gap: .1rem; } .console-brand strong { font-size: 1rem; letter-spacing: -.04em; } .console-brand small, .console-nav-label, .console-kicker { color: rgb(var(--wh-faint)); font-size: .62rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.console-nav-label { margin: 0 .65rem .45rem; } .console-nav { display: grid; gap: .2rem; } .console-nav-item { display: flex; align-items: center; gap: .7rem; width: 100%; border: 0; border-radius: .65rem; background: transparent; padding: .7rem; color: rgb(var(--wh-muted)); font: inherit; font-size: .82rem; font-weight: 700; text-align: left; transition: background-color 150ms ease, color 150ms ease; cursor: pointer; } .console-nav-item:hover { background: rgb(var(--wh-surface-2)); color: rgb(var(--wh-text)); } .console-nav-item.active { background: rgb(var(--wh-accent)); color: white; box-shadow: 0 8px 18px rgb(var(--wh-accent) / .2); }
.console-sidebar-footer { display: grid; gap: .9rem; margin-top: auto; padding: .9rem .55rem .25rem; border-top: 1px solid rgb(var(--wh-border)); } .console-sidebar-footer a { display: inline-flex; align-items: center; gap: .55rem; color: rgb(var(--wh-muted)); font-size: .8rem; font-weight: 700; text-decoration: none; } .console-sidebar-footer a:hover { color: rgb(var(--wh-bad)); }
.console-main { min-width: 0; } .console-topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgb(var(--wh-border)); background: color-mix(in srgb, rgb(var(--wh-bg)) 87%, transparent); padding: .8rem clamp(1rem, 3vw, 2.5rem); backdrop-filter: blur(18px); } .console-topbar h1 { margin: .1rem 0 0; font-size: 1.15rem; letter-spacing: -.035em; } .console-kicker { margin: 0; } .console-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; } .console-status { white-space: nowrap; }
.console-mobile-nav { display: none; } .console-content { width: min(100% - 2rem, 1240px); margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem) 0 5rem; } .console-login { display: grid; min-height: 62vh; place-items: center; } .console-login-card { width: min(100%, 430px); text-align: center; } .console-login-card :deep(.rc-card-header) { justify-content: center; color: rgb(var(--wh-accent)); } .console-login-card h2 { margin: .35rem 0 .65rem; font-size: 1.35rem; letter-spacing: -.035em; } .console-login-card p { margin: 0 0 1.4rem; color: rgb(var(--wh-muted)); }
.console-context-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid rgb(var(--wh-border)); border-radius: .85rem; background: rgb(var(--wh-surface) / .6); } .console-context-bar > div { display: flex; align-items: center; gap: .8rem; } .console-context-bar p { margin: 0; color: rgb(var(--wh-muted)); font-size: .8rem; font-weight: 700; } .console-context-bar strong { font-size: 1.25rem; letter-spacing: -.04em; } .console-empty { padding: 4rem 1rem; } .console-group-card { cursor: pointer; } .console-open { display: inline-flex; align-items: center; gap: .35rem; color: rgb(var(--wh-accent)); font-size: .75rem; font-weight: 800; }
@media (max-width: 900px) { .console-shell { display: block; } .console-sidebar { display: none; } .console-mobile-nav { display: block; border-bottom: 1px solid rgb(var(--wh-border)); padding: .5rem 1rem; overflow-x: auto; } .console-mobile-nav :deep(.rc-tabs) { min-width: max-content; } }
@media (max-width: 620px) { .console-topbar { align-items: flex-start; flex-direction: column; } .console-actions { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: .05rem; } .console-status { display: none; } .console-content { width: min(100% - 1.25rem, 1240px); } }
.console-shell {
display: grid;
grid-template-columns: 264px minmax(0, 1fr);
min-height: 100vh;
background: rgb(var(--wh-bg));
color: rgb(var(--wh-text));
}
.console-sidebar {
position: sticky;
top: 0;
display: flex;
height: 100vh;
flex-direction: column;
border-right: 1px solid rgb(var(--wh-border));
background: linear-gradient(165deg, rgb(var(--wh-surface)), rgb(var(--wh-surface-2)));
padding: 1.25rem 0.85rem;
}
.console-brand {
display: flex;
align-items: center;
gap: 0.7rem;
padding: 0.45rem 0.55rem 1.75rem;
color: rgb(var(--wh-text));
text-decoration: none;
}
.console-brand :deep(svg) {
color: rgb(var(--wh-accent));
}
.console-brand span {
display: grid;
gap: 0.1rem;
}
.console-brand strong {
font-size: 1rem;
letter-spacing: -0.04em;
}
.console-brand small,
.console-nav-label,
.console-kicker {
color: rgb(var(--wh-faint));
font-size: 0.62rem;
font-weight: 800;
letter-spacing: 0.13em;
text-transform: uppercase;
}
.console-nav-label {
margin: 0 0.65rem 0.45rem;
}
.console-nav {
display: grid;
gap: 0.2rem;
}
.console-nav-item {
display: flex;
align-items: center;
gap: 0.7rem;
width: 100%;
border: 0;
border-radius: 0.65rem;
background: transparent;
padding: 0.7rem;
color: rgb(var(--wh-muted));
font: inherit;
font-size: 0.82rem;
font-weight: 700;
text-align: left;
transition:
background-color 150ms ease,
color 150ms ease;
cursor: pointer;
}
.console-nav-item:hover {
background: rgb(var(--wh-surface-2));
color: rgb(var(--wh-text));
}
.console-nav-item.active {
background: rgb(var(--wh-accent));
color: white;
box-shadow: 0 8px 18px rgb(var(--wh-accent) / 0.2);
}
.console-sidebar-footer {
display: grid;
gap: 0.9rem;
margin-top: auto;
padding: 0.9rem 0.55rem 0.25rem;
border-top: 1px solid rgb(var(--wh-border));
}
.console-sidebar-footer a {
display: inline-flex;
align-items: center;
gap: 0.55rem;
color: rgb(var(--wh-muted));
font-size: 0.8rem;
font-weight: 700;
text-decoration: none;
}
.console-sidebar-footer a:hover {
color: rgb(var(--wh-bad));
}
.console-main {
min-width: 0;
}
.console-topbar {
position: sticky;
top: 0;
z-index: 20;
display: flex;
min-height: 76px;
align-items: center;
justify-content: space-between;
gap: 1rem;
border-bottom: 1px solid rgb(var(--wh-border));
background: color-mix(in srgb, rgb(var(--wh-bg)) 87%, transparent);
padding: 0.8rem clamp(1rem, 3vw, 2.5rem);
backdrop-filter: blur(18px);
}
.console-topbar h1 {
margin: 0.1rem 0 0;
font-size: 1.15rem;
letter-spacing: -0.035em;
}
.console-kicker {
margin: 0;
}
.console-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 0.45rem;
}
.console-status {
white-space: nowrap;
}
.console-mobile-nav {
display: none;
}
.console-content {
width: min(100% - 2rem, 1240px);
margin: 0 auto;
padding: clamp(1.25rem, 3vw, 2.5rem) 0 5rem;
}
.console-login {
display: grid;
min-height: 62vh;
place-items: center;
}
.console-login-card {
width: min(100%, 430px);
text-align: center;
}
.console-login-card :deep(.rc-card-header) {
justify-content: center;
color: rgb(var(--wh-accent));
}
.console-login-card h2 {
margin: 0.35rem 0 0.65rem;
font-size: 1.35rem;
letter-spacing: -0.035em;
}
.console-login-card p {
margin: 0 0 1.4rem;
color: rgb(var(--wh-muted));
}
.console-context-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 1rem;
padding: 0.8rem 1rem;
border: 1px solid rgb(var(--wh-border));
border-radius: 0.85rem;
background: rgb(var(--wh-surface) / 0.6);
}
.console-context-bar > div {
display: flex;
align-items: center;
gap: 0.8rem;
}
.console-context-bar p {
margin: 0;
color: rgb(var(--wh-muted));
font-size: 0.8rem;
font-weight: 700;
}
.console-context-bar strong {
font-size: 1.25rem;
letter-spacing: -0.04em;
}
.console-empty {
padding: 4rem 1rem;
}
.console-group-card {
cursor: pointer;
}
.console-open {
display: inline-flex;
align-items: center;
gap: 0.35rem;
color: rgb(var(--wh-accent));
font-size: 0.75rem;
font-weight: 800;
}
@media (max-width: 900px) {
.console-shell {
display: block;
}
.console-sidebar {
display: none;
}
.console-mobile-nav {
display: block;
border-bottom: 1px solid rgb(var(--wh-border));
padding: 0.5rem 1rem;
overflow-x: auto;
}
.console-mobile-nav :deep(.rc-tabs) {
min-width: max-content;
}
}
@media (max-width: 620px) {
.console-topbar {
align-items: flex-start;
flex-direction: column;
}
.console-actions {
width: 100%;
justify-content: flex-start;
overflow-x: auto;
padding-bottom: 0.05rem;
}
.console-status {
display: none;
}
.console-content {
width: min(100% - 1.25rem, 1240px);
}
}
</style>
+36 -7
View File
@@ -15,9 +15,15 @@ const emit = defineEmits<{ (e: "remove"): void }>();
const { t } = useI18n();
const NODE_KINDS = ["all", "any"] as const;
const filterTypeOptions = computed(() => FILTER_TYPES.map((value) => ({ label: t("filter." + value), value })));
const filterOpOptions = computed(() => FILTER_OPS.map((value) => ({ label: t("filterOp." + value), value })));
const nodeKindOptions = computed(() => NODE_KINDS.map((value) => ({ label: t("filterNode." + value), value })));
const filterTypeOptions = computed(() =>
FILTER_TYPES.map((value) => ({ label: t("filter." + value), value })),
);
const filterOpOptions = computed(() =>
FILTER_OPS.map((value) => ({ label: t("filterOp." + value), value })),
);
const nodeKindOptions = computed(() =>
NODE_KINDS.map((value) => ({ label: t("filterNode." + value), value })),
);
function addChild(kind: "leaf" | "all" | "any" | "not"): void {
props.node.children.push(blankNode(kind));
@@ -60,7 +66,12 @@ function unwrapNot(): void {
:placeholder="t('routeEditor.valuesPlaceholder')"
/>
<RcCheckbox v-model="node.leaf.exclude" class="node-exclude" :label="t('routeEditor.not')" :title="t('routeEditor.not')" />
<RcCheckbox
v-model="node.leaf.exclude"
class="node-exclude"
:label="t('routeEditor.not')"
:title="t('routeEditor.not')"
/>
<RcButton
v-if="deletable"
@@ -79,13 +90,31 @@ function unwrapNot(): void {
<div class="node-group-head">
<RcSelect v-model="node.kind" class="node-combo" :options="nodeKindOptions" />
<div class="node-actions">
<RcButton type="button" variant="ghost" size="xs" class="node-add" @click="addChild('leaf')">
<RcButton
type="button"
variant="ghost"
size="xs"
class="node-add"
@click="addChild('leaf')"
>
+ {{ t("routeEditor.addLeaf") }}
</RcButton>
<RcButton type="button" variant="ghost" size="xs" class="node-add" @click="addChild('all')">
<RcButton
type="button"
variant="ghost"
size="xs"
class="node-add"
@click="addChild('all')"
>
+ {{ t("routeEditor.addGroup") }}
</RcButton>
<RcButton type="button" variant="ghost" size="xs" class="node-add" @click="addChild('not')">
<RcButton
type="button"
variant="ghost"
size="xs"
class="node-add"
@click="addChild('not')"
>
+ {{ t("routeEditor.addNot") }}
</RcButton>
<RcButton
+4 -2
View File
@@ -183,7 +183,10 @@
{ label: 'Telegram', value: 'telegram' },
{ label: t('groupEditor.logFeishu'), value: 'feishu' },
]"
@update:model-value="form.logPlatform = ($event === 'none' ? '' : $event) as '' | 'discord' | 'telegram' | 'feishu'"
@update:model-value="
form.logPlatform = ($event === 'none' ? '' : $event) as
'' | 'discord' | 'telegram' | 'feishu'
"
/>
<template v-if="form.logPlatform === 'discord'">
<RcInput
@@ -414,4 +417,3 @@ function save(): void {
box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.18);
}
</style>
+118 -9
View File
@@ -1,10 +1,14 @@
<template>
<main class="legal-shell">
<header class="legal-header">
<NuxtLink class="legal-brand" :to="q('/')"><AppLogo :size="28" /><span>WebHooker</span></NuxtLink>
<NuxtLink class="legal-brand" :to="q('/')"
><AppLogo :size="28" /><span>WebHooker</span></NuxtLink
>
<nav aria-label="Legal navigation">
<NuxtLink v-for="item in links" :key="item.key" :to="q(item.path)">
<RcBadge :variant="active === item.key ? 'brand' : 'subtle'" size="sm">{{ item.label }}</RcBadge>
<RcBadge :variant="active === item.key ? 'brand' : 'subtle'" size="sm">{{
item.label
}}</RcBadge>
</NuxtLink>
</nav>
</header>
@@ -13,7 +17,9 @@
<h1>{{ title }}</h1>
<span>{{ t("最后更新", "Last updated") }} · {{ updated }}</span>
</section>
<RcCard variant="outline" padding="lg" class="legal-card"><article class="legal-body" v-html="body" /></RcCard>
<RcCard variant="outline" padding="lg" class="legal-card"
><article class="legal-body" v-html="body"
/></RcCard>
<footer class="legal-footer">
<NuxtLink :to="q('/')">{{ t("返回首页", "Back to home") }}</NuxtLink>
<div class="legal-footer-actions">
@@ -39,15 +45,118 @@ const links = computed(() => [
{ key: "terms" as const, path: "/terms", label: t("服务条款", "Terms") },
{ key: "privacy" as const, path: "/privacy", label: t("隐私政策", "Privacy") },
]);
const altLink = computed(() => `${props.active === "terms" ? "/terms" : "/privacy"}?lang=${altLang.value}`);
const altLink = computed(
() => `${props.active === "terms" ? "/terms" : "/privacy"}?lang=${altLang.value}`,
);
useHead({ title: `${props.title} · WebHooker` });
</script>
<style scoped>
.legal-shell { position: relative; z-index: 1; width: min(100% - 2rem, 860px); margin: 0 auto; padding: 2rem 0 4rem; } .legal-header, .legal-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; } .legal-brand { display: inline-flex; align-items: center; gap: .6rem; color: rgb(var(--wh-text)); font-size: 1rem; font-weight: 800; text-decoration: none; letter-spacing: -.035em; } .legal-brand :deep(svg) { color: rgb(var(--wh-accent)); } nav { display: flex; gap: .35rem; } nav a { text-decoration: none; }
.legal-heading { max-width: 640px; padding: clamp(4rem, 11vw, 7rem) 0 clamp(2rem, 6vw, 3.5rem); } .legal-heading p { margin: 0 0 .75rem; color: rgb(var(--wh-accent)); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; } .legal-heading h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: -.06em; line-height: 1; } .legal-heading span { display: block; margin-top: 1rem; color: rgb(var(--wh-faint)); font-size: .78rem; }
.legal-card { box-shadow: 0 24px 60px rgb(var(--wh-text) / .06); } .legal-body :deep(h2) { margin: 2.25rem 0 .75rem; font-size: 1.1rem; letter-spacing: -.02em; } .legal-body :deep(h2:first-child) { margin-top: 0; } .legal-body :deep(p), .legal-body :deep(li) { color: rgb(var(--wh-body-text)); line-height: 1.8; } .legal-body :deep(a) { color: rgb(var(--wh-accent)); } .legal-body :deep(ul) { padding-left: 1.25rem; }
.legal-footer { margin-top: 1.5rem; color: rgb(var(--wh-muted)); font-size: .78rem; } .legal-footer-actions { display: flex; align-items: center; gap: .75rem; } .legal-footer a { color: inherit; text-decoration: none; } .legal-footer a:hover { color: rgb(var(--wh-accent)); }
@media (max-width: 520px) { .legal-shell { width: min(100% - 1.5rem, 860px); } .legal-header { align-items: flex-start; flex-direction: column; } }
.legal-shell {
position: relative;
z-index: 1;
width: min(100% - 2rem, 860px);
margin: 0 auto;
padding: 2rem 0 4rem;
}
.legal-header,
.legal-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}
.legal-brand {
display: inline-flex;
align-items: center;
gap: 0.6rem;
color: rgb(var(--wh-text));
font-size: 1rem;
font-weight: 800;
text-decoration: none;
letter-spacing: -0.035em;
}
.legal-brand :deep(svg) {
color: rgb(var(--wh-accent));
}
nav {
display: flex;
gap: 0.35rem;
}
nav a {
text-decoration: none;
}
.legal-heading {
max-width: 640px;
padding: clamp(4rem, 11vw, 7rem) 0 clamp(2rem, 6vw, 3.5rem);
}
.legal-heading p {
margin: 0 0 0.75rem;
color: rgb(var(--wh-accent));
font-size: 0.72rem;
font-weight: 800;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.legal-heading h1 {
margin: 0;
font-size: clamp(2.4rem, 7vw, 4rem);
letter-spacing: -0.06em;
line-height: 1;
}
.legal-heading span {
display: block;
margin-top: 1rem;
color: rgb(var(--wh-faint));
font-size: 0.78rem;
}
.legal-card {
box-shadow: 0 24px 60px rgb(var(--wh-text) / 0.06);
}
.legal-body :deep(h2) {
margin: 2.25rem 0 0.75rem;
font-size: 1.1rem;
letter-spacing: -0.02em;
}
.legal-body :deep(h2:first-child) {
margin-top: 0;
}
.legal-body :deep(p),
.legal-body :deep(li) {
color: rgb(var(--wh-body-text));
line-height: 1.8;
}
.legal-body :deep(a) {
color: rgb(var(--wh-accent));
}
.legal-body :deep(ul) {
padding-left: 1.25rem;
}
.legal-footer {
margin-top: 1.5rem;
color: rgb(var(--wh-muted));
font-size: 0.78rem;
}
.legal-footer-actions {
display: flex;
align-items: center;
gap: 0.75rem;
}
.legal-footer a {
color: inherit;
text-decoration: none;
}
.legal-footer a:hover {
color: rgb(var(--wh-accent));
}
@media (max-width: 520px) {
.legal-shell {
width: min(100% - 1.5rem, 860px);
}
.legal-header {
align-items: flex-start;
flex-direction: column;
}
}
</style>
+17 -4
View File
@@ -18,7 +18,9 @@
:disabled="saving"
@update:model-value="onRoleChange(m, $event)"
/>
<RcBadge v-else size="xs" class="role-pill" :class="m.role">{{ t("roles." + m.role) }}</RcBadge>
<RcBadge v-else size="xs" class="role-pill" :class="m.role">{{
t("roles." + m.role)
}}</RcBadge>
<RcButton
v-if="canEdit"
type="button"
@@ -62,12 +64,21 @@
<ul v-if="invites.length" class="invite-list">
<li v-for="inv in invites" :key="inv.token" class="invite-row">
<code class="invite-token">{{ shortToken(inv.token) }}</code>
<RcBadge size="xs" class="role-pill" :class="inv.role">{{ t("roles." + inv.role) }}</RcBadge>
<RcBadge size="xs" class="role-pill" :class="inv.role">{{
t("roles." + inv.role)
}}</RcBadge>
<span class="invite-exp">{{ fmtExp(inv.expiresAt) }}</span>
<RcButton type="button" variant="ghost" size="sm" @click="copyInvite(inv)">
{{ copied === inv.token ? t("members.copied") : t("members.copyLink") }}
</RcButton>
<RcButton type="button" variant="destructive" size="sm" class="icon-btn danger" @click="revoke(inv)">{{ t("members.revoke") }}</RcButton>
<RcButton
type="button"
variant="destructive"
size="sm"
class="icon-btn danger"
@click="revoke(inv)"
>{{ t("members.revoke") }}</RcButton
>
</li>
</ul>
<p v-else class="empty-log">{{ t("members.noInvites") }}</p>
@@ -101,7 +112,9 @@ const roleOptions = computed(() => [
{ label: t("roles.admin"), value: "admin" },
{ label: t("roles.viewer"), value: "viewer" },
]);
const inviteRoleOptions = computed(() => roleOptions.value.filter((option) => option.value !== "owner"));
const inviteRoleOptions = computed(() =>
roleOptions.value.filter((option) => option.value !== "owner"),
);
watch(
() => props.group,
+26 -4
View File
@@ -2,7 +2,12 @@
<RcCard variant="outline" padding="none" :class="cardClass">
<div class="route-card-main">
<div class="route-card-header">
<RcSwitch v-if="!readonly" :model-value="route.enabled" size="sm" @update:model-value="onToggle" />
<RcSwitch
v-if="!readonly"
:model-value="route.enabled"
size="sm"
@update:model-value="onToggle"
/>
<span v-if="readonly" class="dot" :class="route.enabled ? 'ok' : 'bad'"></span>
<div class="route-card-title">
<span class="route-name">{{ route.name || t("route.untitled") }}</span>
@@ -40,9 +45,26 @@
: "Discord"
}}
</RcBadge>
<RcBadge v-if="route.fallback" variant="warning" size="xs" class="route-badge route-badge-fallback">{{ t("route.fallback") }}</RcBadge>
<RcBadge v-if="route.stop" variant="destructive" size="xs" class="route-badge route-badge-stop">{{ t("route.stop") }}</RcBadge>
<RcBadge v-if="route.discordRoleIds?.length" size="xs" class="route-badge route-badge-role">@roles</RcBadge>
<RcBadge
v-if="route.fallback"
variant="warning"
size="xs"
class="route-badge route-badge-fallback"
>{{ t("route.fallback") }}</RcBadge
>
<RcBadge
v-if="route.stop"
variant="destructive"
size="xs"
class="route-badge route-badge-stop"
>{{ t("route.stop") }}</RcBadge
>
<RcBadge
v-if="route.discordRoleIds?.length"
size="xs"
class="route-badge route-badge-role"
>@roles</RcBadge
>
</div>
</div>
+252 -22
View File
@@ -94,35 +94,265 @@ const items = computed(() => {
const docs = lang.value === "zh" ? `${docsBase.value}/zh` : `${docsBase.value}/`;
const q = (p: string): string => `${p}?lang=${lang.value}`;
return [
{ href: docs, label: t("文档", "Documentation"), desc: t("部署、配置与事件参考", "Deployment, configuration & event reference"), icon: BookOpen, external: true },
{ href: repo.value, label: t("GitHub 仓库", "GitHub Repository"), desc: t("源代码、问题与发布", "Source code, issues & releases"), icon: Github, external: true },
{ href: q("/terms"), label: t("服务条款", "Terms of Service"), desc: t("使用本服务的条款", "The terms for using this service"), icon: FileCheck2, external: false },
{ href: q("/privacy"), label: t("隐私政策", "Privacy Policy"), desc: t("我们如何处理你的数据", "How we handle your data"), icon: ShieldCheck, external: false },
{ href: "/admin", label: t("登录控制台", "Sign in to Console"), desc: t("管理路由与分组", "Manage routes and groups"), icon: LogIn, external: false },
{
href: docs,
label: t("文档", "Documentation"),
desc: t("部署、配置与事件参考", "Deployment, configuration & event reference"),
icon: BookOpen,
external: true,
},
{
href: repo.value,
label: t("GitHub 仓库", "GitHub Repository"),
desc: t("源代码、问题与发布", "Source code, issues & releases"),
icon: Github,
external: true,
},
{
href: q("/terms"),
label: t("服务条款", "Terms of Service"),
desc: t("使用本服务的条款", "The terms for using this service"),
icon: FileCheck2,
external: false,
},
{
href: q("/privacy"),
label: t("隐私政策", "Privacy Policy"),
desc: t("我们如何处理你的数据", "How we handle your data"),
icon: ShieldCheck,
external: false,
},
{
href: "/admin",
label: t("登录控制台", "Sign in to Console"),
desc: t("管理路由与分组", "Manage routes and groups"),
icon: LogIn,
external: false,
},
];
});
useHead({
title: "WebHooker",
meta: [{ name: "description", content: lang.value === "zh" ? "GitHub webhook 转发到 Discord" : "GitHub webhooks forwarded to Discord" }],
meta: [
{
name: "description",
content:
lang.value === "zh"
? "GitHub webhook 转发到 Discord"
: "GitHub webhooks forwarded to Discord",
},
],
});
</script>
<style scoped>
.landing-shell { position: relative; z-index: 1; width: min(100% - 2rem, 880px); min-height: 100vh; margin: 0 auto; padding: clamp(4rem, 10vh, 8rem) 0 2rem; overflow-x: clip; }
.landing-shell::before { position: absolute; z-index: -1; top: 3rem; right: -7rem; width: 24rem; height: 24rem; border-radius: 999px; background: radial-gradient(circle, color-mix(in srgb, rgb(var(--wh-accent)) 18%, transparent), transparent 68%); content: ""; filter: blur(10px); }
.landing-hero { max-width: 640px; animation: intro 500ms ease-out both; }
.brand-lockup { display: flex; align-items: center; gap: 1.1rem; margin: 1.5rem 0; }
.brand-logo { box-shadow: 0 16px 38px rgb(var(--wh-accent) / .28); }
.eyebrow { margin: 0 0 .25rem; color: rgb(var(--wh-accent)); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.55rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -.07em; line-height: .88; } h1 span { color: rgb(var(--wh-accent)); }
.hero-copy { margin: 1.75rem 0 1.2rem; color: rgb(var(--wh-muted)); font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.8; }
.hero-meta { display: flex; align-items: center; gap: .75rem; color: rgb(var(--wh-faint)); font-size: .77rem; font-weight: 700; letter-spacing: .025em; } .hero-meta span:not(.meta-line) { display: inline-flex; align-items: center; gap: .35rem; } .meta-line { width: 1.5rem; height: 1px; background: rgb(var(--wh-border-strong)); }
.landing-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: clamp(2.5rem, 6vh, 4.5rem); }
.landing-action { overflow: hidden; animation: intro 500ms ease-out both; } .landing-action:nth-child(2) { animation-delay: 60ms; } .landing-action:nth-child(3) { animation-delay: 120ms; } .landing-action:nth-child(4) { animation-delay: 180ms; } .landing-action:nth-child(5) { animation-delay: 240ms; }
.landing-action a { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: .85rem; min-height: 6.7rem; padding: 1.15rem; color: inherit; text-decoration: none; }
.action-index { align-self: start; color: rgb(var(--wh-faint)); font-family: var(--font-mono); font-size: .63rem; } .action-icon { color: rgb(var(--wh-accent)); } .action-copy { display: grid; gap: .22rem; min-width: 0; } .action-copy strong { font-size: .95rem; } .action-copy small { color: rgb(var(--wh-muted)); font-size: .77rem; line-height: 1.4; } .action-arrow { color: rgb(var(--wh-faint)); transition: transform 150ms ease; } .landing-action:hover .action-arrow { color: rgb(var(--wh-accent)); transform: translate(2px, -2px); }
.landing-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; color: rgb(var(--wh-faint)); font-size: .75rem; } .landing-footer span { display: flex; align-items: center; gap: .45rem; } .landing-footer i { width: .22rem; height: .22rem; border-radius: 999px; background: rgb(var(--wh-accent)); } .landing-footer-actions { display: flex; align-items: center; gap: .75rem; } .landing-footer a { display: inline-flex; align-items: center; gap: .4rem; color: rgb(var(--wh-muted)); text-decoration: none; } .landing-footer a:hover { color: rgb(var(--wh-accent)); }
@keyframes intro { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 580px) { .landing-shell { width: min(100% - 1.5rem, 880px); padding-top: 3rem; } .landing-actions { grid-template-columns: 1fr; } .landing-footer { align-items: flex-start; flex-direction: column; } .hero-meta { align-items: flex-start; flex-direction: column; } .meta-line { display: none; } }
.landing-shell {
position: relative;
z-index: 1;
width: min(100% - 2rem, 880px);
min-height: 100vh;
margin: 0 auto;
padding: clamp(4rem, 10vh, 8rem) 0 2rem;
overflow-x: clip;
}
.landing-shell::before {
position: absolute;
z-index: -1;
top: 3rem;
right: -7rem;
width: 24rem;
height: 24rem;
border-radius: 999px;
background: radial-gradient(
circle,
color-mix(in srgb, rgb(var(--wh-accent)) 18%, transparent),
transparent 68%
);
content: "";
filter: blur(10px);
}
.landing-hero {
max-width: 640px;
animation: intro 500ms ease-out both;
}
.brand-lockup {
display: flex;
align-items: center;
gap: 1.1rem;
margin: 1.5rem 0;
}
.brand-logo {
box-shadow: 0 16px 38px rgb(var(--wh-accent) / 0.28);
}
.eyebrow {
margin: 0 0 0.25rem;
color: rgb(var(--wh-accent));
font-size: 0.7rem;
font-weight: 800;
letter-spacing: 0.15em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: clamp(2.55rem, 7vw, 4.6rem);
font-weight: 800;
letter-spacing: -0.07em;
line-height: 0.88;
}
h1 span {
color: rgb(var(--wh-accent));
}
.hero-copy {
margin: 1.75rem 0 1.2rem;
color: rgb(var(--wh-muted));
font-size: clamp(1rem, 2vw, 1.15rem);
line-height: 1.8;
}
.hero-meta {
display: flex;
align-items: center;
gap: 0.75rem;
color: rgb(var(--wh-faint));
font-size: 0.77rem;
font-weight: 700;
letter-spacing: 0.025em;
}
.hero-meta span:not(.meta-line) {
display: inline-flex;
align-items: center;
gap: 0.35rem;
}
.meta-line {
width: 1.5rem;
height: 1px;
background: rgb(var(--wh-border-strong));
}
.landing-actions {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.85rem;
margin-top: clamp(2.5rem, 6vh, 4.5rem);
}
.landing-action {
overflow: hidden;
animation: intro 500ms ease-out both;
}
.landing-action:nth-child(2) {
animation-delay: 60ms;
}
.landing-action:nth-child(3) {
animation-delay: 120ms;
}
.landing-action:nth-child(4) {
animation-delay: 180ms;
}
.landing-action:nth-child(5) {
animation-delay: 240ms;
}
.landing-action a {
display: grid;
grid-template-columns: auto auto 1fr auto;
align-items: center;
gap: 0.85rem;
min-height: 6.7rem;
padding: 1.15rem;
color: inherit;
text-decoration: none;
}
.action-index {
align-self: start;
color: rgb(var(--wh-faint));
font-family: var(--font-mono);
font-size: 0.63rem;
}
.action-icon {
color: rgb(var(--wh-accent));
}
.action-copy {
display: grid;
gap: 0.22rem;
min-width: 0;
}
.action-copy strong {
font-size: 0.95rem;
}
.action-copy small {
color: rgb(var(--wh-muted));
font-size: 0.77rem;
line-height: 1.4;
}
.action-arrow {
color: rgb(var(--wh-faint));
transition: transform 150ms ease;
}
.landing-action:hover .action-arrow {
color: rgb(var(--wh-accent));
transform: translate(2px, -2px);
}
.landing-footer {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
margin-top: 2rem;
color: rgb(var(--wh-faint));
font-size: 0.75rem;
}
.landing-footer span {
display: flex;
align-items: center;
gap: 0.45rem;
}
.landing-footer i {
width: 0.22rem;
height: 0.22rem;
border-radius: 999px;
background: rgb(var(--wh-accent));
}
.landing-footer-actions {
display: flex;
align-items: center;
gap: 0.75rem;
}
.landing-footer a {
display: inline-flex;
align-items: center;
gap: 0.4rem;
color: rgb(var(--wh-muted));
text-decoration: none;
}
.landing-footer a:hover {
color: rgb(var(--wh-accent));
}
@keyframes intro {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 580px) {
.landing-shell {
width: min(100% - 1.5rem, 880px);
padding-top: 3rem;
}
.landing-actions {
grid-template-columns: 1fr;
}
.landing-footer {
align-items: flex-start;
flex-direction: column;
}
.hero-meta {
align-items: flex-start;
flex-direction: column;
}
.meta-line {
display: none;
}
}
</style>
+6 -1
View File
@@ -16,6 +16,11 @@ const lang = computed(() => pickLang(String(route.query.lang ?? "")));
const contact = computed(() => legalContact(lang.value, String(config.public.legalContact ?? "")));
useHead({
meta: [{ name: "description", content: lang.value === "zh" ? "WebHooker 隐私政策" : "WebHooker Privacy Policy" }],
meta: [
{
name: "description",
content: lang.value === "zh" ? "WebHooker 隐私政策" : "WebHooker Privacy Policy",
},
],
});
</script>
+6 -1
View File
@@ -16,6 +16,11 @@ const lang = computed(() => pickLang(String(route.query.lang ?? "")));
const contact = computed(() => legalContact(lang.value, String(config.public.legalContact ?? "")));
useHead({
meta: [{ name: "description", content: lang.value === "zh" ? "WebHooker 服务条款" : "WebHooker Terms of Service" }],
meta: [
{
name: "description",
content: lang.value === "zh" ? "WebHooker 服务条款" : "WebHooker Terms of Service",
},
],
});
</script>