dsh-ops-kit 0.4.10 → 0.4.11

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.
Files changed (3) hide show
  1. package/client.js +1 -1
  2. package/index.js +4 -1
  3. package/package.json +1 -1
package/client.js CHANGED
@@ -2548,7 +2548,7 @@ window.__ModuleLoader__.load({
2548
2548
  : h('div', null, ...alerts.map((alert, index) => h('div', { key: index, className: 'ops-row', style: { gridTemplateColumns: '1fr auto' } },
2549
2549
  h('span', { style: { display: 'flex', alignItems: 'center', gap: '8px', opacity: alert.acked ? 0.5 : 1 } },
2550
2550
  h('i', { className: 'ops-dot ' + (alert.level === 'critical' ? 'bad' : alert.level === 'warning' ? 'warn' : '') }),
2551
- h('span', null, alert.message),
2551
+ h('span', null, plainCheckDetail(alert.message)),
2552
2552
  h('span', { className: 'ops-dim', style: { fontSize: '11px' } }, fmt(alert.at))),
2553
2553
  alert.acked
2554
2554
  ? h('span', { className: 'ops-chip' }, T.acked)
package/index.js CHANGED
@@ -1514,7 +1514,9 @@ async function saveConfig(patch) {
1514
1514
  async function loadState() {
1515
1515
  try {
1516
1516
  const data = JSON.parse(await readFile(stateFile(), 'utf8'))
1517
- return { hosts: data.hosts ?? {}, lastRunAt: data.lastRunAt ?? 0 }
1517
+ // 保留全部字段:monitorAlertAt / monitorSuppressed / monitorLastRun /
1518
+ // lastMetricsAt 等都要能读回,否则告警冷却和抑制会失效。
1519
+ return { ...data, hosts: data.hosts ?? {}, lastRunAt: data.lastRunAt ?? 0 }
1518
1520
  } catch (error) {
1519
1521
  softFail('loadState', error)
1520
1522
  return { hosts: {}, lastRunAt: 0 }
@@ -5260,6 +5262,7 @@ export function apply(ctx) {
5260
5262
  /** Internals for the test suite; not part of the plugin API. */
5261
5263
  export const __test = {
5262
5264
  q,
5265
+ loadState,
5263
5266
  friendlyUnit,
5264
5267
  appKey,
5265
5268
  clip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ops-kit",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "OPC-运维工作台 (dsh-ops-kit) — Server operations kit for DeepSeek Harness: server cards, health charts, config browser, app manager and plain-language AI diagnosis — over SSH, no agent install.",
5
5
  "license": "MIT",
6
6
  "type": "module",