2016-03-16 05:49:52 +08:00
|
|
|
package dtos
|
|
|
|
|
|
2022-04-21 21:03:17 +08:00
|
|
|
import (
|
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
|
|
|
pref "github.com/grafana/grafana/pkg/services/preference"
|
|
|
|
|
)
|
2022-03-17 20:07:20 +08:00
|
|
|
|
2016-04-03 04:54:06 +08:00
|
|
|
type Prefs struct {
|
2022-04-29 20:37:33 +08:00
|
|
|
Theme string `json:"theme"`
|
|
|
|
|
HomeDashboardID int64 `json:"homeDashboardId"`
|
|
|
|
|
HomeDashboardUID string `json:"homeDashboardUID,omitempty"`
|
|
|
|
|
Timezone string `json:"timezone"`
|
|
|
|
|
WeekStart string `json:"weekStart"`
|
|
|
|
|
Navbar pref.NavbarPreference `json:"navbar,omitempty"`
|
|
|
|
|
QueryHistory pref.QueryHistoryPreference `json:"queryHistory,omitempty"`
|
2016-04-02 08:34:30 +08:00
|
|
|
}
|
|
|
|
|
|
2022-02-08 20:38:43 +08:00
|
|
|
// swagger:model
|
2016-04-03 04:54:06 +08:00
|
|
|
type UpdatePrefsCmd struct {
|
2022-02-08 20:38:43 +08:00
|
|
|
// Enum: light,dark
|
|
|
|
|
Theme string `json:"theme"`
|
|
|
|
|
// The numerical :id of a favorited dashboard
|
|
|
|
|
// Default:0
|
2022-04-29 20:37:33 +08:00
|
|
|
HomeDashboardID int64 `json:"homeDashboardId"`
|
|
|
|
|
HomeDashboardUID *string `json:"homeDashboardUID,omitempty"`
|
2022-02-08 20:38:43 +08:00
|
|
|
// Enum: utc,browser
|
2022-04-12 17:42:42 +08:00
|
|
|
Timezone string `json:"timezone"`
|
|
|
|
|
WeekStart string `json:"weekStart"`
|
|
|
|
|
Navbar *models.NavbarPreference `json:"navbar,omitempty"`
|
|
|
|
|
QueryHistory *models.QueryHistoryPreference `json:"queryHistory,omitempty"`
|
2022-03-17 20:07:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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
|
2022-04-29 20:37:33 +08:00
|
|
|
Timezone *string `json:"timezone,omitempty"`
|
|
|
|
|
WeekStart *string `json:"weekStart,omitempty"`
|
|
|
|
|
Navbar *pref.NavbarPreference `json:"navbar,omitempty"`
|
|
|
|
|
QueryHistory *pref.QueryHistoryPreference `json:"queryHistory,omitempty"`
|
|
|
|
|
HomeDashboardUID *string `json:"homeDashboardUID,omitempty"`
|
2016-03-16 05:49:52 +08:00
|
|
|
}
|