package layout import ( "fmt" "strings" "time" "github.com/seaweedfs/seaweedfs/weed/admin/dash" "github.com/seaweedfs/seaweedfs/weed/util/version" ) script setBasePath(prefix string) { window.__BASE_PATH__ = prefix; } templ Layout(view ViewContext, content templ.Component) { {{ username := view.Username if username == "" { username = "unknown" } csrfToken := view.CSRFToken currentPath := "" if view.Request != nil { currentPath = view.Request.URL.Path } // Detect if we're on a message queue page to keep submenu expanded isMQPage := strings.HasPrefix(currentPath, "/mq/") // Detect if we're on a storage page to keep submenu expanded isStoragePage := strings.HasPrefix(currentPath, "/storage/volumes") || strings.HasPrefix(currentPath, "/storage/ec-shards") || strings.HasPrefix(currentPath, "/storage/collections") // Detect if we're on a cluster page (but not storage page) to keep submenu expanded isClusterPage := (strings.HasPrefix(currentPath, "/cluster/masters") || strings.HasPrefix(currentPath, "/cluster/volume-servers") || strings.HasPrefix(currentPath, "/cluster/filers")) isDefaultWorkerPage := currentPath == "/plugin" || strings.HasPrefix(currentPath, "/plugin/configuration") || strings.HasPrefix(currentPath, "/plugin/detection") || strings.HasPrefix(currentPath, "/plugin/queue") || strings.HasPrefix(currentPath, "/plugin/execution") || strings.HasPrefix(currentPath, "/plugin/monitoring") || currentPath == "/plugin/lanes/default" || strings.HasPrefix(currentPath, "/plugin/lanes/default/") isIcebergWorkerPage := currentPath == "/plugin/lanes/iceberg" || strings.HasPrefix(currentPath, "/plugin/lanes/iceberg/") isLifecycleWorkerPage := currentPath == "/plugin/lanes/lifecycle" || strings.HasPrefix(currentPath, "/plugin/lanes/lifecycle/") }} SeaweedFS Admin @setBasePath(view.URLPrefix)
@content
} templ LoginForm(title string, errorMessage string, csrfToken string) { {{ prefix := dash.URLPrefixFromContext(ctx) }} {title} - Login

{title}

Please sign in to continue

if errorMessage != "" { }
}