feat(webui): Select/Textarea UI components + hide installed TLS cert

Add reusable Select (styled native select + chevron) and Textarea components
matching Input's design language, and replace every native <select>/<textarea>
across the app (system-panel, node-edit-dialog, notification-channel-dialog,
settings customCss, widget note) with them.

TLS cert UX: once a cert is installed, the sensitive PEM is no longer rendered
on revisit — show an '已安装(未改变)' summary with 更改/删除 buttons; 更改
reveals the inputs again (with a 取消). Private key is never sent back to the
client. Verified by tsc + vite build.
This commit is contained in:
DrSmoothl committed 2026-06-18 14:53:43 +08:00
1 parent 675261691f
commit a38b33c8aa
7 files changed
+118 -44

No files matched your search

@@ -9,6 +9,7 @@ import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/com
import { Button } from '@/components/ui/button';
import { ToggleSwitch } from '@/components/ui/toggle-switch';
import { Slider } from '@/components/ui/slider';
import { Textarea } from '@/components/ui/textarea';
import {
ACCENTS,
DEFAULT_APPEARANCE,
@@ -980,7 +981,7 @@ function AdvancedPanel() {
</button>
))}
</div>
<textarea
<Textarea
ref={cssRef}
value={appearance.customCss}
onChange={(e) => { setAppearance({ customCss: e.target.value }); if (cssWarn) setCssWarn(null); }}
@@ -988,7 +989,7 @@ function AdvancedPanel() {
maxLength={50000}
spellCheck={false}
placeholder={'/* 例如:放大侧栏字号 */\n.text-sidebar-foreground { font-size: 1.05em; }'}
className="h-64 w-full resize-y rounded-lg border bg-card/40 p-3 font-mono text-[12px] leading-relaxed outline-none focus:border-primary"
className="h-64 resize-y rounded-lg bg-card/40 p-3 font-mono text-[12px] leading-relaxed"
/>
{cssWarn && (
<p className="flex items-start gap-1.5 text-[11px] text-warning">
@@ -2,6 +2,7 @@ import { useId } from 'react';
import { Bell, BookOpen, ExternalLink, Github, Globe, Link2, Server, Star } from 'lucide-react';
import { Input } from '@/components/ui/input';
import { ToggleSwitch } from '@/components/ui/toggle-switch';
import { Textarea } from '@/components/ui/textarea';
import { cn } from '@/lib/utils';
import { useAppState } from '@/contexts/AppStateContext';
import {
@@ -172,13 +173,13 @@ export function NoteConfigForm({ config, onChange }: FormProps) {
return (
<div className="flex flex-col gap-2">
<span className="text-sm text-muted-foreground">便签内容(纯文本,保留换行)</span>
<textarea
<Textarea
value={c.text}
onChange={(e) => onChange({ text: e.target.value.slice(0, NOTE_MAX) })}
maxLength={NOTE_MAX}
spellCheck={false}
placeholder="写点备注、待办或快捷信息…"
className="h-40 w-full resize-y rounded-lg border bg-card/40 p-3 text-sm leading-relaxed outline-none focus:border-primary"
className="h-40 resize-y rounded-lg bg-card/40 p-3 text-sm leading-relaxed"
/>
<span className="text-right text-[11px] text-muted-foreground">{c.text.length} / {NOTE_MAX}</span>
</div>