fix(webui): clarify compact text hierarchy
Replace 145 scattered 10px and 11px declarations with semantic text roles across the dashboard, configuration, diagnostics, logs, and settings surfaces. Promote instructions, errors, interactive labels, and empty states to at least 12px, raise security-sensitive and destructive warnings to 14px, and make general-purpose badges readable by default. Keep compact sizing only for dense technical metadata such as timestamps, identifiers, paths, versions, and counters. Preserve the existing desktop density while improving Chinese text legibility and responsive behavior on narrow mobile layouts.
This commit is contained in:
30 files changed
+151
-151
No files matched your search
@@ -110,7 +110,7 @@ export function GlobalConfigPanel() {
|
||||
<div className="flex flex-col gap-4">
|
||||
{/* rkey fallback servers */}
|
||||
<div className="flex flex-col gap-4 rounded-xl border bg-card/40 p-4">
|
||||
<div className="flex items-start gap-2 text-[11px] leading-relaxed text-muted-foreground">
|
||||
<div className="flex items-start gap-2 text-xs leading-relaxed text-muted-foreground">
|
||||
<KeyRound className="mt-0.5 size-3.5 shrink-0" />
|
||||
<p>
|
||||
图片 / 文件下载链接需要服务器签发的 <code className="font-mono">rkey</code>。SnowLuma 默认走内核获取;
|
||||
@@ -160,7 +160,7 @@ export function GlobalConfigPanel() {
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<p className="text-[11px] leading-relaxed text-muted-foreground">
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
端点需返回 <code className="font-mono">{'{ group_rkey, private_rkey, expired_time }'}</code>
|
||||
(兼容 NapCat rkey 服务格式)。非 http(s) 链接会被忽略。
|
||||
</p>
|
||||
@@ -171,7 +171,7 @@ export function GlobalConfigPanel() {
|
||||
|
||||
{/* music sign URL */}
|
||||
<div className="flex flex-col gap-4 rounded-xl border bg-card/40 p-4">
|
||||
<div className="flex items-start gap-2 text-[11px] leading-relaxed text-muted-foreground">
|
||||
<div className="flex items-start gap-2 text-xs leading-relaxed text-muted-foreground">
|
||||
<Music className="mt-0.5 size-3.5 shrink-0" />
|
||||
<p>音乐分享卡片的签名服务,对所有账号统一生效。留空则使用内置默认服务。</p>
|
||||
</div>
|
||||
@@ -191,7 +191,7 @@ export function GlobalConfigPanel() {
|
||||
)}
|
||||
onChange={(e) => commit({ ...config, musicSignUrl: e.target.value })}
|
||||
/>
|
||||
<p className="text-[11px] leading-relaxed text-muted-foreground">
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
内置默认:<code className="font-mono">{MUSIC_SIGN_DEFAULT}</code>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -108,7 +108,7 @@ export function NotificationChannelDialog(props: NotificationChannelDialogProps)
|
||||
onChange={(e) => patch({ bodyTemplate: e.target.value })}
|
||||
className="font-mono text-xs leading-relaxed"
|
||||
/>
|
||||
<p className="text-[11px] leading-relaxed text-muted-foreground">
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
变量:<code className="font-mono">{'{uin}'}</code> <code className="font-mono">{'{nickname}'}</code>{' '}
|
||||
<code className="font-mono">{'{event}'}</code>(offline/online) <code className="font-mono">{'{time}'}</code>
|
||||
</p>
|
||||
@@ -117,7 +117,7 @@ export function NotificationChannelDialog(props: NotificationChannelDialogProps)
|
||||
<div className="flex items-center justify-between rounded-lg border bg-card/40 p-3">
|
||||
<div className="min-w-0">
|
||||
<Label className="text-sm">启用</Label>
|
||||
<p className="mt-1 text-[11px] leading-relaxed text-muted-foreground">
|
||||
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">
|
||||
关闭后保留配置但不推送;账号侧对应开关会被锁定并关闭。
|
||||
</p>
|
||||
</div>
|
||||
@@ -168,9 +168,9 @@ function Field({ label, value, onChange, placeholder, type = 'text', error, hint
|
||||
className={cn(error && 'border-destructive focus-visible:ring-destructive/40', disabled && 'opacity-60')}
|
||||
/>
|
||||
{error ? (
|
||||
<p className="text-[11px] text-destructive">{error}</p>
|
||||
<p className="text-xs text-destructive">{error}</p>
|
||||
) : hint ? (
|
||||
<p className="text-[11px] text-muted-foreground">{hint}</p>
|
||||
<p className="text-xs text-muted-foreground">{hint}</p>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -131,7 +131,7 @@ export function NotificationsPanel() {
|
||||
<div className="flex flex-col gap-4">
|
||||
{/* Global settings */}
|
||||
<div className="flex flex-col gap-4 rounded-xl border bg-card/40 p-4">
|
||||
<div className="flex items-start gap-2 text-[11px] leading-relaxed text-muted-foreground">
|
||||
<div className="flex items-start gap-2 text-xs leading-relaxed text-muted-foreground">
|
||||
<Bell className="mt-0.5 size-3.5 shrink-0" />
|
||||
<p>
|
||||
账号上线 / 下线时向启用的渠道 POST 一条通知(机械转发,仅去抖防刷屏)。渠道在此全局定义,每个账号在其「配置」页勾选启用哪些。
|
||||
@@ -150,7 +150,7 @@ export function NotificationsPanel() {
|
||||
commit({ ...config, debounceSeconds: Number.isFinite(n) ? Math.min(3600, Math.max(0, n)) : 0 });
|
||||
}}
|
||||
/>
|
||||
<p className="text-[11px] leading-relaxed text-muted-foreground">
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
下线后在该秒数内自愈则不发;超时才发「下线」,恢复时再发「上线」。<code className="font-mono">0</code> = 立即发、不去抖。
|
||||
</p>
|
||||
</div>
|
||||
@@ -237,7 +237,7 @@ function ChannelCard({ channel, testing, onToggle, onTest, onEdit, onDelete }: C
|
||||
{!channel.enabled && <Badge variant="secondary" className="font-normal">已停用</Badge>}
|
||||
</div>
|
||||
<div className="mt-0.5 truncate font-mono text-xs text-muted-foreground">{channel.url}</div>
|
||||
<div className="mt-1 truncate font-mono text-[11px] text-muted-foreground/80">{channel.bodyTemplate}</div>
|
||||
<div className="mt-1 truncate font-mono text-meta text-muted-foreground/80">{channel.bodyTemplate}</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-1.5 sm:justify-end">
|
||||
|
||||
@@ -163,7 +163,7 @@ export function SystemPanel() {
|
||||
|
||||
const EnvBadge = ({ field }: { field: string }) =>
|
||||
overridden(field)
|
||||
? <Badge variant="secondary" className="ml-2 gap-1 text-[10px]"><Lock className="h-3 w-3" /> 被环境变量覆盖</Badge>
|
||||
? <Badge variant="secondary" className="ml-2 gap-1 text-micro"><Lock className="h-3 w-3" /> 被环境变量覆盖</Badge>
|
||||
: null;
|
||||
|
||||
return (
|
||||
@@ -200,7 +200,7 @@ export function SystemPanel() {
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<Label className="flex items-center">信任代理 (trust-proxy)<EnvBadge field="trustProxy" /></Label>
|
||||
<Input value={trustProxy} onChange={(e) => setTrustProxy(e.target.value)} placeholder="留空=只信任 socket 对端;1=信任反代头" />
|
||||
<p className="text-[11px] text-muted-foreground">仅在 WebUI 位于受信任反向代理之后时才设为 1 / loopback / IP 列表。</p>
|
||||
<p className="text-xs text-muted-foreground">仅在 WebUI 位于受信任反向代理之后时才设为 1 / loopback / IP 列表。</p>
|
||||
</div>
|
||||
<div>
|
||||
<Button onClick={saveSettings} disabled={saving} className="gap-1.5">
|
||||
@@ -262,7 +262,7 @@ export function SystemPanel() {
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-[11px] text-muted-foreground">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
私钥仅写入服务器 config/key.pem(0600 权限),不会回显。证书无效时保存会被拒绝;若启用了 TLS 但证书加载失败,启动时会自动回退到 HTTP。
|
||||
</p>
|
||||
</>
|
||||
@@ -282,7 +282,7 @@ export function SystemPanel() {
|
||||
<ToggleSwitch value={exportCreds} onChange={setExportCreds} ariaLabel="导出包含敏感配置" />
|
||||
</div>
|
||||
{exportCreds && (
|
||||
<p className="text-[11px] text-red-600 dark:text-red-400">⚠ 将额外包含 WebUI 登录状态、TLS 私钥,以及带访问令牌的 OneBot 配置,请妥善保管。</p>
|
||||
<p className="text-sm leading-relaxed text-red-600 dark:text-red-400">⚠ 将额外包含 WebUI 登录状态、TLS 私钥,以及带访问令牌的 OneBot 配置,请妥善保管。</p>
|
||||
)}
|
||||
<div>
|
||||
<Button onClick={exportBackup} disabled={saving} className="gap-1.5">
|
||||
@@ -299,7 +299,7 @@ export function SystemPanel() {
|
||||
<ToggleSwitch value={restoreCreds} onChange={setRestoreCreds} ariaLabel="恢复包含敏感配置" />
|
||||
</div>
|
||||
{restoreCreds && (
|
||||
<p className="text-[11px] text-red-600 dark:text-red-400">⚠ 将覆盖当前 WebUI 登录状态、TLS 私钥与 OneBot 配置(含访问令牌);若备份口令未知可能登不进。</p>
|
||||
<p className="text-sm leading-relaxed text-red-600 dark:text-red-400">⚠ 将覆盖当前 WebUI 登录状态、TLS 私钥与 OneBot 配置(含访问令牌);若备份口令未知可能登不进。</p>
|
||||
)}
|
||||
<input
|
||||
ref={fileRef}
|
||||
@@ -313,7 +313,7 @@ export function SystemPanel() {
|
||||
{saving ? <Loader2 className="h-4 w-4 animate-spin" /> : <Upload className="h-4 w-4" />} 选择备份文件并恢复
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-[11px] text-muted-foreground">恢复前会校验本次要恢复的配置;写入过程中出错会自动回滚,成功后临时快照会删除。恢复后需重启生效。</p>
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">恢复前会校验本次要恢复的配置;写入过程中出错会自动回滚,成功后临时快照会删除。恢复后需重启生效。</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in new issue
Block a user