dashboard.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. Expires time.Time `json:"expires"`
  17. Created time.Time `json:"created"`
  18. Updated time.Time `json:"updated"`
  19. UpdatedBy string `json:"updatedBy"`
  20. CreatedBy string `json:"createdBy"`
  21. Version int `json:"version"`
  22. HasAcl bool `json:"hasAcl"`
  23. IsFolder bool `json:"isFolder"`
  24. FolderId int64 `json:"folderId"`
  25. FolderTitle string `json:"folderTitle"`
  26. FolderSlug string `json:"folderSlug"`
  27. }
  28. type DashboardFullWithMeta struct {
  29. Meta DashboardMeta `json:"meta"`
  30. Dashboard *simplejson.Json `json:"dashboard"`
  31. }
  32. type DashboardRedirect struct {
  33. RedirectUri string `json:"redirectUri"`
  34. }
  35. type CalculateDiffOptions struct {
  36. Base CalculateDiffTarget `json:"base" binding:"Required"`
  37. New CalculateDiffTarget `json:"new" binding:"Required"`
  38. DiffType string `json:"diffType" binding:"Required"`
  39. }
  40. type CalculateDiffTarget struct {
  41. DashboardId int64 `json:"dashboardId"`
  42. Version int `json:"version"`
  43. UnsavedDashboard *simplejson.Json `json:"unsavedDashboard"`
  44. }
  45. type RestoreDashboardVersionCommand struct {
  46. Version int `json:"version" binding:"Required"`
  47. }