dashboard.go 1.6 KB

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