The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/preference/themes.go

34 lines
613 B

package pref
type ThemeDTO struct {
ID string `json:"id"`
Type string `json:"type"`
IsExtra bool `json:"isExtra"`
}
var themes = []ThemeDTO{
{ID: "light", Type: "light"},
{ID: "dark", Type: "dark"},
{ID: "system", Type: "dark"},
{ID: "midnight", Type: "dark", IsExtra: true},
{ID: "blue-night", Type: "dark", IsExtra: true},
}
func GetThemeByID(id string) *ThemeDTO {
for _, theme := range themes {
if theme.ID == id {
return &theme
}
}
return nil
}
func IsValidThemeID(id string) bool {
for _, theme := range themes {
if theme.ID == id {
return true
}
}
return false
}