{% import ( "strings" "net/http" "path" "github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils" ) %} {% func Header(r *http.Request, navItems []NavItem, title string) %} {%code prefix := utils.Prefix(r.URL.Path) %} vmalert{% if title != "" %} - {%s title %}{% endif %} {%= printNavItems(r, title, navItems) %}
{% endfunc %} {% code type NavItem struct { Name string Url string } %} {% func printNavItems(r *http.Request, current string, items []NavItem) %} {%code prefix := "/vmalert/" if strings.HasPrefix(r.URL.Path, prefix) { prefix = "" } %} {% endfunc %}