package layout import ( "fmt" "strings" "time" "github.com/gin-gonic/gin" "github.com/seaweedfs/seaweedfs/weed/util/version" ) templ Layout(c *gin.Context, content templ.Component) { {{ username := c.GetString("username") if username == "" { username = "admin" } csrfToken := c.GetString("csrf_token") currentPath := c.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 plugin page. isPluginPage := strings.HasPrefix(currentPath, "/plugin") // 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")) }} SeaweedFS Admin
@content
} templ LoginForm(c *gin.Context, title string, errorMessage string) { {title} - Login

{title}

Please sign in to continue

if errorMessage != "" { }
}