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" } // Detect if we're on a configuration page to keep submenu expanded currentPath := c.Request.URL.Path isConfigPage := strings.HasPrefix(currentPath, "/maintenance/config") || currentPath == "/config" // 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")) }}
Please sign in to continue