feat(ui): show diagnostics log state in the Brain overview

This commit is contained in:
newbie 2026-11-25 15:17:49 +08:00
parent d68840202e
commit c8101a3e54
4 changed files with 9 additions and 1 deletions

View File

@ -4320,7 +4320,11 @@ window.__ModuleLoader__.load({
label: "记忆",
value: settings.memoryEnabled === true ? "开" : "关",
tone: settings.memoryEnabled === true ? "ok" : "muted"
})), status?.lastCheck === null || status?.lastCheck === void 0 ? null : h$5("p", { className: BrainPanel_module_css_default.hint }, "最近检查:" + formatTime(status.lastCheck.at) + " · " + String(status.lastCheck.status ?? ""))), h$5(Card, { title: "五个 bundle 开关态" }, h$5("div", { className: BrainPanel_module_css_default.pills }, bundleKeys.map((key) => h$5(Pill, {
}), h$5(Pill, {
label: "诊断日志",
value: settings.diagnosticsEnabled === false ? "关" : "开",
tone: settings.diagnosticsEnabled === false ? "muted" : "ok"
})), h$5("p", { className: BrainPanel_module_css_default.hint }, "诊断日志位置:$DSH_HOME/brain/logs(全局)与 <项目>/.dsh/brain/logs(项目)"), status?.lastCheck === null || status?.lastCheck === void 0 ? null : h$5("p", { className: BrainPanel_module_css_default.hint }, "最近检查:" + formatTime(status.lastCheck.at) + " · " + String(status.lastCheck.status ?? ""))), h$5(Card, { title: "五个 bundle 开关态" }, h$5("div", { className: BrainPanel_module_css_default.pills }, bundleKeys.map((key) => h$5(Pill, {
key,
label: BUNDLE_LABELS[key] ?? key,
value: bundles[key] === true ? "启用" : bundles[key] === false ? "停用" : "未知",

View File

@ -89,6 +89,7 @@ export function buildStatusPayload(deps) {
autoSummaryEnabled: view.autoSummaryEnabled,
autoProfileEnabled: view.autoProfileEnabled,
localMemoryK: view.localMemoryK,
diagnosticsEnabled: view.diagnosticsEnabled,
};
return {
ok: true,

View File

@ -85,7 +85,9 @@ export function Overview(props: { active?: boolean }): any {
h(Pill, { label: '服务', value: settings.baseUrlConfigured === false ? '未配置' : (settings.baseUrlOrigin || '已配置'), tone: settings.baseUrlConfigured === false ? 'warn' : 'muted' }),
h(Pill, { label: '上报', value: settings.activityEnabled === true ? '开' : '关', tone: settings.activityEnabled === true ? 'ok' : 'muted' }),
h(Pill, { label: '记忆', value: settings.memoryEnabled === true ? '开' : '关', tone: settings.memoryEnabled === true ? 'ok' : 'muted' }),
h(Pill, { label: '诊断日志', value: settings.diagnosticsEnabled === false ? '关' : '开', tone: settings.diagnosticsEnabled === false ? 'muted' : 'ok' }),
),
h('p', { className: styles.hint }, '诊断日志位置:$DSH_HOME/brain/logs(全局)与 <项目>/.dsh/brain/logs(项目)'),
status?.lastCheck === null || status?.lastCheck === undefined ? null : h('p', { className: styles.hint }, '最近检查:' + formatTime(status.lastCheck.at) + ' · ' + String(status.lastCheck.status ?? '')),
),
h(Card, { title: '五个 bundle 开关态' },

View File

@ -183,6 +183,7 @@ export function buildStatusPayload(deps: RouteDeps): Record<string, unknown> {
autoSummaryEnabled: view.autoSummaryEnabled,
autoProfileEnabled: view.autoProfileEnabled,
localMemoryK: view.localMemoryK,
diagnosticsEnabled: view.diagnosticsEnabled,
}
return {
ok: true,