dashboard.go 1.7 KB

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