mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 04:34:23 -06:00
9a85a2e441
* Feature Flags: introduce a flag for enabling the Data Connections page * Feature Flags: generate schemas * Navigation: add navigation weight for the Data Connections page * NavLink: add a comment pointing out where icon names can be looked up * NavTree: add a new page called Data Connections * fix(Api): prefix the navigation IDs with the parent ("data-connections") * feat(Frontend): add a basic page with four tabs * feat(Plugins): add a hook for importing an app plugin * feat(Plugins): add a component for loading app plugins anywhere * feat(Data Connections): load the cloud-onboarding app under the "Cloud onboarding" tab * feat(Data Connections): generate a proper nav model to highlight active tabs * test(Data Connections): add tests * refactor(Data Connections): update temporary text content This is only used as a placeholder until the tabs are under development. * refactor(Data Cnnnections): move /pages to /tabs * refactor(Data Connections): remove the `types.ts` file as it is not referenced by any module * feat(Data Connections): only register routes if feature is enabled
81 lines
2.6 KiB
Go
81 lines
2.6 KiB
Go
package dtos
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
|
|
"html/template"
|
|
)
|
|
|
|
type IndexViewData struct {
|
|
User *CurrentUser
|
|
Settings map[string]interface{}
|
|
AppUrl string
|
|
AppSubUrl string
|
|
GoogleAnalyticsId string
|
|
GoogleTagManagerId string
|
|
NavTree []*NavLink
|
|
BuildVersion string
|
|
BuildCommit string
|
|
Theme string
|
|
NewGrafanaVersionExists bool
|
|
NewGrafanaVersion string
|
|
AppName string
|
|
AppNameBodyClass string
|
|
FavIcon template.URL
|
|
AppleTouchIcon template.URL
|
|
AppTitle string
|
|
Sentry *setting.Sentry
|
|
ContentDeliveryURL string
|
|
LoadingLogo template.URL
|
|
// Nonce is a cryptographic identifier for use with Content Security Policy.
|
|
Nonce string
|
|
}
|
|
|
|
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.
|
|
|
|
WeightSavedItems = (iota - 20) * 100
|
|
WeightCreate
|
|
WeightDashboard
|
|
WeightExplore
|
|
WeightAlerting
|
|
WeightDataConnections
|
|
WeightPlugin
|
|
WeightConfig
|
|
WeightAdmin
|
|
WeightProfile
|
|
WeightHelp
|
|
)
|
|
|
|
const (
|
|
NavSectionCore string = "core"
|
|
NavSectionPlugin string = "plugin"
|
|
NavSectionConfig string = "config"
|
|
)
|
|
|
|
type NavLink struct {
|
|
Id string `json:"id,omitempty"`
|
|
Text string `json:"text"`
|
|
Description string `json:"description,omitempty"`
|
|
Section string `json:"section,omitempty"`
|
|
SubTitle string `json:"subTitle,omitempty"`
|
|
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
|
|
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"`
|
|
Children []*NavLink `json:"children,omitempty"`
|
|
HighlightText string `json:"highlightText,omitempty"`
|
|
HighlightID string `json:"highlightId,omitempty"`
|
|
}
|
|
|
|
// NavIDCfg is the id for org configuration navigation node
|
|
const NavIDCfg = "cfg"
|