mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-09 05:10:45 +08:00
Fix KB settings badge stuck on unconfigured after bind (0.1.38).
Reload Host kbRoot after browse/save so the status badge tracks the live package instead of a stale snapshot. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0f31a6648a
commit
1b4c402723
9 changed files with 261 additions and 50 deletions
14
lib/index.js
14
lib/index.js
|
|
@ -4878,6 +4878,20 @@ function apply(ctx, config = Config({})) {
|
|||
if (endpoint === "kb.status") {
|
||||
return { ok: true, value: getKbContext() };
|
||||
}
|
||||
if (endpoint === "kb.reload") {
|
||||
const current = source();
|
||||
const kb = resolveKbRoot(current.kbRoot ?? "");
|
||||
publishKbContext(kb);
|
||||
applyKbEnv(kb);
|
||||
if (kb.status === "configured") {
|
||||
connCtx.logger.info("netxops: kb.reload → %s (%s / %s v%s)", kb.realRoot, kb.operatorName, kb.country, kb.version);
|
||||
} else if (kb.status === "error") {
|
||||
connCtx.logger.warn("netxops: kb.reload error — %s", kb.errorMessage);
|
||||
} else {
|
||||
connCtx.logger.info("netxops: kb.reload → unconfigured (kbRoot empty)");
|
||||
}
|
||||
return { ok: true, value: kb };
|
||||
}
|
||||
if (endpoint === "kb.resolve") {
|
||||
const path = extractKbResolvePath(payload);
|
||||
return { ok: true, value: resolveKbRoot(path) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue