dashboard.go 1.5 KB

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