Fix scan log dismiss button visibility and truncate error messages

Dismiss button is now always visible with a bordered style instead of
hidden-until-JS. Netmiko error messages are truncated to first line
(120 chars) so verbose multi-line errors don't flood the log panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 17:31:21 +00:00
parent 121ac18250
commit 93afa9192b
2 changed files with 12 additions and 14 deletions
+2 -1
View File
@@ -112,9 +112,10 @@ def run_scan(dept: str = None, workers: int = 5, login_delay: int = 3):
scan_state["fail"] += 1
error = result.get("error", "Unknown error")
scan_state["errors"].append({"ip": ip, "error": error})
error_short = error.splitlines()[0][:120]
scan_state["log_lines"].append({
"ts": ts, "ok": False,
"text": f"{ip}{error}",
"text": f"{ip}{error_short}",
})
scan_all_switches(switches, progress_callback=on_progress, max_workers=workers, login_delay=login_delay)