Update core scanner, parser, SSH client, and UI

This commit is contained in:
2026-05-05 20:07:24 +00:00
parent 40d4679a59
commit d32ca80a22
6 changed files with 313 additions and 79 deletions
+16
View File
@@ -64,6 +64,20 @@ def api_scan():
return jsonify({"status": "started", "dept": None})
@app.route("/api/scan/clear", methods=["POST"])
def api_scan_clear():
"""Wipe all switch & link data then run a full scan."""
if scanner.scan_state["running"]:
return jsonify({"error": "Scan already running"}), 409
conn = db.get_conn()
conn.execute("DELETE FROM switches")
conn.execute("DELETE FROM links")
conn.commit()
conn.close()
_trigger_scan_background(dept=None)
return jsonify({"status": "started", "cleared": True})
@app.route("/api/scan/elec", methods=["POST"])
def api_scan_elec():
"""Scan only ELEC department switches."""
@@ -116,6 +130,8 @@ def api_topology():
"hostname": sw.get("hostname", ""),
"mgmt_ip": sw.get("mgmt_ip", ""),
"description": sw.get("description", ""),
"firmware": sw.get("firmware", ""),
"vendor": sw.get("vendor", ""),
"chassis_id": chassis_id,
"last_seen": sw.get("last_seen", ""),
}