2015-11-20 09:43:10 +01:00
|
|
|
package dtos
|
|
|
|
|
|
2020-12-07 12:23:53 +02:00
|
|
|
import (
|
|
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
|
|
|
|
|
|
|
|
"html/template"
|
|
|
|
|
)
|
2020-11-12 13:29:43 +02:00
|
|
|
|
2015-11-20 09:43:10 +01:00
|
|
|
type IndexViewData struct {
|
2016-05-03 09:00:58 +02:00
|
|
|
User *CurrentUser
|
|
|
|
|
Settings map[string]interface{}
|
|
|
|
|
AppUrl string
|
|
|
|
|
AppSubUrl string
|
|
|
|
|
GoogleAnalyticsId string
|
|
|
|
|
GoogleTagManagerId string
|
2017-08-15 17:52:52 +02:00
|
|
|
NavTree []*NavLink
|
2016-05-03 09:00:58 +02:00
|
|
|
BuildVersion string
|
|
|
|
|
BuildCommit string
|
2017-10-11 21:36:03 +02:00
|
|
|
Theme string
|
2016-05-03 09:00:58 +02:00
|
|
|
NewGrafanaVersionExists bool
|
|
|
|
|
NewGrafanaVersion string
|
2018-07-02 04:33:39 -07:00
|
|
|
AppName string
|
2018-10-31 13:40:58 -07:00
|
|
|
AppNameBodyClass string
|
2020-12-07 12:23:53 +02:00
|
|
|
FavIcon template.URL
|
|
|
|
|
AppleTouchIcon template.URL
|
2020-02-25 15:18:37 +01:00
|
|
|
AppTitle string
|
2020-11-12 13:29:43 +02:00
|
|
|
Sentry *setting.Sentry
|
2021-02-01 10:13:09 +01:00
|
|
|
ContentDeliveryURL string
|
2021-07-02 14:17:10 +02:00
|
|
|
LoadingLogo template.URL
|
2021-01-12 07:42:32 +01:00
|
|
|
// Nonce is a cryptographic identifier for use with Content Security Policy.
|
|
|
|
|
Nonce string
|
2015-11-20 09:43:10 +01:00
|
|
|
}
|
|
|
|
|
|
2019-11-15 09:28:55 +01:00
|
|
|
const (
|
|
|
|
|
// These weights may be used by an extension to reliably place
|
|
|
|
|
// itself in relation to a particular item in the menu. The weights
|
|
|
|
|
// are negative to ensure that the default items are placed above
|
|
|
|
|
// any items with default weight.
|
|
|
|
|
|
2021-11-02 11:19:18 +00:00
|
|
|
WeightHome = (iota - 20) * 100
|
|
|
|
|
WeightCreate
|
2019-11-15 09:28:55 +01:00
|
|
|
WeightDashboard
|
|
|
|
|
WeightExplore
|
|
|
|
|
WeightAlerting
|
|
|
|
|
WeightPlugin
|
|
|
|
|
WeightConfig
|
|
|
|
|
WeightAdmin
|
2021-11-02 11:19:18 +00:00
|
|
|
WeightProfile
|
2019-11-15 09:28:55 +01:00
|
|
|
WeightHelp
|
|
|
|
|
)
|
|
|
|
|
|
2021-11-02 11:19:18 +00:00
|
|
|
const (
|
|
|
|
|
NavSectionCore string = "core"
|
|
|
|
|
NavSectionPlugin string = "plugin"
|
|
|
|
|
NavSectionConfig string = "config"
|
|
|
|
|
)
|
|
|
|
|
|
2015-11-20 09:43:10 +01:00
|
|
|
type NavLink struct {
|
2022-01-25 10:04:44 +02:00
|
|
|
Id string `json:"id,omitempty"`
|
|
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
|
Section string `json:"section,omitempty"`
|
|
|
|
|
SubTitle string `json:"subTitle,omitempty"`
|
|
|
|
|
Icon string `json:"icon,omitempty"`
|
|
|
|
|
Img string `json:"img,omitempty"`
|
|
|
|
|
Url string `json:"url,omitempty"`
|
|
|
|
|
Target string `json:"target,omitempty"`
|
|
|
|
|
SortWeight int64 `json:"sortWeight,omitempty"`
|
|
|
|
|
Divider bool `json:"divider,omitempty"`
|
|
|
|
|
HideFromMenu bool `json:"hideFromMenu,omitempty"`
|
|
|
|
|
HideFromTabs bool `json:"hideFromTabs,omitempty"`
|
|
|
|
|
Children []*NavLink `json:"children,omitempty"`
|
|
|
|
|
HighlightText string `json:"highlightText,omitempty"`
|
2022-02-17 14:20:37 +01:00
|
|
|
HighlightID string `json:"highlightId,omitempty"`
|
2015-11-20 09:43:10 +01:00
|
|
|
}
|
2021-02-20 09:02:06 +01:00
|
|
|
|
|
|
|
|
// NavIDCfg is the id for org configuration navigation node
|
|
|
|
|
const NavIDCfg = "cfg"
|