dsh-agent-control-center 0.4.1 → 0.6.0
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 +80 -0
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/client.js +226 -5
- package/docs/01-CONTRACT.md +1 -1
- package/docs/05-ACCEPTANCE-EVIDENCE.md +71 -0
- package/docs/07-GUIDE.md +1 -1
- package/docs/09-ARCHITECTURE.md +1 -1
- package/docs/12-PLUGIN-HEALTH.md +18 -1
- package/docs/14-INTERACTION-REGRESSION-0.5.0.md +79 -0
- package/docs/15-WRITE-REGRESSION.md +43 -0
- package/docs/16-TOOLS-FIRST-PAINT.md +36 -0
- package/index.js +1 -1
- package/lib/modules/l-health.js +182 -1
- package/package.json +1 -1
- package/scripts/interaction-regression.py +278 -0
- package/scripts/write-regression.py +107 -0
- package/src/client/i18n/health.js +56 -0
- package/src/client/i18n/tools.js +2 -0
- package/src/client/pages/health.js +147 -0
- package/src/client/pages/tools.js +19 -3
|
@@ -444,11 +444,21 @@
|
|
|
444
444
|
// One-shot bypass flags: the first load may use the cache, an explicit
|
|
445
445
|
// Refresh must see fresh host state.
|
|
446
446
|
const forceList = ACC.useRef(false)
|
|
447
|
+
const forceHistory = ACC.useRef(false)
|
|
447
448
|
const forceDetail = ACC.useRef(false)
|
|
449
|
+
// The page paints from the registry view, which answers in well under a
|
|
450
|
+
// second; the history fold scans sessions and takes seconds, so it is a
|
|
451
|
+
// second request whose result swaps in when it arrives. Both start at once,
|
|
452
|
+
// so waiting for the history never delays the first paint.
|
|
448
453
|
const list = ACC.useAsync((context) => {
|
|
449
454
|
const refresh = forceList.current
|
|
450
455
|
forceList.current = false
|
|
451
|
-
return ACC.api('tools.list', { days, agentId: agentId.length > 0 ? agentId : undefined, includePresets: true, ...(refresh ? { refresh: true } : {}) }, context)
|
|
456
|
+
return ACC.api('tools.list', { days, agentId: agentId.length > 0 ? agentId : undefined, includePresets: true, includeHistory: false, ...(refresh ? { refresh: true } : {}) }, context)
|
|
457
|
+
}, [days, agentId])
|
|
458
|
+
const historyLoad = ACC.useAsync((context) => {
|
|
459
|
+
const refresh = forceHistory.current
|
|
460
|
+
forceHistory.current = false
|
|
461
|
+
return ACC.api('tools.list', { days, agentId: agentId.length > 0 ? agentId : undefined, includePresets: true, includeHistory: true, ...(refresh ? { refresh: true } : {}) }, context)
|
|
452
462
|
}, [days, agentId])
|
|
453
463
|
const detail = ACC.useAsync(
|
|
454
464
|
(context) => {
|
|
@@ -510,7 +520,9 @@
|
|
|
510
520
|
|
|
511
521
|
if (list.status === 'loading') return h(C.Loading, { label: t('common.loading') })
|
|
512
522
|
if (list.status === 'error') return h(C.ErrorBox, { error: list.error, onRetry: list.reload, label: t('tools.loadFailed') })
|
|
513
|
-
const data = list.data
|
|
523
|
+
const data = historyLoad.status === 'ready' ? historyLoad.data : list.data
|
|
524
|
+
// A history failure keeps the registry view usable and says why.
|
|
525
|
+
const historyPending = historyLoad.status === 'loading'
|
|
514
526
|
if (data.available === false) {
|
|
515
527
|
return h(C.Empty, {
|
|
516
528
|
title: t('tools.registryUnavailable'),
|
|
@@ -549,8 +561,10 @@
|
|
|
549
561
|
key: 'r',
|
|
550
562
|
onClick: () => {
|
|
551
563
|
forceList.current = true
|
|
564
|
+
forceHistory.current = true
|
|
552
565
|
if (selected.length > 0) forceDetail.current = true
|
|
553
566
|
list.reload()
|
|
567
|
+
historyLoad.reload()
|
|
554
568
|
if (selected.length > 0) detail.reload()
|
|
555
569
|
},
|
|
556
570
|
ariaLabel: t('tools.refreshList'),
|
|
@@ -633,7 +647,9 @@
|
|
|
633
647
|
),
|
|
634
648
|
),
|
|
635
649
|
h(InfoPanel, { t, items: [t('tools.statusLegend'), t('tools.probeNotice'), t('tools.hostNotesFold')] }),
|
|
636
|
-
|
|
650
|
+
historyPending
|
|
651
|
+
? h(C.Notice, { tone: 'info' }, t('tools.historyLoading'))
|
|
652
|
+
: history.available === false
|
|
637
653
|
? h(
|
|
638
654
|
'div',
|
|
639
655
|
{ className: 'acc-muted', style: { fontSize: '11px', display: 'flex', flexDirection: 'column', gap: '2px' } },
|