dashboard.go 1.6 KB

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