Add scan concurrency and login delay sliders

Serialised logins now sleep `login_delay` seconds between each SSH
auth to prevent AD/LDAP lockout. Both max sessions (1-10) and login
delay (0-15s) are configurable via UI sliders in the header and
passed as JSON to all scan endpoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-12 20:22:01 +00:00
parent d3a761baf5
commit c8de2620c8
4 changed files with 95 additions and 14 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ scan_state = {
}
def run_scan(dept: str = None):
def run_scan(dept: str = None, workers: int = 5, login_delay: int = 3):
"""
Full scan: fetch switch IPs from NocoDB → SSH all → parse → store → export.
dept: None = all active switches, "ELEC" or "GW" = dept-filtered.
@@ -105,7 +105,7 @@ def run_scan(dept: str = None):
"error": result.get("error", "Unknown error")
})
scan_all_switches(switches, progress_callback=on_progress)
scan_all_switches(switches, progress_callback=on_progress, max_workers=workers, login_delay=login_delay)
try:
merge_duplicate_switches()