Files
grafana/pkg/api/dtos/prefs.go
ying-jeanne 1667a7c0da Chore: Modify patch and update of preference to take homedashboarduid than h… (#48281)
* modify patch and update of preference to take homedashboarduid than homedashboardid

* to be tested

* use getdashboard

* update doc
2022-04-29 14:37:33 +02:00

47 lines
1.8 KiB
Go

package dtos
import (
"github.com/grafana/grafana/pkg/models"
pref "github.com/grafana/grafana/pkg/services/preference"
)
type Prefs struct {
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"`
}
// swagger:model
type UpdatePrefsCmd struct {
// Enum: light,dark
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"`
Navbar *models.NavbarPreference `json:"navbar,omitempty"`
QueryHistory *models.QueryHistoryPreference `json:"queryHistory,omitempty"`
}
// 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"`
Navbar *pref.NavbarPreference `json:"navbar,omitempty"`
QueryHistory *pref.QueryHistoryPreference `json:"queryHistory,omitempty"`
HomeDashboardUID *string `json:"homeDashboardUID,omitempty"`
}