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.
2022-03-17 12:07:20 +00:00
WeightSavedItems = ( iota - 20 ) * 100
2021-11-02 11:19:18 +00:00
WeightCreate
2019-11-15 09:28:55 +01:00
WeightDashboard
WeightExplore
WeightAlerting
2022-06-10 12:13:31 +02:00
WeightDataConnections
2019-11-15 09:28:55 +01:00
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-04-12 14:51:40 +01:00
Id string ` json:"id,omitempty" `
Text string ` json:"text" `
Description string ` json:"description,omitempty" `
Section string ` json:"section,omitempty" `
SubTitle string ` json:"subTitle,omitempty" `
2022-06-10 12:13:31 +02:00
Icon string ` json:"icon,omitempty" ` // Available icons can be browsed in Storybook: https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview
2022-04-12 14:51:40 +01:00
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" `
ShowIconInNavbar bool ` json:"showIconInNavbar,omitempty" `
2022-09-01 10:28:50 +01:00
RoundIcon bool ` json:"roundIcon,omitempty" `
2022-04-12 14:51:40 +01:00
Children [ ] * NavLink ` json:"children,omitempty" `
HighlightText string ` json:"highlightText,omitempty" `
HighlightID string ` json:"highlightId,omitempty" `
2022-06-27 15:41:00 +01:00
EmptyMessageId string ` json:"emptyMessageId,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"