package components import "fmt" // Layout is the base HTML layout for the admin panel templ Layout(title string, username string) { { title } { children... } } // Header renders the admin header with navigation templ Header(username string) {

ZFS Backup

Admin Panel

{ username }
} // StatsCard renders a single statistics card templ StatsCard(title string, value string) {
{ title }
{ value }
} // statsIcon returns the Font Awesome icon for a stats card func statsIcon(title string) string { switch title { case "Clients": return "fa-users" case "Total Snapshots": return "fa-camera" case "Total Storage": return "fa-hard-drive" default: return "fa-chart-bar" } } // TabButton renders a tab navigation button templ TabButton(id string, label string, active bool) { } // tabIcon returns the Font Awesome icon for a tab func tabIcon(id string) string { switch id { case "clients": return "fa-users" case "snapshots": return "fa-images" case "admins": return "fa-user-shield" default: return "fa-folder" } } // tabButtonClass returns the CSS class for a tab button func tabButtonClass(active bool) string { if active { return "bg-primary text-white shadow-lg shadow-primary/25" } return "bg-surface text-gray-400 hover:bg-surface-lighter hover:text-white" } // Modal renders a modal dialog templ Modal(id string, title string) { } // FormInput renders a form input field templ FormInput(id string, label string, inputType string, placeholder string, required bool) {
} // FormSelect renders a form select field templ FormSelect(id string, label string, options []SelectOption) {
} // SelectOption represents an option in a select field type SelectOption struct { Value string Label string Selected bool } // FormCheckbox renders a form checkbox templ FormCheckbox(id string, label string, checked bool) {
} // Button renders a styled button templ Button(label string, variant string) { } // buttonVariantClass returns the CSS class for a button variant func buttonVariantClass(variant string) string { switch variant { case "primary": return "bg-primary hover:bg-primary-dark text-white shadow-lg shadow-primary/25" case "danger": return "bg-red-500 hover:bg-red-600 text-white shadow-lg shadow-red-500/25" case "success": return "bg-emerald-500 hover:bg-emerald-600 text-white shadow-lg shadow-emerald-500/25" case "warning": return "bg-amber-500 hover:bg-amber-600 text-white shadow-lg shadow-amber-500/25" case "purple": return "bg-purple-500 hover:bg-purple-600 text-white shadow-lg shadow-purple-500/25" case "orange": return "bg-orange-500 hover:bg-orange-600 text-white shadow-lg shadow-orange-500/25" default: return "bg-gray-500 hover:bg-gray-600 text-white" } } // Badge renders a status badge templ Badge(text string, variant string) { { text } } // badgeVariantClass returns the CSS class for a badge variant func badgeVariantClass(variant string) string { switch variant { case "success": return "bg-emerald-500/20 text-emerald-400" case "danger": return "bg-red-500/20 text-red-400" case "info": return "bg-blue-500/20 text-blue-400" case "warning": return "bg-amber-500/20 text-amber-400" default: return "bg-gray-500/20 text-gray-400" } } // ProgressBar renders a progress bar templ ProgressBar(percent float64) {
}