mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-20 17:13:49 +00:00
style(console): refine route and group cards layout and remove duplicate back arrow
This commit is contained in:
4 files changed
+114
-85
No files matched your search
+31
-19
@@ -284,19 +284,19 @@
|
||||
|
||||
/* ---- Route cards ---- */
|
||||
.route-card {
|
||||
@apply flex animate-rise items-start gap-4 rounded border border-border bg-surface p-4 transition-[border-color,opacity] duration-150;
|
||||
@apply flex animate-rise items-center gap-4 rounded-xl border border-border bg-surface px-5 py-3.5 shadow-xs transition-all duration-150;
|
||||
}
|
||||
|
||||
.route-card:hover {
|
||||
@apply border-border-strong;
|
||||
@apply border-border-strong shadow-sm;
|
||||
}
|
||||
|
||||
.route-card.disabled {
|
||||
@apply opacity-50;
|
||||
@apply opacity-60;
|
||||
}
|
||||
|
||||
.route-card-main {
|
||||
@apply min-w-0 flex-1 space-y-3;
|
||||
@apply min-w-0 flex-1 space-y-2.5;
|
||||
}
|
||||
|
||||
.route-card-header {
|
||||
@@ -304,7 +304,15 @@
|
||||
}
|
||||
|
||||
.route-card-title {
|
||||
@apply flex min-w-0 items-center gap-2;
|
||||
@apply flex min-w-0 flex-wrap items-center gap-2;
|
||||
}
|
||||
|
||||
.route-name {
|
||||
@apply text-[15px] font-semibold tracking-tight text-text;
|
||||
}
|
||||
|
||||
.route-id {
|
||||
@apply rounded-md bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-faint;
|
||||
}
|
||||
|
||||
.route-card-badges {
|
||||
@@ -312,7 +320,7 @@
|
||||
}
|
||||
|
||||
.route-badge {
|
||||
@apply inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-[10.5px] font-semibold;
|
||||
@apply inline-flex items-center gap-1.5 rounded-full border border-border px-2.5 py-0.5 text-[11px] font-medium;
|
||||
}
|
||||
|
||||
.route-badge-dot {
|
||||
@@ -320,11 +328,15 @@
|
||||
}
|
||||
|
||||
.route-badge-dc {
|
||||
@apply bg-accent-dim/30 text-accent-text;
|
||||
@apply border-accent/20 bg-accent-dim/30 text-accent-text;
|
||||
}
|
||||
|
||||
.route-badge-tg {
|
||||
@apply bg-info-dim/30 text-info;
|
||||
@apply border-info/20 bg-info-dim/30 text-info;
|
||||
}
|
||||
|
||||
.route-badge-fs {
|
||||
@apply border-warn/20 bg-warn-dim/30 text-warn;
|
||||
}
|
||||
|
||||
.route-badge-fallback {
|
||||
@@ -340,15 +352,15 @@
|
||||
}
|
||||
|
||||
.route-card-filters {
|
||||
@apply flex flex-wrap gap-1.5;
|
||||
@apply flex flex-wrap items-center gap-2 text-xs;
|
||||
}
|
||||
|
||||
.route-chip {
|
||||
@apply inline-flex items-center gap-1 rounded border border-border bg-surface-2 px-2 py-0.5 text-[11px];
|
||||
@apply inline-flex items-center gap-1.5 rounded-md border border-border bg-surface-2 px-2.5 py-1 text-[11.5px];
|
||||
}
|
||||
|
||||
.route-chip-type {
|
||||
@apply font-bold uppercase tracking-wider text-faint;
|
||||
@apply font-bold uppercase tracking-wider text-faint text-[10px];
|
||||
}
|
||||
|
||||
.route-chip-val {
|
||||
@@ -364,35 +376,35 @@
|
||||
}
|
||||
|
||||
.route-chip-empty {
|
||||
@apply italic;
|
||||
@apply italic text-muted;
|
||||
}
|
||||
|
||||
.route-card-targets {
|
||||
@apply space-y-1.5;
|
||||
@apply flex flex-wrap items-center gap-2 text-xs;
|
||||
}
|
||||
|
||||
.route-target {
|
||||
@apply space-y-1;
|
||||
@apply inline-flex items-center;
|
||||
}
|
||||
|
||||
.route-target-row {
|
||||
@apply flex items-center gap-2 text-xs;
|
||||
@apply inline-flex items-center gap-1.5 rounded-md border border-border/80 bg-surface-2/60 px-2 py-0.5 text-xs;
|
||||
}
|
||||
|
||||
.route-target-label {
|
||||
@apply shrink-0 rounded border border-border bg-surface-2 px-1.5 py-px text-[10px] font-bold uppercase tracking-wider text-faint;
|
||||
@apply shrink-0 text-[10px] font-bold uppercase tracking-wider text-faint;
|
||||
}
|
||||
|
||||
.route-target-id {
|
||||
@apply rounded-[5px] bg-surface-2 px-1.5 py-px font-mono text-[11.5px] leading-relaxed text-text;
|
||||
@apply font-mono text-[11.5px] text-text;
|
||||
}
|
||||
|
||||
.route-card-actions {
|
||||
@apply flex shrink-0 flex-col gap-0.5;
|
||||
@apply flex shrink-0 items-center gap-1 self-center;
|
||||
}
|
||||
|
||||
.route-action-btn {
|
||||
@apply flex h-7 w-7 items-center justify-center rounded text-muted transition-colors hover:bg-surface-2 hover:text-text disabled:pointer-events-none disabled:opacity-25;
|
||||
@apply flex h-7 w-7 items-center justify-center rounded-md text-muted transition-colors hover:bg-surface-2 hover:text-text disabled:pointer-events-none disabled:opacity-25;
|
||||
}
|
||||
|
||||
.route-action-btn-danger:hover {
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
<p v-if="groupRoutesError" class="err">{{ groupRoutesError }}</p>
|
||||
|
||||
<section class="routes">
|
||||
<section class="space-y-2.5">
|
||||
<RouteCard
|
||||
v-for="(r, i) in groupRoutes"
|
||||
:key="r.id"
|
||||
@@ -159,58 +159,73 @@
|
||||
|
||||
<p v-if="groupsError" class="err">{{ groupsError }}</p>
|
||||
|
||||
<section class="routes">
|
||||
<section class="grid grid-cols-1 gap-3.5 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<RcCard
|
||||
v-for="(g, i) in groups"
|
||||
:key="g.id"
|
||||
variant="outline"
|
||||
:hoverable="true"
|
||||
padding="md"
|
||||
class="console-group-card"
|
||||
:style="{ animationDelay: i * 45 + 'ms' }"
|
||||
padding="none"
|
||||
class="console-group-card transition-all hover:border-border-strong hover:shadow-xs"
|
||||
:style="{ animationDelay: i * 35 + '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 class="p-4 space-y-3">
|
||||
<div class="flex items-start justify-between gap-2.5">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="truncate text-[15px] font-semibold text-text">{{ g.name || t("route.untitled") }}</span>
|
||||
<RcBadge v-if="roleOf(g.id)" variant="brand" size="xs">
|
||||
{{ t("role.badge", { role: t("roles." + roleOf(g.id)) }) }}
|
||||
</RcBadge>
|
||||
</div>
|
||||
<div class="mt-0.5 font-mono text-[11px] text-faint truncate">{{ g.id }}</div>
|
||||
</div>
|
||||
<div v-if="canEditGroup(g.id)" class="card-actions" @click.stop>
|
||||
<div v-if="canEditGroup(g.id)" class="flex shrink-0 items-center gap-1" @click.stop>
|
||||
<RcButton
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
class="h-7 w-7 text-muted hover:text-text"
|
||||
: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
|
||||
><code>{{
|
||||
(g.members ?? []).length || (g.adminIds || []).length || "—"
|
||||
}}</code></span
|
||||
>
|
||||
<span
|
||||
><b>{{ t("groups.owners") }}</b
|
||||
><code>{{
|
||||
g.owners && g.owners.length ? g.owners.join(", ") : t("groups.any")
|
||||
}}</code></span
|
||||
>
|
||||
>
|
||||
<Pencil :size="13.5" />
|
||||
</RcButton>
|
||||
<RcButton
|
||||
variant="ghost"
|
||||
color="error"
|
||||
size="icon"
|
||||
class="h-7 w-7 text-muted hover:text-bad"
|
||||
@click="onDeleteGroup(g)"
|
||||
>
|
||||
<Trash2 :size="13.5" />
|
||||
</RcButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-1.5 text-xs">
|
||||
<div class="flex items-center justify-between text-[11.5px]">
|
||||
<span class="text-faint font-semibold">{{ t("groups.members") }}</span>
|
||||
<span class="rounded bg-surface-2 px-1.5 py-0.5 font-mono text-text">
|
||||
{{ (g.members ?? []).length || (g.adminIds || []).length || 0 }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="g.owners?.length" class="flex items-center justify-between text-[11.5px]">
|
||||
<span class="text-faint font-semibold">{{ t("groups.owners") }}</span>
|
||||
<span class="truncate max-w-[170px] text-muted text-right font-mono text-[11px]">
|
||||
{{ g.owners.join(", ") }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between pt-2 border-t border-border/70 text-xs">
|
||||
<span class="text-faint text-[11px]">{{ t("group.routesIn", { name: "" }).replace(/[\s::]/g, '') }}</span>
|
||||
<span class="inline-flex items-center gap-1 font-semibold text-accent hover:underline">
|
||||
{{ t("groups.open") }}
|
||||
<ArrowRight :size="12" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer
|
||||
><span class="console-open"
|
||||
><ArrowRight :size="15" />{{ t("groups.open") }}</span
|
||||
></template
|
||||
>
|
||||
</RcCard>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -68,32 +68,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="route-card-filters">
|
||||
<span v-if="summary" class="route-chip">
|
||||
<span class="route-chip-val">{{ summary }}</span>
|
||||
</span>
|
||||
<span v-else class="route-chip route-chip-empty">
|
||||
<span class="route-chip-type">{{ t("route.noFilters") }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<div class="route-card-filters">
|
||||
<span v-if="summary" class="route-chip">
|
||||
<span class="route-chip-val">{{ summary }}</span>
|
||||
</span>
|
||||
<span v-else class="route-chip route-chip-empty">
|
||||
<span class="route-chip-type">{{ t("route.noFilters") }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="route-card-targets" v-if="route.targets.length">
|
||||
<div v-for="(tg, i) in route.targets" :key="i" class="route-target">
|
||||
<div class="route-target-row">
|
||||
<span class="route-target-label">
|
||||
<template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{
|
||||
t("route.chat")
|
||||
}}</template>
|
||||
<template v-else-if="tg.threadId">{{ t("route.thread") }}</template>
|
||||
<template v-else>{{ t("route.channel") }}</template>
|
||||
</span>
|
||||
<code class="route-target-id">
|
||||
<template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{
|
||||
tg.chatId
|
||||
}}</template>
|
||||
<template v-else-if="tg.threadId">{{ tg.threadId }}</template>
|
||||
<template v-else>{{ tg.channelId }}</template>
|
||||
</code>
|
||||
<div v-if="route.targets.length" class="route-card-targets">
|
||||
<div v-for="(tg, i) in route.targets" :key="i" class="route-target">
|
||||
<div class="route-target-row">
|
||||
<span class="route-target-label">
|
||||
<template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{
|
||||
t("route.chat")
|
||||
}}</template>
|
||||
<template v-else-if="tg.threadId">{{ t("route.thread") }}</template>
|
||||
<template v-else>{{ t("route.channel") }}</template>
|
||||
</span>
|
||||
<code class="route-target-id">
|
||||
<template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{
|
||||
tg.chatId
|
||||
}}</template>
|
||||
<template v-else-if="tg.threadId">{{ tg.threadId }}</template>
|
||||
<template v-else>{{ tg.channelId }}</template>
|
||||
</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -138,7 +138,7 @@ const en: Dict = {
|
||||
"groups.members": "MEMBERS",
|
||||
"groups.any": "any",
|
||||
"groups.open": "Open →",
|
||||
"group.back": "← Groups",
|
||||
"group.back": "Groups",
|
||||
"group.routesIn": "Routes in {name}",
|
||||
"routes.emptyGroup": "No routes in this group yet.",
|
||||
"routes.createFirst": "Create your first route",
|
||||
@@ -528,7 +528,7 @@ const zh: Dict = {
|
||||
"groups.members": "成员",
|
||||
"groups.any": "任意",
|
||||
"groups.open": "进入 →",
|
||||
"group.back": "← 返回分组",
|
||||
"group.back": "返回分组",
|
||||
"group.routesIn": "{name} 的路由",
|
||||
"routes.emptyGroup": "该分组还没有路由。",
|
||||
"routes.createFirst": "创建第一个路由",
|
||||
|
||||
Reference in new issue
Block a user