feat(webui): apply Apple-style polish to processes + config pages
Carry the logs/settings visual language across the remaining pages: - Processes: sort control becomes a segmented radiogroup; action banner gains a spinner; cards round to xl with a hover tint; calmer empty state. - Config: save status collapses from bordered pills into one inline dot/spinner indicator; node summary rows round to xl with hover and fold the three flag badges into a single muted "数组 · 不上报自身 · 已设 Token" line; empty states round to xl; account rail rounds to xl. Presentational only — all state wiring and handlers unchanged.
This commit is contained in:
4 files changed
+41
-52
No files matched your search
@@ -35,7 +35,7 @@ export function AccountSidebar({
|
|||||||
<motion.aside
|
<motion.aside
|
||||||
animate={{ width: collapsed ? 56 : 248 }}
|
animate={{ width: collapsed ? 56 : 248 }}
|
||||||
transition={{ type: 'spring', stiffness: 300, damping: 32 }}
|
transition={{ type: 'spring', stiffness: 300, damping: 32 }}
|
||||||
className="shrink-0 rounded-lg border bg-card/40"
|
className="shrink-0 rounded-xl border bg-card/40"
|
||||||
>
|
>
|
||||||
<div className={cn('flex items-center', collapsed ? 'justify-center px-1.5 py-2' : 'justify-between px-3 py-2')}>
|
<div className={cn('flex items-center', collapsed ? 'justify-center px-1.5 py-2' : 'justify-between px-3 py-2')}>
|
||||||
{!collapsed && <span className="text-xs font-medium text-muted-foreground">在线连接</span>}
|
{!collapsed && <span className="text-xs font-medium text-muted-foreground">在线连接</span>}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function NodeSummaryCard<T extends AdapterCommon>({
|
|||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{ duration: 0.18 }}
|
transition={{ duration: 0.18 }}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex flex-col gap-2 rounded-lg border bg-card/40 p-3 transition-opacity sm:flex-row sm:items-center sm:gap-3',
|
'flex flex-col gap-2 rounded-xl border bg-card/40 p-3.5 transition-all hover:bg-accent/20 sm:flex-row sm:items-center sm:gap-3',
|
||||||
!enabled && 'opacity-60',
|
!enabled && 'opacity-60',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -79,22 +79,12 @@ export function NodeSummaryCard<T extends AdapterCommon>({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-0.5 truncate font-mono text-xs text-muted-foreground tabular-nums">{summary}</div>
|
<div className="mt-0.5 truncate font-mono text-xs text-muted-foreground tabular-nums">{summary}</div>
|
||||||
<div className="mt-1.5 flex flex-wrap items-center gap-1.5">
|
<div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-muted-foreground">
|
||||||
<Badge variant="outline" className="font-normal">
|
<span>{item.messageFormat === 'string' ? 'CQ 码' : '数组'}</span>
|
||||||
{item.messageFormat === 'string' ? 'CQ 码' : '数组'}
|
<span aria-hidden className="text-border">·</span>
|
||||||
</Badge>
|
<span>{item.reportSelfMessage ? '上报自身' : '不上报自身'}</span>
|
||||||
<Badge variant="outline" className="font-normal">
|
<span aria-hidden className="text-border">·</span>
|
||||||
{item.reportSelfMessage ? '上报自身' : '不上报自身'}
|
<span className={cn(!item.accessToken && 'text-muted-foreground/60')}>{item.accessToken ? '已设 Token' : '无 Token'}</span>
|
||||||
</Badge>
|
|
||||||
{item.accessToken ? (
|
|
||||||
<Badge variant="outline" className="font-normal">
|
|
||||||
已设 Token
|
|
||||||
</Badge>
|
|
||||||
) : (
|
|
||||||
<Badge variant="outline" className="font-normal text-muted-foreground">
|
|
||||||
无 Token
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { motion } from 'motion/react';
|
import { motion } from 'motion/react';
|
||||||
import { MousePointerClick, Plus, Save } from 'lucide-react';
|
import { Check, Loader2, MousePointerClick, Plus, Save } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Skeleton } from '@/components/ui/skeleton';
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
@@ -276,24 +276,18 @@ function HeaderBar({ selectedUin, dirty, saveStatus, onSave, activeTab, onCreate
|
|||||||
UIN {selectedUin}
|
UIN {selectedUin}
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
{saveStatus && (
|
{(saveStatus || dirty) && (
|
||||||
<span
|
<span className="inline-flex items-center gap-1.5 text-[11px] font-medium">
|
||||||
className={cn(
|
{saveStatus === '保存中...' ? (
|
||||||
'rounded-full border px-2.5 py-1 text-[11px] font-medium',
|
<><Loader2 className="size-3.5 animate-spin text-muted-foreground" /><span className="text-muted-foreground">保存中</span></>
|
||||||
saveStatus === '保存成功' && 'border-success/30 bg-success/10 text-success',
|
) : saveStatus === '保存成功' ? (
|
||||||
saveStatus === '保存中...' && 'border-border bg-muted text-muted-foreground',
|
<><Check className="size-3.5 text-success" /><span className="text-success">已保存</span></>
|
||||||
saveStatus !== '保存成功' &&
|
) : saveStatus ? (
|
||||||
saveStatus !== '保存中...' &&
|
<><span className="size-1.5 rounded-full bg-destructive" /><span className="text-destructive">{saveStatus}</span></>
|
||||||
'border-destructive/30 bg-destructive/10 text-destructive',
|
) : (
|
||||||
|
<><span className="size-1.5 rounded-full bg-warning" /><span className="text-warning">未保存</span></>
|
||||||
)}
|
)}
|
||||||
>
|
|
||||||
{saveStatus}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{dirty && !saveStatus && (
|
|
||||||
<span className="rounded-full border border-warning/30 bg-warning/10 px-2.5 py-1 text-[11px] font-medium text-warning">
|
|
||||||
未保存
|
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{onCreate && (
|
{onCreate && (
|
||||||
@@ -410,7 +404,7 @@ function NetworkTabView({
|
|||||||
|
|
||||||
if (list.length === 0) {
|
if (list.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center gap-3 rounded-lg 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">
|
||||||
<p className="text-sm">暂无 {tab.title} 节点</p>
|
<p className="text-sm">暂无 {tab.title} 节点</p>
|
||||||
<Button variant="outline" size="sm" onClick={onCreateClick}>
|
<Button variant="outline" size="sm" onClick={onCreateClick}>
|
||||||
<Plus className="size-3.5" /> 创建第一个
|
<Plus className="size-3.5" /> 创建第一个
|
||||||
@@ -447,8 +441,8 @@ function NetworkTabView({
|
|||||||
|
|
||||||
function EmptyState() {
|
function EmptyState() {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-64 flex-col items-center justify-center gap-2 rounded-lg border border-dashed text-muted-foreground">
|
<div className="flex h-64 flex-col items-center justify-center gap-2 rounded-xl border border-dashed text-muted-foreground">
|
||||||
<MousePointerClick className="size-7" strokeWidth={1.5} />
|
<MousePointerClick className="size-8 opacity-40" strokeWidth={1.5} />
|
||||||
<p className="text-sm">请在左栏选择会话以配置通信节点</p>
|
<p className="text-sm">请在左栏选择会话以配置通信节点</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -65,28 +65,32 @@ export function ProcessesPage() {
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-6">
|
<div className="flex flex-col gap-6">
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className="flex flex-row items-center justify-between gap-3 space-y-0">
|
<CardHeader className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:space-y-0">
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<CardTitle>进程注入</CardTitle>
|
<CardTitle>进程注入</CardTitle>
|
||||||
<CardDescription>加载 SnowLuma 后会监听登录状态,登录后自动接入 OneBot 流程</CardDescription>
|
<CardDescription>加载 SnowLuma 后会监听登录状态,登录后自动接入 OneBot 流程</CardDescription>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{processList.length > 1 && (
|
{processList.length > 1 && (
|
||||||
<div className="hidden items-center gap-1 sm:flex">
|
<div className="hidden items-center gap-1 rounded-lg bg-muted/60 p-1 sm:flex" role="radiogroup" aria-label="排序方式">
|
||||||
<span className="text-[11px] text-muted-foreground">排序</span>
|
{SORT_OPTIONS.map((o) => {
|
||||||
{SORT_OPTIONS.map((o) => (
|
const active = sortKey === o.id;
|
||||||
|
return (
|
||||||
<button
|
<button
|
||||||
key={o.id}
|
key={o.id}
|
||||||
type="button"
|
type="button"
|
||||||
|
role="radio"
|
||||||
|
aria-checked={active}
|
||||||
onClick={() => setPages({ processesSort: o.id })}
|
onClick={() => setPages({ processesSort: o.id })}
|
||||||
className={cn(
|
className={cn(
|
||||||
'rounded-md border px-2 py-1 text-[11px] transition-colors cursor-pointer',
|
'rounded-md px-2.5 py-1 text-[11px] font-medium transition-all cursor-pointer outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40',
|
||||||
sortKey === o.id ? 'border-primary bg-primary/10 text-primary' : 'border-border text-muted-foreground hover:bg-accent/40',
|
active ? 'bg-card font-semibold text-foreground shadow-sm ring-1 ring-border' : 'text-muted-foreground hover:text-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{o.label}
|
{o.label}
|
||||||
</button>
|
</button>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button variant="outline" size="sm" onClick={refreshProcesses}>
|
<Button variant="outline" size="sm" onClick={refreshProcesses}>
|
||||||
@@ -99,14 +103,15 @@ export function ProcessesPage() {
|
|||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: -4 }}
|
initial={{ opacity: 0, y: -4 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
className="mb-3 rounded-md border border-primary/20 bg-primary/5 px-3 py-2 text-xs text-primary"
|
className="mb-3 flex items-center gap-2 rounded-lg border border-primary/20 bg-primary/[0.06] px-3 py-2 text-xs text-primary"
|
||||||
>
|
>
|
||||||
|
<Loader2 className="size-3.5 shrink-0 animate-spin" />
|
||||||
{processActionStatus}
|
{processActionStatus}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
{processList.length === 0 ? (
|
{processList.length === 0 ? (
|
||||||
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed py-16 text-muted-foreground">
|
<div className="flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed py-16 text-muted-foreground">
|
||||||
<Cpu className="size-7" strokeWidth={1.5} />
|
<Cpu className="size-8 opacity-40" strokeWidth={1.5} />
|
||||||
<p className="text-sm">未检测到可加载 QQ 主进程</p>
|
<p className="text-sm">未检测到可加载 QQ 主进程</p>
|
||||||
<p className="text-[11px] text-muted-foreground/80">请确认 QQ 已启动后点击右上角刷新</p>
|
<p className="text-[11px] text-muted-foreground/80">请确认 QQ 已启动后点击右上角刷新</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -129,7 +134,7 @@ export function ProcessesPage() {
|
|||||||
initial={{ opacity: 0, y: 6 }}
|
initial={{ opacity: 0, y: 6 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{ delay: 0.03 + idx * 0.025, duration: 0.22 }}
|
transition={{ delay: 0.03 + idx * 0.025, duration: 0.22 }}
|
||||||
className="flex flex-col gap-3 rounded-lg border bg-card/50 p-3 sm:flex-row sm:items-center"
|
className="flex flex-col gap-3 rounded-xl border bg-card/50 p-3.5 transition-colors hover:bg-accent/20 sm:flex-row sm:items-center"
|
||||||
>
|
>
|
||||||
{/* icon + info stay horizontal; on phones the actions drop to
|
{/* icon + info stay horizontal; on phones the actions drop to
|
||||||
a second row so name / PID / path get the full width
|
a second row so name / PID / path get the full width
|
||||||
@@ -137,7 +142,7 @@ export function ProcessesPage() {
|
|||||||
<div className="flex min-w-0 flex-1 items-center gap-3">
|
<div className="flex min-w-0 flex-1 items-center gap-3">
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex size-10 shrink-0 items-center justify-center rounded-lg',
|
'flex size-10 shrink-0 items-center justify-center rounded-xl',
|
||||||
isOnline
|
isOnline
|
||||||
? 'bg-success/15 text-success'
|
? 'bg-success/15 text-success'
|
||||||
: proc.status === 'error'
|
: proc.status === 'error'
|
||||||
|
|||||||
Reference in new issue
Block a user