feat(demo): 按插件当前实现重写演示页
- 列表/筛选对齐真实 Console:八维筛选、语义动作中文描述、登录失败结果语义 - 详情抽屉展示字段级 diff(脱敏/截断/封顶)与 AuditLog Extension 原始 JSON - 新增行内「历史」快捷、按筛选条件导出 UTF-8 BOM CSV - 设置页覆盖审计开关/字段变更/系统变更/保留期与登录失败告警(含测试与模拟触发) - 模拟器支持 HTTP 捕获管线与系统内部变更两条通道 - 核心纯函数重写并扩充至 56 个单元用例
This commit is contained in:
+288
-101
@@ -66,12 +66,23 @@
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>操作审计</h1>
|
||||
<p class="page-sub">谁 · 在什么时候 · 对什么资源 · 做了什么操作 · 结果如何 <span class="readonly-hint">(只读,不可篡改)</span></p>
|
||||
<p class="page-sub">谁 · 在什么时候 · 对什么资源 · 做了什么操作 · 结果如何 · 改了什么
|
||||
<span class="readonly-hint">(只读,不可篡改)</span></p>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button class="btn btn-outline" id="btn-export" title="按当前筛选条件导出全部记录(UTF-8 BOM CSV)">
|
||||
<svg viewBox="0 0 24 24"><path d="M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"/></svg>
|
||||
导出
|
||||
</button>
|
||||
<button class="btn btn-outline" id="btn-refresh" title="按当前筛选重新查询">
|
||||
<svg viewBox="0 0 24 24"><path d="M20 12a8 8 0 1 1-2.3-5.6M20 4v4h-4"/></svg>
|
||||
刷新
|
||||
</button>
|
||||
<button class="btn btn-primary" id="btn-simulate">
|
||||
<svg viewBox="0 0 24 24"><path d="M6 4.5v15l12-7.5z"/></svg>
|
||||
模拟一次操作
|
||||
</button>
|
||||
</div>
|
||||
<button class="btn btn-outline" id="btn-simulate">
|
||||
<svg viewBox="0 0 24 24"><path d="M6 4.5v15l12-7.5z"/></svg>
|
||||
模拟一次操作
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="tabs" id="tabs">
|
||||
@@ -83,68 +94,101 @@
|
||||
<b>审计已关闭。</b>当前期间内发生的后台操作不会写入审计日志,重新开启后恢复记录。
|
||||
</div>
|
||||
|
||||
<!-- 登录失败告警横幅(达到阈值时出现) -->
|
||||
<div class="banner banner-danger alert-banner" id="alert-banner" hidden>
|
||||
<div class="alert-banner-body">
|
||||
<b>登录失败告警已触发。</b>
|
||||
<span id="alert-banner-text"></span>
|
||||
</div>
|
||||
<div class="alert-banner-actions">
|
||||
<button class="btn-link" id="alert-banner-view">只看失败记录</button>
|
||||
<button class="icon-btn" id="alert-banner-close" title="关闭">✕</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ---- 审计日志 ---- -->
|
||||
<section id="panel-logs">
|
||||
<div class="filter-bar card">
|
||||
<div class="filter-item">
|
||||
<label for="f-operator">操作者</label>
|
||||
<select id="f-operator"><option value="">全部</option></select>
|
||||
<div class="card filter-card">
|
||||
<div class="filter-grid">
|
||||
<label class="filter-item">
|
||||
<span>操作者</span>
|
||||
<input id="f-operator" type="text" placeholder="用户名,精确匹配" autocomplete="off">
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>资源类型</span>
|
||||
<select id="f-type"><option value="">全部</option></select>
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>动作</span>
|
||||
<select id="f-method">
|
||||
<option value="">全部</option>
|
||||
<option value="POST">POST</option>
|
||||
<option value="PUT">PUT</option>
|
||||
<option value="DELETE">DELETE</option>
|
||||
<option value="PATCH">PATCH</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>语义动作</span>
|
||||
<select id="f-action"><option value="">全部</option></select>
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>结果</span>
|
||||
<select id="f-result">
|
||||
<option value="">全部</option>
|
||||
<option value="success">成功</option>
|
||||
<option value="failure">失败</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>关键字</span>
|
||||
<input id="f-keyword" type="search" placeholder="资源名称 / 路径" autocomplete="off">
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>开始时间</span>
|
||||
<input id="f-start" type="datetime-local">
|
||||
</label>
|
||||
<label class="filter-item">
|
||||
<span>结束时间</span>
|
||||
<input id="f-end" type="datetime-local">
|
||||
</label>
|
||||
<div class="filter-actions">
|
||||
<button class="btn btn-primary btn-sm" id="btn-apply">查询</button>
|
||||
<button class="btn btn-outline btn-sm" id="btn-reset">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label for="f-type">资源类型</label>
|
||||
<select id="f-type"><option value="">全部</option></select>
|
||||
<div class="filter-note" id="filter-note" hidden>
|
||||
<span id="filter-note-text"></span>
|
||||
<button class="btn-link" id="btn-clear">✕ 清除筛选</button>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label for="f-method">动作</label>
|
||||
<select id="f-method"><option value="">全部</option></select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label for="f-result">结果</label>
|
||||
<select id="f-result">
|
||||
<option value="">全部</option>
|
||||
<option value="success">成功</option>
|
||||
<option value="failure">失败</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label for="f-time">时间范围</label>
|
||||
<select id="f-time">
|
||||
<option value="all">全部时间</option>
|
||||
<option value="24h">近 24 小时</option>
|
||||
<option value="7d">近 7 天</option>
|
||||
<option value="30d">近 30 天</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item grow">
|
||||
<label for="f-keyword">关键字</label>
|
||||
<input id="f-keyword" type="search" placeholder="资源名称 / 路径,如 hello-halo" autocomplete="off">
|
||||
</div>
|
||||
<button class="btn-link" id="btn-clear" hidden>✕ 清除筛选</button>
|
||||
</div>
|
||||
|
||||
<div class="card table-card">
|
||||
<table class="audit-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:170px">时间</th>
|
||||
<th style="width:150px">操作者</th>
|
||||
<th style="width:90px">动作</th>
|
||||
<th>资源</th>
|
||||
<th style="width:110px">结果</th>
|
||||
<th style="width:140px">来源 IP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody"></tbody>
|
||||
</table>
|
||||
<div class="audit-list-wrap">
|
||||
<table class="audit-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:190px">操作者 / 时间</th>
|
||||
<th style="width:76px">动作</th>
|
||||
<th style="width:300px">资源 / 路径</th>
|
||||
<th style="width:130px">描述</th>
|
||||
<th style="width:84px">结果</th>
|
||||
<th style="width:120px">IP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<span class="pg-info" id="pg-info"></span>
|
||||
<span class="pg-right">
|
||||
<select id="pg-size" title="每页条数">
|
||||
<option value="10">10 条/页</option>
|
||||
<option value="20">20 条/页</option>
|
||||
<option value="20" selected>20 条/页</option>
|
||||
<option value="50">50 条/页</option>
|
||||
</select>
|
||||
<button class="icon-btn" id="pg-prev" title="上一页">‹</button>
|
||||
<span class="pg-page" id="pg-page">1 / 1</span>
|
||||
<button class="icon-btn" id="pg-next" title="下一页">›</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -154,34 +198,110 @@
|
||||
<!-- ---- 插件设置 ---- -->
|
||||
<section id="panel-settings" hidden>
|
||||
<div class="card settings-card">
|
||||
<div class="card-title">基本设置</div>
|
||||
<div class="card-title">审计设置</div>
|
||||
<div class="card-sub">对应 settings.yaml 的 audit 分组,Console 自动渲染;演示页保存在内存中。</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">审计开关</div>
|
||||
<div class="s-desc">开启后,已登录用户对后台 API(/apis/**)的写操作与登录/登出事件将被记录(对应 settings.yaml,Console 自动渲染)</div>
|
||||
<div class="s-name">启用审计</div>
|
||||
<div class="s-desc">关闭后不再记录新的操作审计日志,已有记录仍可查询</div>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="set-enabled" checked>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">记录字段变更</div>
|
||||
<div class="s-desc">对成功的新建/修改/删除操作记录字段级新旧值(敏感字段自动脱敏),关闭后仅记录操作元信息</div>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="set-record-changes" checked>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">记录系统内部变更</div>
|
||||
<div class="s-desc">记录定时发布等非页面操作触发的资源变更(执行者记为「系统」),关闭后仅记录页面/API 操作</div>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="set-record-system" checked>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">保留天数</div>
|
||||
<div class="s-desc">超过保留期的记录由每日定时任务自动清理,无需人工干预(默认 90 天,最小 7 天)</div>
|
||||
<div class="s-desc">超过保留期的审计记录将在每日自动清理(最小 7 天,默认 90 天)</div>
|
||||
</div>
|
||||
<input type="number" id="set-retention" class="input num" min="7" max="365" value="90">
|
||||
<input type="number" id="set-retention" class="input num" min="7" step="1" value="90">
|
||||
</div>
|
||||
|
||||
<div class="settings-actions">
|
||||
<button class="btn btn-primary" id="btn-save-settings">保存设置</button>
|
||||
<span class="hint">Demo 仅保存在当前页面内存中,刷新后恢复默认</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card settings-card">
|
||||
<div class="card-title">告警通知</div>
|
||||
<div class="card-sub">独立于审计开关。Webhook 地址凭据只存于 Halo Secret,设置仅保存 Secret 引用;演示页不发起真实网络请求。</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">启用登录失败告警</div>
|
||||
<div class="s-desc">统计窗口内登录失败达到触发阈值时向 Webhook 地址推送 JSON 告警(默认关闭)</div>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="set-alert-enabled">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">Webhook 地址(Secret)</div>
|
||||
<div class="s-desc">选择或创建存放 Webhook 地址的 Secret(键 <code>webhookUrl</code>)。地址仅在服务端读取,可含 access_token 等凭据</div>
|
||||
</div>
|
||||
<input type="text" id="set-alert-secret" class="input secret-input" placeholder="operation-audit-webhook">
|
||||
</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">触发阈值(次)</div>
|
||||
<div class="s-desc">统计窗口内累计登录失败达到该次数即触发一次告警(默认 5)</div>
|
||||
</div>
|
||||
<input type="number" id="set-alert-threshold" class="input num" min="1" step="1" value="5">
|
||||
</div>
|
||||
|
||||
<div class="setting-row">
|
||||
<div class="setting-text">
|
||||
<div class="s-name">统计窗口(分钟)</div>
|
||||
<div class="s-desc">失败次数的累计窗口;告警后窗口重开,登录成功立即清零(默认 5)</div>
|
||||
</div>
|
||||
<input type="number" id="set-alert-window" class="input num" min="1" step="1" value="5">
|
||||
</div>
|
||||
|
||||
<div class="settings-actions">
|
||||
<button class="btn btn-outline" id="btn-test-alert">发送测试告警</button>
|
||||
<button class="btn btn-outline" id="btn-simulate-alert">模拟 5 次登录失败</button>
|
||||
<span class="hint">推送 type: "test" 的测试消息,演示页仅预览 JSON 负载</span>
|
||||
</div>
|
||||
<pre class="alert-preview" id="alert-test-output" hidden></pre>
|
||||
</div>
|
||||
|
||||
<div class="card settings-card">
|
||||
<div class="card-title">清理预览</div>
|
||||
<div class="clean-stats" id="clean-stats"></div>
|
||||
<button class="btn btn-outline" id="btn-clean">模拟一次清理</button>
|
||||
<div class="settings-actions">
|
||||
<button class="btn btn-outline" id="btn-clean">模拟一次清理</button>
|
||||
<span class="hint">真实插件由每日定时任务自动执行</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
@@ -197,55 +317,122 @@
|
||||
<span>模拟一次后台操作</span>
|
||||
<button class="icon-btn" id="modal-close">✕</button>
|
||||
</div>
|
||||
<p class="modal-sub">选择操作者与方法、输入请求路径后发送,Demo 将按技术方案 D1 的捕获规则(<code>/apis/**</code> 写操作 + <code>/login</code>、<code>/logout</code>)判断是否写入审计日志。</p>
|
||||
<p class="modal-sub">
|
||||
演示页按真实捕获管线逐步判定:<b>捕获规则</b>(<code>/apis/**</code> 写操作、<code>/login</code>、<code>/logout</code>)
|
||||
→ <b>资源解析</b> → <b>登录结果</b>(302 重定向目标判定)→ <b>语义动作标注</b> → <b>字段级 diff</b>。
|
||||
</p>
|
||||
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label for="sim-user">操作者</label>
|
||||
<select id="sim-user">
|
||||
<option value="guichumo">guichumo</option>
|
||||
<option value="editor.zhang">editor.zhang</option>
|
||||
<option value="writer.li">writer.li</option>
|
||||
<option value="__anon__">匿名访客</option>
|
||||
</select>
|
||||
<div class="seg-tabs" id="sim-tabs">
|
||||
<button class="seg-tab active" data-sim-tab="http">页面 / API 操作</button>
|
||||
<button class="seg-tab" data-sim-tab="system">系统内部变更</button>
|
||||
</div>
|
||||
|
||||
<div id="sim-http-fields">
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label for="sim-user">操作者</label>
|
||||
<select id="sim-user">
|
||||
<option value="guichumo">guichumo</option>
|
||||
<option value="editor.zhang">editor.zhang</option>
|
||||
<option value="writer.li">writer.li</option>
|
||||
<option value="__anon__">匿名访客</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sim-method">HTTP 方法</label>
|
||||
<select id="sim-method">
|
||||
<option>GET</option>
|
||||
<option>POST</option>
|
||||
<option selected>PUT</option>
|
||||
<option>DELETE</option>
|
||||
<option>PATCH</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="sim-method">HTTP 方法</label>
|
||||
<select id="sim-method">
|
||||
<option>GET</option>
|
||||
<option>POST</option>
|
||||
<option>PUT</option>
|
||||
<option>DELETE</option>
|
||||
<option>PATCH</option>
|
||||
</select>
|
||||
<label for="sim-path">请求路径</label>
|
||||
<input id="sim-path" type="text" placeholder="/apis/content.halo.run/v1alpha1/posts/hello-halo" autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label for="sim-status">响应状态</label>
|
||||
<select id="sim-status">
|
||||
<option value="200" selected>200 成功</option>
|
||||
<option value="201">201 创建成功</option>
|
||||
<option value="204">204 删除成功</option>
|
||||
<option value="302">302 重定向(登录用)</option>
|
||||
<option value="400">400 请求错误</option>
|
||||
<option value="401">401 未认证</option>
|
||||
<option value="403">403 权限不足</option>
|
||||
<option value="404">404 资源不存在</option>
|
||||
<option value="500">500 服务端异常</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sim-location">重定向目标(仅 /login)</label>
|
||||
<input id="sim-location" type="text" placeholder="成功后为 /uc;失败含 error 参数" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label for="sim-attempted">尝试的用户名(登录请求)</label>
|
||||
<input id="sim-attempted" type="text" placeholder="如 admin,可留空" autocomplete="off">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sim-prev">写入前资源(JSON,可选)</label>
|
||||
<input id="sim-prev-note" type="text" value="由内置快照自动提供" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="sim-body">请求体 JSON(可选,用于字段 diff;敏感字段自动脱敏)</label>
|
||||
<textarea id="sim-body" rows="4" spellcheck="false" placeholder='{"apiVersion":"content.halo.run/v1alpha1","kind":"Post","metadata":{"name":"hello-halo"},"spec":{"title":"新标题"}}'></textarea>
|
||||
</div>
|
||||
|
||||
<div class="presets">
|
||||
<button class="chip" data-preset='{"user":"editor.zhang","method":"PUT","path":"/apis/content.halo.run/v1alpha1/posts/hello-halo","status":200,"snapshot":"post","body":{"apiVersion":"content.halo.run/v1alpha1","kind":"Post","metadata":{"name":"hello-halo","labels":{"content.halo.run/pinned":"false"}},"spec":{"title":"你好,Halo(Demo 修改)","slug":"hello-halo","visible":"PUBLIC","publish":true,"pinned":false,"allowComment":true,"summary":"从零开始搭建自己的写作空间。"}}}'>编辑文章(含 diff)</button>
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"POST","path":"/apis/api.content.halo.run/v1alpha1/posts/reading-notes-11/publish","status":200}'>发布文章</button>
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"POST","path":"/apis/plugin.halo.run/v1alpha1/plugins/plugin-search-widget/upgrade","status":200,"snapshot":"plugin","body":{"apiVersion":"plugin.halo.run/v1alpha1","kind":"Plugin","metadata":{"name":"plugin-search-widget"},"spec":{"displayName":"搜索组件","version":"1.4.0","enabled":true,"requires":">=2.20.0"}}}'>升级插件(含 diff)</button>
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"PUT","path":"/apis/api.console.halo.run/v1alpha1/users/guichumo/password","status":200,"body":{"apiVersion":"v1alpha1","kind":"User","metadata":{"name":"guichumo"},"spec":{"displayName":"guichumo","email":"guichumo@example.com","roles":["role-template-author"],"password":"runtime-demo-value"}}}'>修改密码(脱敏)</button>
|
||||
<button class="chip" data-preset='{"user":"__anon__","method":"POST","path":"/login","status":302,"location":"/login?error=invalid-credential&method=form","attempted":"admin"}'>登录失败(表单 302)</button>
|
||||
<button class="chip" data-preset='{"user":"__anon__","method":"POST","path":"/login","status":302,"location":"/uc","attempted":"guichumo"}'>登录成功(302 → /uc)</button>
|
||||
<button class="chip" data-preset='{"user":"__anon__","method":"GET","path":"/login?error=invalid-credential&method=form","status":200}'>登录失败回显(GET 200)</button>
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"GET","path":"/apis/api.content.halo.run/v1alpha1/posts","status":200}'>查询文章列表(读,不记录)</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="sim-path">请求路径</label>
|
||||
<input id="sim-path" type="text" placeholder="/apis/content.halo.run/v1alpha1/posts/hello-halo" autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
|
||||
<div class="presets">
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"PUT","path":"/apis/content.halo.run/v1alpha1/posts/hello-halo","status":200}'>编辑文章</button>
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"POST","path":"/apis/api.content.halo.run/v1alpha1/posts/reading-notes-11/publish","status":200}'>发布文章</button>
|
||||
<button class="chip" data-preset='{"user":"editor.zhang","method":"POST","path":"/apis/api.halo.run/v1alpha1/comments/comment-8fa2c1/approve","status":200}'>审核评论</button>
|
||||
<button class="chip" data-preset='{"user":"__anon__","method":"POST","path":"/login","status":401}'>登录失败</button>
|
||||
<button class="chip" data-preset='{"user":"guichumo","method":"GET","path":"/apis/api.content.halo.run/v1alpha1/posts","status":200}'>查询文章列表(读)</button>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="sim-status">模拟响应</label>
|
||||
<select id="sim-status">
|
||||
<option value="200">200 成功</option>
|
||||
<option value="201">201 创建成功</option>
|
||||
<option value="204">204 删除成功</option>
|
||||
<option value="400">400 请求错误</option>
|
||||
<option value="401">401 未认证</option>
|
||||
<option value="403">403 权限不足</option>
|
||||
<option value="404">404 资源不存在</option>
|
||||
<option value="500">500 服务端异常</option>
|
||||
</select>
|
||||
<div id="sim-system-fields" hidden>
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label for="sys-method">事件类型</label>
|
||||
<select id="sys-method">
|
||||
<option value="PUT">更新(PUT 语义)</option>
|
||||
<option value="DELETE">删除(DELETE 语义)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sys-type">资源类型</label>
|
||||
<select id="sys-type"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sys-name">资源名称</label>
|
||||
<input id="sys-name" type="text" value="weekly-2026-w46" autocomplete="off">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="sys-changes">字段变更(JSON 数组)</label>
|
||||
<textarea id="sys-changes" rows="4" spellcheck="false">[
|
||||
{"field":"spec.publish","changeType":"UPDATED","oldValue":"false","newValue":"true"},
|
||||
{"field":"spec.publishTime","changeType":"ADDED","oldValue":null,"newValue":"2026-11-22T02:00:00Z"}
|
||||
]</textarea>
|
||||
</div>
|
||||
<div class="presets">
|
||||
<button class="chip" data-sys-preset='{"method":"PUT","type":"posts","name":"weekly-2026-w46","changes":[{"field":"spec.publish","changeType":"UPDATED","oldValue":"false","newValue":"true"},{"field":"spec.publishTime","changeType":"ADDED","oldValue":null,"newValue":"2026-11-22T02:00:00Z"}]}'>定时发布文章</button>
|
||||
<button class="chip" data-sys-preset='{"method":"DELETE","type":"posts","name":"draft-night-notes","changes":[{"field":"spec.title","changeType":"REMOVED","oldValue":"夜间随笔(未发布)","newValue":null}]}'>清理未发布草稿</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-actions">
|
||||
|
||||
Reference in New Issue
Block a user