package webui import ( "fmt" "html" "net/url" "os" "path/filepath" "sort" "strings" ) func renderExport(exportDir string) string { entries, _ := listExportFiles(exportDir) var rows strings.Builder for _, e := range entries { rows.WriteString(fmt.Sprintf(`%s`, url.QueryEscape(e), html.EscapeString(e))) } if len(entries) == 0 { rows.WriteString(`No export files found.`) } return `
Support Bundle

Creates a tar.gz archive of all audit files, SAT results, and logs.

` + renderSupportBundleInline() + `
Export Files
` + rows.String() + `
File
` + renderUSBExportCard() } func listExportFiles(exportDir string) ([]string, error) { var entries []string err := filepath.Walk(strings.TrimSpace(exportDir), func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { return nil } rel, err := filepath.Rel(exportDir, path) if err != nil { return err } entries = append(entries, rel) return nil }) if err != nil && !os.IsNotExist(err) { return nil, err } sort.Strings(entries) return entries, nil } func renderSupportBundleInline() string { return `
` } func renderUSBExportCard() string { return `
Export to USB
` + renderUSBExportInline() + `
` } func renderUSBExportInline() string { return `

Write audit JSON or support bundle directly to a removable USB drive.

Scanning for USB devices...
` } func renderNvidiaSelfHealInline() string { return `

Inspect NVIDIA GPU health, restart the bee-nvidia driver service, and issue a per-GPU reset when the driver reports reset required.

Loading NVIDIA GPU status...

Loading...

` } func renderTools() string { return `
System Install
Install to RAM

Detecting boot source...

Checking...

Install to Disk
` + renderInstallInline() + `
Support Bundle

Downloads a tar.gz archive of all audit files, SAT results, and logs.

` + renderSupportBundleInline() + `
Export to USB
` + renderUSBExportInline() + `
Tool Check

Checking...

NVIDIA Self Heal
` + renderNvidiaSelfHealInline() + `
Network
` + renderNetworkInline() + `
Services
` + renderServicesInline() + `
` } func renderExportIndex(exportDir string) (string, error) { entries, err := listExportFiles(exportDir) if err != nil { return "", err } var body strings.Builder body.WriteString(`Bee Export Files`) body.WriteString(`

Bee Export Files

`) return body.String(), nil }