style(console): refine route and group cards layout and remove duplicate back arrow

This commit is contained in:
RhenCloud committed 2026-10-04 00:05:37 +08:00
1 parent 37d2eb3636
commit c9afd8639a
4 files changed
+114 -85

No files matched your search

+31 -19
View File
@@ -284,19 +284,19 @@
/* ---- Route cards ---- */ /* ---- Route cards ---- */
.route-card { .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 { .route-card:hover {
@apply border-border-strong; @apply border-border-strong shadow-sm;
} }
.route-card.disabled { .route-card.disabled {
@apply opacity-50; @apply opacity-60;
} }
.route-card-main { .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 { .route-card-header {
@@ -304,7 +304,15 @@
} }
.route-card-title { .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 { .route-card-badges {
@@ -312,7 +320,7 @@
} }
.route-badge { .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 { .route-badge-dot {
@@ -320,11 +328,15 @@
} }
.route-badge-dc { .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 { .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 { .route-badge-fallback {
@@ -340,15 +352,15 @@
} }
.route-card-filters { .route-card-filters {
@apply flex flex-wrap gap-1.5; @apply flex flex-wrap items-center gap-2 text-xs;
} }
.route-chip { .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 { .route-chip-type {
@apply font-bold uppercase tracking-wider text-faint; @apply font-bold uppercase tracking-wider text-faint text-[10px];
} }
.route-chip-val { .route-chip-val {
@@ -364,35 +376,35 @@
} }
.route-chip-empty { .route-chip-empty {
@apply italic; @apply italic text-muted;
} }
.route-card-targets { .route-card-targets {
@apply space-y-1.5; @apply flex flex-wrap items-center gap-2 text-xs;
} }
.route-target { .route-target {
@apply space-y-1; @apply inline-flex items-center;
} }
.route-target-row { .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 { .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 { .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 { .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 { .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 { .route-action-btn-danger:hover {
+54 -39
View File
@@ -108,7 +108,7 @@
<p v-if="groupRoutesError" class="err">{{ groupRoutesError }}</p> <p v-if="groupRoutesError" class="err">{{ groupRoutesError }}</p>
<section class="routes"> <section class="space-y-2.5">
<RouteCard <RouteCard
v-for="(r, i) in groupRoutes" v-for="(r, i) in groupRoutes"
:key="r.id" :key="r.id"
@@ -159,58 +159,73 @@
<p v-if="groupsError" class="err">{{ groupsError }}</p> <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 <RcCard
v-for="(g, i) in groups" v-for="(g, i) in groups"
:key="g.id" :key="g.id"
variant="outline" variant="outline"
:hoverable="true" :hoverable="true"
padding="md" padding="none"
class="console-group-card" class="console-group-card transition-all hover:border-border-strong hover:shadow-xs"
:style="{ animationDelay: i * 45 + 'ms' }" :style="{ animationDelay: i * 35 + 'ms' }"
@click="enterGroup(g)" @click="enterGroup(g)"
> >
<template #header <div class="p-4 space-y-3">
><div class="card-head"> <div class="flex items-start justify-between gap-2.5">
<div class="card-title"> <div class="min-w-0 flex-1">
<span class="route-name">{{ g.name || t("route.untitled") }}</span> <div class="flex items-center gap-2">
<span class="route-id">{{ g.id }}</span> <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">{{ <RcBadge v-if="roleOf(g.id)" variant="brand" size="xs">
t("role.badge", { role: t("roles." + roleOf(g.id)) }) {{ t("role.badge", { role: t("roles." + roleOf(g.id)) }) }}
}}</RcBadge> </RcBadge>
</div>
<div class="mt-0.5 font-mono text-[11px] text-faint truncate">{{ g.id }}</div>
</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 <RcButton
variant="ghost" variant="ghost"
size="icon" size="icon"
class="h-7 w-7 text-muted hover:text-text"
:title="t('groupEditor.editTitle')" :title="t('groupEditor.editTitle')"
@click="openEditGroup(g)" @click="openEditGroup(g)"
><Pencil :size="15" >
/></RcButton> <Pencil :size="13.5" />
<RcButton variant="ghost" color="error" size="icon" @click="onDeleteGroup(g)" </RcButton>
><Trash2 :size="15" <RcButton
/></RcButton> variant="ghost"
</div></div color="error"
></template> size="icon"
<div class="target"> class="h-7 w-7 text-muted hover:text-bad"
<span @click="onDeleteGroup(g)"
><b>{{ t("groups.members") }}</b >
><code>{{ <Trash2 :size="13.5" />
(g.members ?? []).length || (g.adminIds || []).length || "—" </RcButton>
}}</code></span </div>
> </div>
<span
><b>{{ t("groups.owners") }}</b <div class="space-y-1.5 text-xs">
><code>{{ <div class="flex items-center justify-between text-[11.5px]">
g.owners && g.owners.length ? g.owners.join(", ") : t("groups.any") <span class="text-faint font-semibold">{{ t("groups.members") }}</span>
}}</code></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> </div>
<template #footer
><span class="console-open"
><ArrowRight :size="15" />{{ t("groups.open") }}</span
></template
>
</RcCard> </RcCard>
</section> </section>
+27 -25
View File
@@ -68,32 +68,34 @@
</div> </div>
</div> </div>
<div class="route-card-filters"> <div class="flex flex-wrap items-center gap-3">
<span v-if="summary" class="route-chip"> <div class="route-card-filters">
<span class="route-chip-val">{{ summary }}</span> <span v-if="summary" class="route-chip">
</span> <span class="route-chip-val">{{ summary }}</span>
<span v-else class="route-chip route-chip-empty"> </span>
<span class="route-chip-type">{{ t("route.noFilters") }}</span> <span v-else class="route-chip route-chip-empty">
</span> <span class="route-chip-type">{{ t("route.noFilters") }}</span>
</div> </span>
</div>
<div class="route-card-targets" v-if="route.targets.length"> <div v-if="route.targets.length" class="route-card-targets">
<div v-for="(tg, i) in route.targets" :key="i" class="route-target"> <div v-for="(tg, i) in route.targets" :key="i" class="route-target">
<div class="route-target-row"> <div class="route-target-row">
<span class="route-target-label"> <span class="route-target-label">
<template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{ <template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{
t("route.chat") t("route.chat")
}}</template> }}</template>
<template v-else-if="tg.threadId">{{ t("route.thread") }}</template> <template v-else-if="tg.threadId">{{ t("route.thread") }}</template>
<template v-else>{{ t("route.channel") }}</template> <template v-else>{{ t("route.channel") }}</template>
</span> </span>
<code class="route-target-id"> <code class="route-target-id">
<template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{ <template v-if="tg.platform === 'telegram' || tg.platform === 'feishu'">{{
tg.chatId tg.chatId
}}</template> }}</template>
<template v-else-if="tg.threadId">{{ tg.threadId }}</template> <template v-else-if="tg.threadId">{{ tg.threadId }}</template>
<template v-else>{{ tg.channelId }}</template> <template v-else>{{ tg.channelId }}</template>
</code> </code>
</div>
</div> </div>
</div> </div>
</div> </div>
+2 -2
View File
@@ -138,7 +138,7 @@ const en: Dict = {
"groups.members": "MEMBERS", "groups.members": "MEMBERS",
"groups.any": "any", "groups.any": "any",
"groups.open": "Open →", "groups.open": "Open →",
"group.back": "← Groups", "group.back": "Groups",
"group.routesIn": "Routes in {name}", "group.routesIn": "Routes in {name}",
"routes.emptyGroup": "No routes in this group yet.", "routes.emptyGroup": "No routes in this group yet.",
"routes.createFirst": "Create your first route", "routes.createFirst": "Create your first route",
@@ -528,7 +528,7 @@ const zh: Dict = {
"groups.members": "成员", "groups.members": "成员",
"groups.any": "任意", "groups.any": "任意",
"groups.open": "进入 →", "groups.open": "进入 →",
"group.back": "← 返回分组", "group.back": "返回分组",
"group.routesIn": "{name} 的路由", "group.routesIn": "{name} 的路由",
"routes.emptyGroup": "该分组还没有路由。", "routes.emptyGroup": "该分组还没有路由。",
"routes.createFirst": "创建第一个路由", "routes.createFirst": "创建第一个路由",