@kira905/dsh-butler-panel 0.9.2 → 0.9.3
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/lib/shards.mjs +10 -2
- package/package.json +1 -1
package/lib/shards.mjs
CHANGED
|
@@ -1112,10 +1112,18 @@ export async function collectServiceShard(ctx = {}) {
|
|
|
1112
1112
|
const home = dshHome();
|
|
1113
1113
|
const asOf = { at: now, source: 'compute' };
|
|
1114
1114
|
// 可选依赖:宿主若提供了「外部通道健康」判定件(butlerLib 能解析到),就渲染它的结论;
|
|
1115
|
-
// 解析不到 ⇒
|
|
1115
|
+
// 解析不到 ⇒ 走下面的显式降级。**开源包里不带这份判定件**(它属于宿主侧能力、且不开源),这不是故障。
|
|
1116
|
+
// 🔴 降级话术必须把"为什么没有"说成人话:不是"坏了",是"这个模块不在包里"。留一行可照做的指引。
|
|
1116
1117
|
const sh = await butlerLib('secretary-health.mjs');
|
|
1117
1118
|
if (!sh || typeof sh.collectHealth !== 'function') {
|
|
1118
|
-
return {
|
|
1119
|
+
return {
|
|
1120
|
+
ok: false,
|
|
1121
|
+
// 机器可读的降级原因(面板 UI 不需要它,给夹具/排障用;新增字段,向后兼容)
|
|
1122
|
+
unavailable: 'module-not-shipped',
|
|
1123
|
+
reason: '该模块不开源,本功能不可用(开源包里不带「外部通道健康」判定件;要接就由宿主自己提供同名模块,'
|
|
1124
|
+
+ '放进大管家工具目录或设 BUTLER_ROOT)—— 面板本身不判健康,所以这里不是「服务面正常」',
|
|
1125
|
+
asOf,
|
|
1126
|
+
};
|
|
1119
1127
|
}
|
|
1120
1128
|
let health = null;
|
|
1121
1129
|
let healthError = null;
|