@restregular/dsh-memory 0.12.3 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -0
- package/lib/client.js +77 -38
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的版本记录。安装 id 与 npm 版本一一对应。
|
|
4
4
|
|
|
5
|
+
## 0.12.4 — 审计页自动刷新与窗口内布局
|
|
6
|
+
|
|
7
|
+
- **自动刷新**:默认开启,间隔 0.5 秒;可关闭,并可在 0.5 / 1 / 2 / 5 / 10 秒之间切换。
|
|
8
|
+
刷新在页面隐藏时跳过;静默刷新不显示加载态、不影响当前筛选与选中详情。
|
|
9
|
+
- **精简顶部**:移除“记忆审计”标题、解释文本和右侧“内存模式”气泡;保留带边框的内存模式提示。
|
|
10
|
+
- **窗口内布局**:审计页固定为视口高度,整页不再上下滚动;只有事件列表与详情各自滚动。
|
|
11
|
+
- **列表标题栏**:新增与行对齐的表头(时间 / 通道·事件 / 触发·阶段 / 候选·选中·省略 / 预算 / 投递 / 结果);
|
|
12
|
+
收窄触发/阶段列,放宽结果列,数值列自适应。
|
|
13
|
+
- **操作反馈就地显示**:“已复制”显示在复制按钮旁,导出结果显示在导出按钮旁,不再固定在顶部。
|
|
14
|
+
- 测试补充:审计页无标题/解释文本、自动刷新开关可见、列表位于滚动容器、筛选用自绘控件、两行筛选布局。
|
|
15
|
+
|
|
5
16
|
## 0.12.3 — 审计页筛选与滚动布局优化
|
|
6
17
|
|
|
7
18
|
- 筛选区改为两行紧凑布局:会话/通道/结果/时间范围/搜索/仅看问题/刷新在第一行,
|
package/README.md
CHANGED
|
@@ -415,6 +415,7 @@ npm run verify # 构建到 .verify/,不落 packages/
|
|
|
415
415
|
|
|
416
416
|
## 更新日志
|
|
417
417
|
|
|
418
|
+
- **0.12.4** —— 审计页默认每 0.5 秒自动刷新(可关/可调间隔);移除顶部标题与气泡,整页固定在窗口内,仅列表滚动;新增表头并优化列宽;复制/导出提示就地显示。
|
|
418
419
|
- **0.12.3** —— 审计页筛选改为两行紧凑布局与自绘时间范围/开关;事件列表放入独立滚动容器。
|
|
419
420
|
- **0.12.2** —— 修复 `CordisMemoryService` 未转发审计方法,导致审计页显示“provider 未提供注入审计接口”;升级后需重启 DSH。
|
|
420
421
|
- **0.12.1** —— 审计 v2 收尾:详情无障碍/唯一 key、JSON 导出、摘要渲染失败记录、部分注入 outcome。
|
package/lib/client.js
CHANGED
|
@@ -335,11 +335,12 @@ window.__ModuleLoader__.load({
|
|
|
335
335
|
'.memp .td-rel-text{color:var(--dsw-alias-label-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}',
|
|
336
336
|
'@media (max-width:620px){.memp .tree-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.memp .tree-toolbar input[type=text]{max-width:none}}',
|
|
337
337
|
// ===== 审计 =====
|
|
338
|
-
'.memp .audit{display:flex;flex-direction:column;gap:
|
|
338
|
+
'.memp .audit{display:flex;flex-direction:column;gap:10px;min-height:0;height:calc(100vh - 160px);max-height:calc(100vh - 160px);overflow:hidden}',
|
|
339
339
|
'.memp .audit-head{display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}',
|
|
340
340
|
'.memp .audit-title{font-size:16px;font-weight:650;line-height:1.35}',
|
|
341
341
|
'.memp .audit-sub{font-size:11.5px;color:var(--dsw-alias-label-secondary);line-height:1.55;margin-top:2px}',
|
|
342
342
|
'.memp .audit-mode{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:wrap}',
|
|
343
|
+
'.memp .audit-inline-note{font-size:10.5px;color:var(--dsw-alias-brand-primary);white-space:nowrap}',
|
|
343
344
|
'.memp .audit-banner{border:1px solid color-mix(in srgb,#D9A441 42%,var(--dsw-alias-border-l1));background:color-mix(in srgb,#D9A441 9%,transparent);border-radius:9px;padding:7px 10px;font-size:11.5px;line-height:1.55;color:var(--dsw-alias-label-secondary)}',
|
|
344
345
|
'.memp .audit-banner.bad{border-color:color-mix(in srgb,var(--dsw-alias-label-danger, #e05555) 45%,var(--dsw-alias-border-l1));background:color-mix(in srgb,var(--dsw-alias-label-danger, #e05555) 8%,transparent)}',
|
|
345
346
|
'.memp .audit-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}',
|
|
@@ -360,13 +361,15 @@ window.__ModuleLoader__.load({
|
|
|
360
361
|
'.memp .audit-switch .switch.on .knob{left:16px}',
|
|
361
362
|
'.memp .audit-filter-sub{padding-top:1px}',
|
|
362
363
|
'.memp .audit-range-sep{color:var(--dsw-alias-label-secondary);font-size:11px;flex:none}',
|
|
363
|
-
'.memp .audit-split{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-height:0;align-items:
|
|
364
|
+
'.memp .audit-split{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-height:0;flex:1;overflow:hidden;align-items:stretch}',
|
|
364
365
|
'.memp .audit-split.has-detail{grid-template-columns:minmax(0,1fr) minmax(300px,360px)}',
|
|
365
|
-
'.memp .audit-list{display:flex;flex-direction:column;
|
|
366
|
+
'.memp .audit-list-wrap{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}',
|
|
367
|
+
'.memp .audit-table-head{display:grid;grid-template-columns:58px 110px 104px minmax(72px,1fr) 92px 106px 84px;gap:8px;align-items:center;padding:0 9px 5px;margin-bottom:2px;font-size:10px;letter-spacing:.03em;color:var(--dsw-alias-label-secondary);border-bottom:1px solid var(--dsw-alias-border-l1)}',
|
|
368
|
+
'.memp .audit-list{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:5px 4px 1px 1px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--dsw-alias-label-secondary) 30%,transparent) transparent}',
|
|
366
369
|
'.memp .audit-list::-webkit-scrollbar{width:8px}',
|
|
367
370
|
'.memp .audit-list::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--dsw-alias-label-secondary) 28%,transparent);border-radius:999px;border:2px solid transparent;background-clip:padding-box}',
|
|
368
371
|
'.memp .audit-list::-webkit-scrollbar-track{background:transparent}',
|
|
369
|
-
'.memp .audit-row{display:grid;grid-template-columns:
|
|
372
|
+
'.memp .audit-row{display:grid;grid-template-columns:58px 110px 104px minmax(72px,1fr) 92px 106px 84px;gap:8px;align-items:center;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-alias-bg-layer-1);padding:6px 9px;font-size:11.5px;cursor:pointer;text-align:left;color:inherit;width:100%}',
|
|
370
373
|
'.memp .audit-row:hover{border-color:var(--dsw-alias-brand-primary)}',
|
|
371
374
|
'.memp .audit-row.on{border-color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 6%,var(--dsw-alias-bg-layer-1))}',
|
|
372
375
|
'.memp .audit-row .m{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
@@ -381,7 +384,7 @@ window.__ModuleLoader__.load({
|
|
|
381
384
|
'.memp .audit-pill.bad{color:var(--dsw-alias-label-danger, #e05555);border-color:color-mix(in srgb,var(--dsw-alias-label-danger, #e05555) 42%,var(--dsw-alias-border-l1))}',
|
|
382
385
|
'.memp .audit-pill.mute{color:var(--dsw-alias-label-secondary)}',
|
|
383
386
|
'.memp .audit-empty{border:1px dashed var(--dsw-alias-border-l1);border-radius:10px;padding:26px 16px;text-align:center;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.65}',
|
|
384
|
-
'.memp .audit-detail{border:1px solid var(--dsw-alias-border-l1);border-radius:11px;background:var(--dsw-alias-bg-layer-1);padding:10px 11px;display:flex;flex-direction:column;gap:9px;max-height:min
|
|
387
|
+
'.memp .audit-detail{border:1px solid var(--dsw-alias-border-l1);border-radius:11px;background:var(--dsw-alias-bg-layer-1);padding:10px 11px;display:flex;flex-direction:column;gap:9px;max-height:100%;min-height:0;overflow:auto;scrollbar-width:thin}',
|
|
385
388
|
'.memp .audit-detail-head{display:flex;gap:7px;align-items:center}',
|
|
386
389
|
'.memp .audit-detail-head b{font-size:12.5px}',
|
|
387
390
|
'.memp .audit-detail-head .spacer{flex:1}',
|
|
@@ -399,8 +402,8 @@ window.__ModuleLoader__.load({
|
|
|
399
402
|
'.memp .audit-json{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;line-height:1.45;white-space:pre-wrap;word-break:break-word;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:7px;max-height:220px;overflow:auto}',
|
|
400
403
|
'.memp .audit-pager{display:flex;gap:6px;align-items:center;justify-content:flex-end;font-size:11px;color:var(--dsw-alias-label-secondary)}',
|
|
401
404
|
'.memp .audit-flat{display:flex;flex-wrap:wrap;gap:4px}',
|
|
402
|
-
'@media (max-width:900px){.memp .audit-split.has-detail{grid-template-columns:minmax(0,1fr)}.memp .audit-row{grid-template-columns:54px
|
|
403
|
-
'@media (max-width:620px){.memp .audit-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.memp .audit-row{
|
|
405
|
+
'@media (max-width:900px){.memp .audit-split.has-detail{grid-template-columns:minmax(0,1fr)}.memp .audit-row{grid-template-columns:54px 96px 92px minmax(60px,1fr) 76px 92px 76px}.memp .audit-table-head{grid-template-columns:54px 96px 92px minmax(60px,1fr) 76px 92px 76px}}',
|
|
406
|
+
'@media (max-width:620px){.memp .audit-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.memp .audit-table-head{display:none}.memp .audit-row{display:flex;flex-wrap:wrap;gap:4px 8px}.memp .audit-row .col-trigger,.memp .audit-row .col-budget{display:none}.memp .audit-row .col-nums{margin-left:auto}.memp .audit-row .col-time{order:1}.memp .audit-row .col-channel{order:2}.memp .audit-row .col-delivery{order:3}.memp .audit-row .col-outcome{order:4;margin-left:auto}.memp .audit-filter-row input[type=text],.memp .audit-filter-row input[type=search]{max-width:none;flex:1}.memp .audit{height:calc(100vh - 120px);max-height:calc(100vh - 120px)}}',
|
|
404
407
|
].join('')
|
|
405
408
|
|
|
406
409
|
async function api(method, body) {
|
|
@@ -2091,6 +2094,7 @@ window.__ModuleLoader__.load({
|
|
|
2091
2094
|
if (navigator?.clipboard?.writeText) {
|
|
2092
2095
|
await navigator.clipboard.writeText(text)
|
|
2093
2096
|
setNotice('已复制')
|
|
2097
|
+
setTimeout(() => setNotice(''), 2200)
|
|
2094
2098
|
return
|
|
2095
2099
|
}
|
|
2096
2100
|
} catch { /* fallthrough */ }
|
|
@@ -2122,7 +2126,11 @@ window.__ModuleLoader__.load({
|
|
|
2122
2126
|
const [cursor, setCursor] = React.useState('')
|
|
2123
2127
|
const [loading, setLoading] = React.useState(true)
|
|
2124
2128
|
const [error, setError] = React.useState('')
|
|
2125
|
-
const [
|
|
2129
|
+
const [copyNotice, setCopyNotice] = React.useState('')
|
|
2130
|
+
const [exportNotice, setExportNotice] = React.useState('')
|
|
2131
|
+
const [autoRefresh, setAutoRefresh] = React.useState(true)
|
|
2132
|
+
const [refreshMs, setRefreshMs] = React.useState(500)
|
|
2133
|
+
const loadingRef = React.useRef(false)
|
|
2126
2134
|
const [session, setSession] = React.useState(readAuditSession())
|
|
2127
2135
|
const [channel, setChannel] = React.useState('')
|
|
2128
2136
|
const [outcome, setOutcome] = React.useState('')
|
|
@@ -2159,8 +2167,11 @@ window.__ModuleLoader__.load({
|
|
|
2159
2167
|
return params
|
|
2160
2168
|
}
|
|
2161
2169
|
|
|
2162
|
-
async function load(cursorValue, stack) {
|
|
2163
|
-
|
|
2170
|
+
async function load(cursorValue, stack, options = {}) {
|
|
2171
|
+
const silent = options.silent === true
|
|
2172
|
+
if (silent && loadingRef.current) return
|
|
2173
|
+
loadingRef.current = true
|
|
2174
|
+
if (!silent) { setLoading(true); setError('') }
|
|
2164
2175
|
try {
|
|
2165
2176
|
const value = await api(`audit?${queryParams(cursorValue)}`)
|
|
2166
2177
|
const list = Array.isArray(value.entries) ? value.entries : []
|
|
@@ -2170,16 +2181,28 @@ window.__ModuleLoader__.load({
|
|
|
2170
2181
|
setNextCursor(typeof value.nextCursor === 'string' ? value.nextCursor : null)
|
|
2171
2182
|
setCursor(cursorValue || '')
|
|
2172
2183
|
if (stack !== undefined) setCursorStack(stack)
|
|
2173
|
-
if (selectedId !== null && !list.some((entry) => entry.id === selectedId)) setSelectedId(null)
|
|
2184
|
+
if (selectedId !== null && !list.some((entry) => entry.id === selectedId)) { setSelectedId(null); setCopyNotice('') }
|
|
2185
|
+
if (silent) setError('')
|
|
2174
2186
|
} catch (e) {
|
|
2175
2187
|
setError(String(e.message || e))
|
|
2176
|
-
setEntries([])
|
|
2188
|
+
if (!silent) setEntries([])
|
|
2177
2189
|
}
|
|
2178
|
-
|
|
2190
|
+
loadingRef.current = false
|
|
2191
|
+
if (!silent) setLoading(false)
|
|
2179
2192
|
}
|
|
2180
2193
|
|
|
2181
2194
|
React.useEffect(() => { load('', []) }, [reloadTick])
|
|
2182
2195
|
|
|
2196
|
+
// 自动刷新:默认 500ms,可关;页面隐藏时跳过,避免后台无意义轮询。
|
|
2197
|
+
React.useEffect(() => {
|
|
2198
|
+
if (!autoRefresh) return undefined
|
|
2199
|
+
const timer = setInterval(() => {
|
|
2200
|
+
if (typeof document !== 'undefined' && document.hidden) return
|
|
2201
|
+
load(cursor, cursorStack, { silent: true })
|
|
2202
|
+
}, refreshMs)
|
|
2203
|
+
return () => clearInterval(timer)
|
|
2204
|
+
}, [autoRefresh, refreshMs, cursor, cursorStack, session, channel, outcome, trigger, search, problem, range, since, until])
|
|
2205
|
+
|
|
2183
2206
|
const resetAndReload = () => { setCursor(''); setCursorStack([]); setReloadTick((n) => n + 1) }
|
|
2184
2207
|
const selected = selectedId === null ? null : entries.find((entry) => entry.id === selectedId) || null
|
|
2185
2208
|
const prepared = entries.filter((entry) => entry.delivery && entry.delivery.status === 'unknown' && entry.reasonCode === 'prepared').length
|
|
@@ -2200,9 +2223,10 @@ window.__ModuleLoader__.load({
|
|
|
2200
2223
|
const channelOptions = [{ value: '', label: '全部通道' }].concat(Object.keys(AUDIT_CHANNEL_META).map((key) => ({ value: key, label: AUDIT_CHANNEL_META[key] })))
|
|
2201
2224
|
const outcomeOptions = [{ value: '', label: '全部结果' }].concat(Object.keys(AUDIT_OUTCOME_META).map((key) => ({ value: key, label: AUDIT_OUTCOME_META[key].label })))
|
|
2202
2225
|
const rangeOptions = AUDIT_RANGE_META.map((item) => ({ value: item.value, label: item.label }))
|
|
2226
|
+
const refreshOptions = [500, 1000, 2000, 5000, 10000].map((ms) => ({ value: String(ms), label: `${ms / 1000} 秒` }))
|
|
2203
2227
|
|
|
2204
2228
|
const exportAudit = async (format) => {
|
|
2205
|
-
|
|
2229
|
+
setExportNotice('')
|
|
2206
2230
|
try {
|
|
2207
2231
|
const res = await fetch(`${API}/audit/export?${queryParams('')}&format=${format}`)
|
|
2208
2232
|
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
@@ -2213,9 +2237,10 @@ window.__ModuleLoader__.load({
|
|
|
2213
2237
|
link.download = `dsh-memory-audit.${format}`
|
|
2214
2238
|
link.click()
|
|
2215
2239
|
setTimeout(() => URL.revokeObjectURL(url), 1000)
|
|
2216
|
-
|
|
2240
|
+
setExportNotice(`已导出当前筛选(${format.toUpperCase()})。`)
|
|
2241
|
+
setTimeout(() => setExportNotice(''), 2200)
|
|
2217
2242
|
} catch (e) {
|
|
2218
|
-
|
|
2243
|
+
setExportNotice(`导出失败:${String(e.message || e)}`)
|
|
2219
2244
|
}
|
|
2220
2245
|
}
|
|
2221
2246
|
|
|
@@ -2263,6 +2288,14 @@ window.__ModuleLoader__.load({
|
|
|
2263
2288
|
h('button', { disabled: loading, onClick: () => setReloadTick((n) => n + 1) }, loading ? '刷新中…' : '刷新'),
|
|
2264
2289
|
),
|
|
2265
2290
|
h('div', { className: 'audit-filter-row audit-filter-sub' },
|
|
2291
|
+
h('span', { className: 'audit-switch' },
|
|
2292
|
+
h(Switch, { checked: autoRefresh, disabled: loading, label: '自动刷新', onChange: (next) => setAutoRefresh(next) }),
|
|
2293
|
+
'自动刷新',
|
|
2294
|
+
),
|
|
2295
|
+
h(Dropdown, {
|
|
2296
|
+
items: refreshOptions, value: String(refreshMs), disabled: loading || !autoRefresh,
|
|
2297
|
+
onChange: (next) => setRefreshMs(Number(next)),
|
|
2298
|
+
}),
|
|
2266
2299
|
h('input', {
|
|
2267
2300
|
type: 'text', className: 'audit-trigger', placeholder: '触发源', value: trigger,
|
|
2268
2301
|
'aria-label': '按触发源筛选',
|
|
@@ -2294,6 +2327,7 @@ window.__ModuleLoader__.load({
|
|
|
2294
2327
|
h('span', { className: 'spacer' }),
|
|
2295
2328
|
h('button', { disabled: loading, onClick: () => exportAudit('jsonl') }, '导出 JSONL'),
|
|
2296
2329
|
h('button', { disabled: loading, onClick: () => exportAudit('json') }, '导出 JSON'),
|
|
2330
|
+
exportNotice ? h('span', { className: 'audit-inline-note' }, exportNotice) : null,
|
|
2297
2331
|
),
|
|
2298
2332
|
)
|
|
2299
2333
|
|
|
@@ -2307,24 +2341,24 @@ window.__ModuleLoader__.load({
|
|
|
2307
2341
|
return h('button', {
|
|
2308
2342
|
key: entry.id,
|
|
2309
2343
|
className: 'audit-row' + (entry.id === selectedId ? ' on' : ''),
|
|
2310
|
-
onClick: () => setSelectedId(entry.id),
|
|
2344
|
+
onClick: () => { setSelectedId(entry.id); setCopyNotice('') },
|
|
2311
2345
|
},
|
|
2312
|
-
h('span', { className: 'm t', title: fmtTime(entry.at) }, shortTime(entry.at)),
|
|
2313
|
-
h('span', { className: 'm' },
|
|
2346
|
+
h('span', { className: 'm t col-time', title: fmtTime(entry.at) }, shortTime(entry.at)),
|
|
2347
|
+
h('span', { className: 'm col-channel' },
|
|
2314
2348
|
h('b', { className: 'ch' }, auditChannelLabel(entry.channel)),
|
|
2315
2349
|
h('span', { className: 'trig' }, ` · ${entry.kind || 'event'}`),
|
|
2316
2350
|
),
|
|
2317
|
-
h('span', { className: 'm trig', title: `${entry.trigger || ''} ${entry.phase || ''}` },
|
|
2351
|
+
h('span', { className: 'm trig col-trigger', title: `${entry.trigger || ''} ${entry.phase || ''}` },
|
|
2318
2352
|
`${entry.trigger || '—'}${entry.phase ? ` / ${entry.phase}` : ''}`),
|
|
2319
|
-
h('span', { className: 'm nums' }, `${candidates} / ${picked} / ${omitted}`),
|
|
2320
|
-
h('span', { className: 'm' }, budget
|
|
2353
|
+
h('span', { className: 'm nums col-nums' }, `${candidates} / ${picked} / ${omitted}`),
|
|
2354
|
+
h('span', { className: 'm col-budget' }, budget
|
|
2321
2355
|
? h('span', { className: 'audit-budget' },
|
|
2322
2356
|
h('span', { className: 'bar' }, h('i', { className: budget.over ? 'over' : '', style: { width: `${budget.budget > 0 ? Math.min(100, Math.round((budget.used / budget.budget) * 100)) : 100}%` } })),
|
|
2323
2357
|
h('span', { className: 'num' }, `${budget.used}/${budget.budget}`),
|
|
2324
2358
|
)
|
|
2325
2359
|
: h('span', { className: 'muted' }, '—')),
|
|
2326
|
-
h('span', { className: 'm del' }, auditPill(delivery.label + delivery.detail, delivery.tone, delivery.detail || undefined)),
|
|
2327
|
-
h('span', { className: 'm' }, auditPill(outcomeMeta.label, outcomeMeta.tone)),
|
|
2360
|
+
h('span', { className: 'm del col-delivery' }, auditPill(delivery.label + delivery.detail, delivery.tone, delivery.detail || undefined)),
|
|
2361
|
+
h('span', { className: 'm col-outcome' }, auditPill(outcomeMeta.label, outcomeMeta.tone)),
|
|
2328
2362
|
)
|
|
2329
2363
|
}
|
|
2330
2364
|
|
|
@@ -2349,8 +2383,9 @@ window.__ModuleLoader__.load({
|
|
|
2349
2383
|
h('div', { className: 'audit-detail-head' },
|
|
2350
2384
|
h('b', null, auditSummaryLine(selected)),
|
|
2351
2385
|
h('span', { className: 'spacer' }),
|
|
2352
|
-
h('button', { className: 'linkbtn', onClick: () => copyAuditText(selected.id,
|
|
2353
|
-
h('
|
|
2386
|
+
h('button', { className: 'linkbtn', onClick: () => copyAuditText(selected.id, setCopyNotice) }, '复制 ID'),
|
|
2387
|
+
copyNotice ? h('span', { className: 'audit-inline-note' }, copyNotice) : null,
|
|
2388
|
+
h('button', { className: 'audit-close', title: '关闭', onClick: () => { setSelectedId(null); setCopyNotice('') } }, '×'),
|
|
2354
2389
|
),
|
|
2355
2390
|
h('div', { className: 'audit-kv' },
|
|
2356
2391
|
kv('事件', selected.id),
|
|
@@ -2425,7 +2460,7 @@ window.__ModuleLoader__.load({
|
|
|
2425
2460
|
h('details', { className: 'audit-sec' },
|
|
2426
2461
|
h('summary', { className: 'audit-sec-title' }, '原始结构化事件'),
|
|
2427
2462
|
h('pre', { className: 'audit-json' }, json),
|
|
2428
|
-
h('div', { className: 'row' }, h('button', { className: 'linkbtn', onClick: () => copyAuditText(json,
|
|
2463
|
+
h('div', { className: 'row' }, h('button', { className: 'linkbtn', onClick: () => copyAuditText(json, setCopyNotice) }, '复制 JSON'), copyNotice ? h('span', { className: 'audit-inline-note' }, copyNotice) : null),
|
|
2429
2464
|
),
|
|
2430
2465
|
)
|
|
2431
2466
|
})() : null
|
|
@@ -2441,17 +2476,21 @@ window.__ModuleLoader__.load({
|
|
|
2441
2476
|
)
|
|
2442
2477
|
: h('div', { className: 'audit-list' }, entries.map(row))
|
|
2443
2478
|
|
|
2479
|
+
const listHeader = h('div', { className: 'audit-table-head' },
|
|
2480
|
+
h('span', null, '时间'),
|
|
2481
|
+
h('span', null, '通道 / 事件'),
|
|
2482
|
+
h('span', null, '触发 / 阶段'),
|
|
2483
|
+
h('span', null, '候选 / 选中 / 省略'),
|
|
2484
|
+
h('span', null, '预算'),
|
|
2485
|
+
h('span', null, '投递'),
|
|
2486
|
+
h('span', null, '结果'),
|
|
2487
|
+
)
|
|
2488
|
+
const listArea = h('div', { className: 'audit-list-wrap' },
|
|
2489
|
+
entries.length > 0 ? listHeader : null,
|
|
2490
|
+
listBody,
|
|
2491
|
+
)
|
|
2492
|
+
|
|
2444
2493
|
return h('div', { className: 'audit' },
|
|
2445
|
-
h('div', { className: 'audit-head' },
|
|
2446
|
-
h('div', null,
|
|
2447
|
-
h('div', { className: 'audit-title' }, '记忆审计'),
|
|
2448
|
-
h('div', { className: 'audit-sub' }, '追踪记忆注入的触发、筛选、预算、投递与失败原因;评估选中 ≠ 已投递。'),
|
|
2449
|
-
),
|
|
2450
|
-
h('div', { className: 'audit-mode' },
|
|
2451
|
-
auditPill(persistence === 'memory' ? '内存模式 · 重启后不保留' : persistence === 'jsonl' ? '持久化正常' : '记录不完整', persistence === 'degraded' ? 'bad' : persistence === 'memory' ? 'warn' : 'ok'),
|
|
2452
|
-
notice ? h('span', { className: 'muted' }, notice) : null,
|
|
2453
|
-
),
|
|
2454
|
-
),
|
|
2455
2494
|
...banner,
|
|
2456
2495
|
h('div', { className: 'audit-stats' },
|
|
2457
2496
|
h('div', { className: 'audit-stat' }, h('b', null, String(total)), h('span', null, '筛选内事件')),
|
|
@@ -2463,7 +2502,7 @@ window.__ModuleLoader__.load({
|
|
|
2463
2502
|
toolbar,
|
|
2464
2503
|
error && entries.length > 0 ? h('div', { className: 'err' }, error) : null,
|
|
2465
2504
|
h('div', { className: 'audit-split' + (selected ? ' has-detail' : '') },
|
|
2466
|
-
|
|
2505
|
+
listArea,
|
|
2467
2506
|
detail,
|
|
2468
2507
|
),
|
|
2469
2508
|
h('div', { className: 'audit-pager' },
|