dashboard.go 1.4 KB

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