dashboard.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package dtos
  2. import (
  3. "time"
  4. "github.com/grafana/grafana/pkg/components/simplejson"
  5. )
  6. type DashboardMeta struct {
  7. IsStarred bool `json:"isStarred,omitempty"`
  8. IsHome bool `json:"isHome,omitempty"`
  9. IsSnapshot bool `json:"isSnapshot,omitempty"`
  10. Type string `json:"type,omitempty"`
  11. CanSave bool `json:"canSave"`
  12. CanEdit bool `json:"canEdit"`
  13. CanAdmin bool `json:"canAdmin"`
  14. CanStar bool `json:"canStar"`
  15. Slug string `json:"slug"`
  16. Url string `json:"url"`
  17. Expires time.Time `json:"expires"`
  18. Created time.Time `json:"created"`
  19. Updated time.Time `json:"updated"`
  20. UpdatedBy string `json:"updatedBy"`
  21. CreatedBy string `json:"createdBy"`
  22. Version int `json:"version"`
  23. HasAcl bool `json:"hasAcl"`
  24. IsFolder bool `json:"isFolder"`
  25. FolderId int64 `json:"folderId"`
  26. FolderTitle string `json:"folderTitle"`
  27. FolderUrl string `json:"folderUrl"`
  28. Provisioned bool `json:"provisioned"`
  29. ProvisionedExternalId string `json:"provisionedExternalId"`
  30. }
  31. type DashboardFullWithMeta struct {
  32. Meta DashboardMeta `json:"meta"`
  33. Dashboard *simplejson.Json `json:"dashboard"`
  34. }
  35. type DashboardRedirect struct {
  36. RedirectUri string `json:"redirectUri"`
  37. }
  38. type CalculateDiffOptions struct {
  39. Base CalculateDiffTarget `json:"base" binding:"Required"`
  40. New CalculateDiffTarget `json:"new" binding:"Required"`
  41. DiffType string `json:"diffType" binding:"Required"`
  42. }
  43. type CalculateDiffTarget struct {
  44. DashboardId int64 `json:"dashboardId"`
  45. Version int `json:"version"`
  46. UnsavedDashboard *simplejson.Json `json:"unsavedDashboard"`
  47. }
  48. type RestoreDashboardVersionCommand struct {
  49. Version int `json:"version" binding:"Required"`
  50. }