feat(ui): improve settings form labels and descriptions for clarity
Build and Deploy / build-and-push (push) Successful in 53s
Build and Deploy / build-and-push (push) Successful in 53s
This commit is contained in:
+60
-16
@@ -267,11 +267,17 @@ export default function Settings() {
|
|||||||
</Card>
|
</Card>
|
||||||
<Card className="space-y-3 p-4">
|
<Card className="space-y-3 p-4">
|
||||||
<h2 className="font-medium">站点设置</h2>
|
<h2 className="font-medium">站点设置</h2>
|
||||||
<Input placeholder="标题" value={siteForm.title} onChange={(e) => setSiteForm((f) => ({ ...f, title: e.target.value }))} />
|
<Input placeholder="站点标题" value={siteForm.title} onChange={(e) => setSiteForm((f) => ({ ...f, title: e.target.value }))} />
|
||||||
<Input placeholder="副标题" value={siteForm.subtitle} onChange={(e) => setSiteForm((f) => ({ ...f, subtitle: e.target.value }))} />
|
<Input placeholder="站点副标题" value={siteForm.subtitle} onChange={(e) => setSiteForm((f) => ({ ...f, subtitle: e.target.value }))} />
|
||||||
<div className="grid gap-3 md:grid-cols-2">
|
<div className="grid gap-3 md:grid-cols-2">
|
||||||
<Input placeholder="分页大小" value={siteForm.page_size} onChange={(e) => setSiteForm((f) => ({ ...f, page_size: e.target.value }))} />
|
<div>
|
||||||
<Input placeholder="Cookie 天数" value={siteForm.cookie_days} onChange={(e) => setSiteForm((f) => ({ ...f, cookie_days: e.target.value }))} />
|
<label className="mb-1 block text-xs text-[var(--text-muted)]">分页大小</label>
|
||||||
|
<Input placeholder="20" value={siteForm.page_size} onChange={(e) => setSiteForm((f) => ({ ...f, page_size: e.target.value }))} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="mb-1 block text-xs text-[var(--text-muted)]">登录 Cookie 有效天数</label>
|
||||||
|
<Input placeholder="7" value={siteForm.cookie_days} onChange={(e) => setSiteForm((f) => ({ ...f, cookie_days: e.target.value }))} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label className="flex items-center justify-between text-sm">
|
<label className="flex items-center justify-between text-sm">
|
||||||
<span>启用 OpenAPI</span>
|
<span>启用 OpenAPI</span>
|
||||||
@@ -304,15 +310,40 @@ export default function Settings() {
|
|||||||
<p className="mt-2 text-[var(--text-muted)]">详细说明见仓库 docs/guide/mcp.md 与 skills/taskpool/SKILL.md</p>
|
<p className="mt-2 text-[var(--text-muted)]">详细说明见仓库 docs/guide/mcp.md 与 skills/taskpool/SKILL.md</p>
|
||||||
</div>
|
</div>
|
||||||
<h3 className="pt-2 text-sm font-medium text-[var(--text-secondary)]">日志保留</h3>
|
<h3 className="pt-2 text-sm font-medium text-[var(--text-secondary)]">日志保留</h3>
|
||||||
<div className="grid gap-3 md:grid-cols-2">
|
<p className="text-xs text-[var(--text-muted)]">设置各类日志的保留天数和最大条数限制,超出后自动清理最旧记录</p>
|
||||||
<Input placeholder="系统通知保留天" value={siteForm.system_notice_days} onChange={(e) => setSiteForm((f) => ({ ...f, system_notice_days: e.target.value }))} />
|
<div className="space-y-3">
|
||||||
<Input placeholder="系统通知最大条数" value={siteForm.system_notice_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, system_notice_max_count: e.target.value }))} />
|
<div className="rounded-md border border-[var(--border)] bg-[var(--bg-tertiary)]/50 p-3">
|
||||||
<Input placeholder="推送日志保留天" value={siteForm.push_log_days} onChange={(e) => setSiteForm((f) => ({ ...f, push_log_days: e.target.value }))} />
|
<div className="mb-2 text-sm font-medium text-[var(--text-primary)]">系统通知</div>
|
||||||
<Input placeholder="推送日志最大条数" value={siteForm.push_log_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, push_log_max_count: e.target.value }))} />
|
<p className="mb-2 text-xs text-[var(--text-muted)]">系统级事件通知,如任务失败报警、服务状态变更等</p>
|
||||||
<Input placeholder="登录日志保留天" value={siteForm.login_log_days} onChange={(e) => setSiteForm((f) => ({ ...f, login_log_days: e.target.value }))} />
|
<div className="grid gap-2 md:grid-cols-2">
|
||||||
<Input placeholder="登录日志最大条数" value={siteForm.login_log_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, login_log_max_count: e.target.value }))} />
|
<Input placeholder="保留天数" value={siteForm.system_notice_days} onChange={(e) => setSiteForm((f) => ({ ...f, system_notice_days: e.target.value }))} />
|
||||||
<Input placeholder="调度日志保留天" value={siteForm.scheduler_log_days} onChange={(e) => setSiteForm((f) => ({ ...f, scheduler_log_days: e.target.value }))} />
|
<Input placeholder="最大条数" value={siteForm.system_notice_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, system_notice_max_count: e.target.value }))} />
|
||||||
<Input placeholder="调度日志最大条数" value={siteForm.scheduler_log_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, scheduler_log_max_count: e.target.value }))} />
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="rounded-md border border-[var(--border)] bg-[var(--bg-tertiary)]/50 p-3">
|
||||||
|
<div className="mb-2 text-sm font-medium text-[var(--text-primary)]">推送日志</div>
|
||||||
|
<p className="mb-2 text-xs text-[var(--text-muted)]">消息推送记录,如钉钉、企业微信、Telegram 等渠道的发送历史</p>
|
||||||
|
<div className="grid gap-2 md:grid-cols-2">
|
||||||
|
<Input placeholder="保留天数" value={siteForm.push_log_days} onChange={(e) => setSiteForm((f) => ({ ...f, push_log_days: e.target.value }))} />
|
||||||
|
<Input placeholder="最大条数" value={siteForm.push_log_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, push_log_max_count: e.target.value }))} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="rounded-md border border-[var(--border)] bg-[var(--bg-tertiary)]/50 p-3">
|
||||||
|
<div className="mb-2 text-sm font-medium text-[var(--text-primary)]">登录日志</div>
|
||||||
|
<p className="mb-2 text-xs text-[var(--text-muted)]">用户登录记录,包含 IP、时间、状态等安全审计信息</p>
|
||||||
|
<div className="grid gap-2 md:grid-cols-2">
|
||||||
|
<Input placeholder="保留天数" value={siteForm.login_log_days} onChange={(e) => setSiteForm((f) => ({ ...f, login_log_days: e.target.value }))} />
|
||||||
|
<Input placeholder="最大条数" value={siteForm.login_log_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, login_log_max_count: e.target.value }))} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="rounded-md border border-[var(--border)] bg-[var(--bg-tertiary)]/50 p-3">
|
||||||
|
<div className="mb-2 text-sm font-medium text-[var(--text-primary)]">调度日志</div>
|
||||||
|
<p className="mb-2 text-xs text-[var(--text-muted)]">任务执行日志,包含命令输出、执行状态、耗时等信息</p>
|
||||||
|
<div className="grid gap-2 md:grid-cols-2">
|
||||||
|
<Input placeholder="保留天数" value={siteForm.scheduler_log_days} onChange={(e) => setSiteForm((f) => ({ ...f, scheduler_log_days: e.target.value }))} />
|
||||||
|
<Input placeholder="最大条数" value={siteForm.scheduler_log_max_count} onChange={(e) => setSiteForm((f) => ({ ...f, scheduler_log_max_count: e.target.value }))} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button onClick={() => saveSite.mutate()} disabled={saveSite.isPending}>
|
<Button onClick={() => saveSite.mutate()} disabled={saveSite.isPending}>
|
||||||
保存站点设置
|
保存站点设置
|
||||||
@@ -408,10 +439,23 @@ export default function Settings() {
|
|||||||
{tab === 'scheduler' ? (
|
{tab === 'scheduler' ? (
|
||||||
<Card className="space-y-3 p-4">
|
<Card className="space-y-3 p-4">
|
||||||
<h2 className="font-medium">调度设置</h2>
|
<h2 className="font-medium">调度设置</h2>
|
||||||
|
<p className="text-xs text-[var(--text-muted)]">控制任务调度器的并发能力和队列行为</p>
|
||||||
<div className="grid gap-3 md:grid-cols-3">
|
<div className="grid gap-3 md:grid-cols-3">
|
||||||
<Input placeholder="Worker 数" value={schedulerForm.worker_count} onChange={(e) => setSchedulerForm((f) => ({ ...f, worker_count: e.target.value }))} />
|
<div>
|
||||||
<Input placeholder="队列大小" value={schedulerForm.queue_size} onChange={(e) => setSchedulerForm((f) => ({ ...f, queue_size: e.target.value }))} />
|
<label className="mb-1 block text-xs text-[var(--text-muted)]">Worker 数量</label>
|
||||||
<Input placeholder="限速间隔" value={schedulerForm.rate_interval} onChange={(e) => setSchedulerForm((f) => ({ ...f, rate_interval: e.target.value }))} />
|
<Input placeholder="4" value={schedulerForm.worker_count} onChange={(e) => setSchedulerForm((f) => ({ ...f, worker_count: e.target.value }))} />
|
||||||
|
<p className="mt-1 text-xs text-[var(--text-muted)]">并发执行任务的最大数量</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="mb-1 block text-xs text-[var(--text-muted)]">队列大小</label>
|
||||||
|
<Input placeholder="100" value={schedulerForm.queue_size} onChange={(e) => setSchedulerForm((f) => ({ ...f, queue_size: e.target.value }))} />
|
||||||
|
<p className="mt-1 text-xs text-[var(--text-muted)]">等待执行的任务队列容量</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="mb-1 block text-xs text-[var(--text-muted)]">限速间隔(毫秒)</label>
|
||||||
|
<Input placeholder="0" value={schedulerForm.rate_interval} onChange={(e) => setSchedulerForm((f) => ({ ...f, rate_interval: e.target.value }))} />
|
||||||
|
<p className="mt-1 text-xs text-[var(--text-muted)]">任务启动间隔,0 表示不限速</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button onClick={() => saveScheduler.mutate()} disabled={saveScheduler.isPending}>
|
<Button onClick={() => saveScheduler.mutate()} disabled={saveScheduler.isPending}>
|
||||||
保存调度设置
|
保存调度设置
|
||||||
|
|||||||
Reference in New Issue
Block a user