- 内容源管理:去掉人工录入卡片,AI 密钥保存后可返显并支持小眼睛切换,布局优化 - 内容管理:新增编辑按钮与编辑页,可调整条目全部字段与标签
This commit is contained in:
+13
-8
@@ -37,6 +37,7 @@
|
||||
<td class="mono"><%= fmtDate(e.updated_at) %></td>
|
||||
<td>
|
||||
<div class="row-actions">
|
||||
<a class="btn btn-sm" href="/admin/entries/<%= e.id %>/edit">编辑</a>
|
||||
<% if (e.status !== 'active') { %>
|
||||
<button class="btn btn-sm" type="button" data-action="entry-status" data-id="<%= e.id %>" data-status="active">上架</button>
|
||||
<% } else { %>
|
||||
@@ -106,25 +107,29 @@
|
||||
<p class="anno">// sources: human + ai + feed · 自动拉取经 ingest/ 采集层进入待核验队列</p>
|
||||
<h1>内容源管理</h1>
|
||||
|
||||
<% for (const s of sources) { %>
|
||||
<% for (const s of sources) { if (s.kind === 'human') continue; %>
|
||||
<div class="panel-box" style="margin-top:20px">
|
||||
<h3 style="display:flex;align-items:center;gap:10px">
|
||||
<span class="dot <%= s.enabled ? '' : 'dot-off' %>"></span> <%= s.name %>
|
||||
<span class="mono" style="font-weight:400;font-size:12px;color:var(--ink-dim)">kind: <%= s.kind %> · 已收录 <%= Number(s.entry_count) %> 条</span>
|
||||
</h3>
|
||||
|
||||
<% if (s.kind === 'human') { %>
|
||||
<p style="font-size:13.5px;color:var(--ink-dim)">管理员与编辑在条目接口直接写入,始终可用,改动写入审计日志。</p>
|
||||
<% } else if (s.kind === 'ai') { %>
|
||||
<% if (s.kind === 'ai') { %>
|
||||
<div class="switchline">
|
||||
AI 录入接口启用
|
||||
<span class="mono"><%= s.enabled ? 'ON' : 'OFF' %></span>
|
||||
</div>
|
||||
<form id="ai-key-form">
|
||||
<form id="ai-key-form" style="margin-top:12px">
|
||||
<p style="font-size:13px;color:var(--ink-dim);margin-bottom:6px">设置新的 X-Ingest-Key(留空 = 关闭通道)</p>
|
||||
<div style="display:flex;gap:10px;max-width:420px">
|
||||
<input class="input" name="key" type="text" placeholder="sk-…" />
|
||||
<button class="btn btn-sm" type="submit">保存密钥</button>
|
||||
<div style="display:flex;gap:10px;align-items:center;flex-wrap:nowrap">
|
||||
<div class="ai-key-field">
|
||||
<input class="input" name="key" type="password" value="<%= s.api_key || '' %>" placeholder="sk-…" autocomplete="off" />
|
||||
<button type="button" class="eye-toggle" data-eye-toggle aria-label="显示密钥">
|
||||
<svg class="eye-open" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
|
||||
<svg class="eye-closed" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" hidden><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<button class="btn btn-sm" type="submit" style="flex:none">保存密钥</button>
|
||||
</div>
|
||||
</form>
|
||||
<p class="mono" style="margin-top:12px;font-size:12px;color:var(--ink-dim)">
|
||||
|
||||
Reference in New Issue
Block a user