dashboard.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. }
  30. type DashboardFullWithMeta struct {
  31. Meta DashboardMeta `json:"meta"`
  32. Dashboard *simplejson.Json `json:"dashboard"`
  33. }
  34. type DashboardRedirect struct {
  35. RedirectUri string `json:"redirectUri"`
  36. }
  37. type CalculateDiffOptions struct {
  38. Base CalculateDiffTarget `json:"base" binding:"Required"`
  39. New CalculateDiffTarget `json:"new" binding:"Required"`
  40. DiffType string `json:"diffType" binding:"Required"`
  41. }
  42. type CalculateDiffTarget struct {
  43. DashboardId int64 `json:"dashboardId"`
  44. Version int `json:"version"`
  45. UnsavedDashboard *simplejson.Json `json:"unsavedDashboard"`
  46. }
  47. type RestoreDashboardVersionCommand struct {
  48. Version int `json:"version" binding:"Required"`
  49. }