dashboard.go 1.5 KB

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