grafana/pkg/api/dtos/prefs.go
Josh Hunt d51e7ec7ef
Preferences: Add theme preference to match system theme (#61986)
* user essentials mob! 🔱

lastFile:pkg/api/preferences.go

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:packages/grafana-data/src/types/config.ts

* user essentials mob! 🔱

lastFile:public/app/core/services/echo/utils.test.ts

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:public/views/index-template.html

* user essentials mob! 🔱

* Restore currentUser.lightTheme for backwards compat

* fix types

* Apply suggestions from code review

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* cleanup

* cleanup

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-01-30 10:51:51 +01:00

36 lines
1.3 KiB
Go

package dtos
import (
pref "github.com/grafana/grafana/pkg/services/preference"
)
// swagger:model
type UpdatePrefsCmd struct {
// Enum: light,dark,system
Theme string `json:"theme"`
// The numerical :id of a favorited dashboard
// Default:0
HomeDashboardID int64 `json:"homeDashboardId"`
HomeDashboardUID *string `json:"homeDashboardUID,omitempty"`
// Enum: utc,browser
Timezone string `json:"timezone"`
WeekStart string `json:"weekStart"`
QueryHistory *pref.QueryHistoryPreference `json:"queryHistory,omitempty"`
Language string `json:"language"`
}
// swagger:model
type PatchPrefsCmd struct {
// Enum: light,dark
Theme *string `json:"theme,omitempty"`
// The numerical :id of a favorited dashboard
// Default:0
HomeDashboardID *int64 `json:"homeDashboardId,omitempty"`
// Enum: utc,browser
Timezone *string `json:"timezone,omitempty"`
WeekStart *string `json:"weekStart,omitempty"`
Language *string `json:"language,omitempty"`
QueryHistory *pref.QueryHistoryPreference `json:"queryHistory,omitempty"`
HomeDashboardUID *string `json:"homeDashboardUID,omitempty"`
}