fix(diagnostic): install servicecheck_profiles.json + guard doctor/ai_doctor (#33)
Makefile was missing the install rule for servicecheck_profiles.json — the community service probe profiles were never copied to /usr/share/tachyon/ on the router, so Service Health Check had zero targets to probe and showed an empty modal.
This commit is contained in:
@@ -158,6 +158,10 @@ define Package/tachyon/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/cgi-bin
|
||||
$(INSTALL_BIN) ./files/usr/lib/cgi-bin/tachyon-agent $(1)/usr/lib/cgi-bin/tachyon-agent
|
||||
|
||||
# Service Check profiles (community-defined service probe targets)
|
||||
$(INSTALL_DIR) $(1)/usr/share/tachyon
|
||||
$(INSTALL_DATA) ./files/usr/share/tachyon/servicecheck_profiles.json $(1)/usr/share/tachyon/servicecheck_profiles.json
|
||||
|
||||
sed -i -e 's/__COMPILED_VERSION_VARIABLE__/$(TACHYON_COMPILED_VERSION)/g' \
|
||||
-e 's/__COMPILED_COMMIT_SHA__/$(shell git -C $(TOPDIR)/../ rev-parse --short HEAD 2>/dev/null || echo unknown)/g' \
|
||||
$(1)/usr/lib/tachyon/core/constants.uc
|
||||
|
||||
@@ -3052,7 +3052,18 @@ function query_llm(provider, api_key, custom_url, prompt_text, model_override) {
|
||||
}
|
||||
|
||||
function doctor(format) {
|
||||
let res = run_doctor_checks();
|
||||
let res;
|
||||
try {
|
||||
res = run_doctor_checks();
|
||||
} catch (e) {
|
||||
print(sprintf("%J\n", {
|
||||
success: false,
|
||||
issues: 0,
|
||||
fixed: 0,
|
||||
report: sprintf("Doctor failed: %s", as_string(e))
|
||||
}));
|
||||
return 1;
|
||||
}
|
||||
print(sprintf("%J\n", {
|
||||
success: true,
|
||||
issues: res.issues,
|
||||
@@ -3646,7 +3657,18 @@ function local_rule_doctor() {
|
||||
|
||||
function ai_doctor() {
|
||||
let cfg = uci_settings();
|
||||
let local_res = local_rule_doctor();
|
||||
let local_res;
|
||||
try {
|
||||
local_res = local_rule_doctor();
|
||||
} catch (e) {
|
||||
local_res = {
|
||||
report: sprintf("Local diagnosis failed: %s", as_string(e)),
|
||||
causes: [],
|
||||
quick_fixes: [],
|
||||
summary: sprintf("Local diagnosis failed: %s", as_string(e)),
|
||||
provider: "local_heuristic"
|
||||
};
|
||||
}
|
||||
|
||||
let prov = lc(trim(as_string(cfg.ai_doctor_provider || "openai")));
|
||||
let has_key = (cfg.ai_doctor_api_key && cfg.ai_doctor_api_key != "");
|
||||
|
||||
Reference in New Issue
Block a user