package webui import ( "encoding/json" "fmt" "html" "path/filepath" "regexp" "sort" "strconv" "strings" "bee/audit/internal/app" "bee/audit/internal/schema" ) // renderPage dispatches to the appropriate page renderer. func renderPage(page string, opts HandlerOptions) string { var pageID, title, body string switch page { case "dashboard", "": pageID = "dashboard" title = "Dashboard" body = renderDashboard(opts) case "audit": pageID = "audit" title = "1. Audit" body = renderAudit() case "check": pageID = "check" title = "2. Check" body = renderCheck(opts) case "load": pageID = "load" title = "3. Load" body = renderValidateStress(opts) case "burn": pageID = "burn" title = "4. Burn" body = renderBurn() case "benchmark": pageID = "benchmark" title = "5. Benchmark" body = renderBenchmark(opts) case "tools": pageID = "tools" title = "Tools" body = renderTools() case "settings": pageID = "settings" title = "Settings" body = renderSettings(opts) // Legacy routes (redirected at HTTP level in handlePage; these are fallbacks) case "validate", "tests": pageID = "load" title = "3. Load" body = renderValidate(opts) case "burn-in": pageID = "burn" title = "4. Burn" body = renderBurn() case "speed", "endurance": pageID = "benchmark" title = "5. Benchmark" body = renderBenchmark(opts) case "tasks": pageID = "tasks" title = "Tasks" body = renderTasks() // Hidden pages (not in nav, accessible by direct URL) case "metrics": pageID = "metrics" title = "Live Metrics" body = renderMetrics() case "network": pageID = "network" title = "Network" body = renderNetwork() case "services": pageID = "services" title = "Services" body = renderServices() case "export": pageID = "export" title = "Export" body = renderExport(opts.ExportDir) case "install": pageID = "install" title = "Install to Disk" body = renderInstall() default: pageID = "dashboard" title = "Not Found" body = `