feat(webui): Apple-style overview pass + roomier stat tiles

- Grid row height 80→108px so a 1-row stat tile's icon + 3 text lines clear
  the padding with real breathing room (the previous fix still clipped ~8px);
  stat tile gets an airier layout (size-10 icon, text-lg value, py-3.5).
- Carry the app's Apple language across the homepage: inner surfaces and
  empty-state containers round to xl, empty-state icons calm to size-8/opacity,
  edit hint + first-run nudge rounded consistently.
This commit is contained in:
DrSmoothl committed 2026-06-14 16:20:19 +08:00
1 parent 44a29c6ee4
commit 8f61b1486e
2 files changed
+23 -20

No files matched your search

@@ -94,7 +94,7 @@ export function OverviewPage() {
)} )}
{editing && ( {editing && (
<p className="rounded-lg border border-primary/20 bg-primary/5 px-3 py-2 text-[11px] text-muted-foreground"> <p className="rounded-xl border border-primary/20 bg-primary/5 px-3.5 py-2.5 text-[11px] leading-relaxed text-muted-foreground">
拖动卡片顶部的「拖动」手柄移动位置、拖右下角缩放;眼睛图标显隐、齿轮改设置。左侧导航也可在编辑态拖动排序。 拖动卡片顶部的「拖动」手柄移动位置、拖右下角缩放;眼睛图标显隐、齿轮改设置。左侧导航也可在编辑态拖动排序。
</p> </p>
)} )}
@@ -106,7 +106,7 @@ export function OverviewPage() {
to="/processes" to="/processes"
className="flex items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 px-4 py-3 transition-colors hover:bg-primary/10" className="flex items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 px-4 py-3 transition-colors hover:bg-primary/10"
> >
<div className="flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary"> <div className="flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/15 text-primary">
<PlugZap className="size-5" /> <PlugZap className="size-5" />
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
@@ -154,7 +154,7 @@ export function OverviewPage() {
function EmptyLayout({ onReset }: { onReset: () => void }) { function EmptyLayout({ onReset }: { onReset: () => void }) {
return ( return (
<div className="flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed py-16 text-muted-foreground"> <div className="flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed py-16 text-muted-foreground">
<MonitorCog className="size-8" strokeWidth={1.5} /> <MonitorCog className="size-8 opacity-40" strokeWidth={1.5} />
<p className="text-sm">所有总览卡片都已隐藏</p> <p className="text-sm">所有总览卡片都已隐藏</p>
<Button variant="outline" size="sm" onClick={onReset}>恢复默认布局</Button> <Button variant="outline" size="sm" onClick={onReset}>恢复默认布局</Button>
</div> </div>
@@ -174,10 +174,10 @@ function StatTile({
to?: AppPath; to?: AppPath;
}) { }) {
const body = ( const body = (
<CardContent className="flex h-full items-center gap-2.5 overflow-hidden px-4 py-2"> <CardContent className="flex h-full items-center gap-3 overflow-hidden px-4 py-3.5">
<div <div
className={cn( className={cn(
'flex size-9 shrink-0 items-center justify-center rounded-xl', 'flex size-10 shrink-0 items-center justify-center rounded-xl',
accent ? 'bg-primary text-primary-foreground' : 'bg-primary/10 text-primary', accent ? 'bg-primary text-primary-foreground' : 'bg-primary/10 text-primary',
)} )}
> >
@@ -185,8 +185,8 @@ function StatTile({
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="truncate text-[11px] font-medium uppercase leading-tight tracking-wider text-muted-foreground">{label}</p> <p className="truncate text-[11px] font-medium uppercase leading-tight tracking-wider text-muted-foreground">{label}</p>
<div className="mt-0.5 truncate text-[15px] font-semibold leading-tight tabular-nums">{value}</div> <div className="mt-1 truncate text-lg font-semibold leading-tight tabular-nums">{value}</div>
{subtext && <p className="mt-0.5 truncate text-[11px] leading-tight text-muted-foreground">{subtext}</p>} {subtext && <p className="mt-1 truncate text-[11px] leading-tight text-muted-foreground">{subtext}</p>}
</div> </div>
{to && <ArrowRight className="size-4 shrink-0 text-muted-foreground/60" />} {to && <ArrowRight className="size-4 shrink-0 text-muted-foreground/60" />}
</CardContent> </CardContent>
@@ -283,7 +283,7 @@ function HostBlock() {
</CardHeader> </CardHeader>
<CardContent className="grid flex-1 grid-cols-1 gap-4 lg:grid-cols-3"> <CardContent className="grid flex-1 grid-cols-1 gap-4 lg:grid-cols-3">
{/* CPU */} {/* CPU */}
<div className="rounded-lg border bg-card/40 p-4"> <div className="rounded-xl border bg-card/40 p-4">
<div className="mb-2 flex items-center justify-between"> <div className="mb-2 flex items-center justify-between">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Cpu className="size-4 text-primary" /> <Cpu className="size-4 text-primary" />
@@ -308,7 +308,7 @@ function HostBlock() {
)} )}
</div> </div>
{/* Memory */} {/* Memory */}
<div className="rounded-lg border bg-card/40 p-4"> <div className="rounded-xl border bg-card/40 p-4">
<div className="mb-2 flex items-center justify-between"> <div className="mb-2 flex items-center justify-between">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<MemoryStick className="size-4 text-primary" /> <MemoryStick className="size-4 text-primary" />
@@ -325,7 +325,7 @@ function HostBlock() {
</div> </div>
</div> </div>
{/* Runtime */} {/* Runtime */}
<div className="rounded-lg border bg-card/40 p-4"> <div className="rounded-xl border bg-card/40 p-4">
<div className="mb-2 flex items-center justify-between"> <div className="mb-2 flex items-center justify-between">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Server className="size-4 text-primary" /> <Server className="size-4 text-primary" />
@@ -390,8 +390,8 @@ function SessionsBlock({ config }: { config: SessionsConfig }) {
</CardHeader> </CardHeader>
<CardContent className="min-h-0 flex-1"> <CardContent className="min-h-0 flex-1">
{list.length === 0 ? ( {list.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed py-10 text-muted-foreground"> <div className="flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed py-10 text-muted-foreground">
<Users className="size-7" strokeWidth={1.5} /> <Users className="size-8 opacity-40" strokeWidth={1.5} />
<p className="text-sm">{qqList.length === 0 ? '暂无在线会话' : '无匹配的会话'}</p> <p className="text-sm">{qqList.length === 0 ? '暂无在线会话' : '无匹配的会话'}</p>
</div> </div>
) : ( ) : (
@@ -404,7 +404,7 @@ function SessionsBlock({ config }: { config: SessionsConfig }) {
animate={{ opacity: 1, y: 0 }} animate={{ opacity: 1, y: 0 }}
transition={off ? { duration: 0 } : { delay: 0.03 + idx * 0.04, duration: 0.22 }} transition={off ? { duration: 0 } : { delay: 0.03 + idx * 0.04, duration: 0.22 }}
whileHover={off ? undefined : { y: -2 }} whileHover={off ? undefined : { y: -2 }}
className="flex items-center gap-3 rounded-lg border bg-card/40 p-3" className="flex items-center gap-3 rounded-xl border bg-card/40 p-3"
> >
<Avatar size={40}> <Avatar size={40}>
<AvatarImage src={qqAvatarUrl(q.uin)} alt={q.nickname || q.uin} /> <AvatarImage src={qqAvatarUrl(q.uin)} alt={q.nickname || q.uin} />
@@ -452,8 +452,8 @@ function ConnectionsBlock() {
</CardHeader> </CardHeader>
<CardContent className="min-h-0 flex-1 overflow-auto"> <CardContent className="min-h-0 flex-1 overflow-auto">
{connections.length === 0 ? ( {connections.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed py-10 text-muted-foreground"> <div className="flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed py-10 text-muted-foreground">
<Cable className="size-7" strokeWidth={1.5} /> <Cable className="size-8 opacity-40" strokeWidth={1.5} />
<p className="text-sm">暂无已接入的账号实例</p> <p className="text-sm">暂无已接入的账号实例</p>
</div> </div>
) : ( ) : (
@@ -469,7 +469,7 @@ function ConnectionsBlock() {
) : ( ) : (
<div className="flex flex-col gap-1.5"> <div className="flex flex-col gap-1.5">
{acc.adapters.map((adp) => ( {acc.adapters.map((adp) => (
<div key={adp.name} className="flex items-center gap-2 rounded-lg border bg-card/40 px-3 py-2"> <div key={adp.name} className="flex items-center gap-2 rounded-xl border bg-card/40 px-3 py-2">
<span className={cn('shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium', CONN_STATUS_STYLE[adp.status])}> <span className={cn('shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium', CONN_STATUS_STYLE[adp.status])}>
{CONN_STATUS_LABEL[adp.status]} {CONN_STATUS_LABEL[adp.status]}
</span> </span>
@@ -545,8 +545,8 @@ function RecentAlertsCard({ config }: { config: AlertsConfig }) {
</CardHeader> </CardHeader>
<CardContent className="min-h-0 flex-1 overflow-auto"> <CardContent className="min-h-0 flex-1 overflow-auto">
{alerts.length === 0 ? ( {alerts.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed py-10 text-muted-foreground"> <div className="flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed py-10 text-muted-foreground">
<Bell className="size-7" strokeWidth={1.5} /> <Bell className="size-8 opacity-40" strokeWidth={1.5} />
<p className="text-sm">暂无告警</p> <p className="text-sm">暂无告警</p>
</div> </div>
) : ( ) : (
+5 -2
View File
@@ -6,8 +6,11 @@ import type { LogLevel, UiLayoutItem } from '@/types';
// (render + min sizes), and the layout editor (labels) without import cycles. // (render + min sizes), and the layout editor (labels) without import cycles.
export const GRID_COLS = 12; export const GRID_COLS = 12;
/** px per grid row. Tiles are 1 row; cards a few rows. */ /** px per grid row. Tiles are 1 row; cards a few rows. Sized so a 1-row stat
export const GRID_CELL_HEIGHT = 80; * tile's icon + 3 text lines (label + text-lg value + subtext) clear the
* py-3.5 padding with breathing room: item content ≈ cellHeight − 2·margin −
* card border ≈ 90px > the ~86px the content needs. */
export const GRID_CELL_HEIGHT = 108;
export const GRID_MARGIN = 8; export const GRID_MARGIN = 8;
export interface GridWidgetSpec { export interface GridWidgetSpec {