* Public dashboard query API * Create new API on service for building metric request * Flesh out testing, implement BuildPublicDashboardMetricRequest * Test for errors and missing panels * WIP: Test for multiple datasources * Refactor tests, add supporting code for multiple datasources * Gets the panel data from the pubdash query api * Adds tests to make sure we get the correct api url from retrieving panel data * Public dashboard query API * Create new API on service for building metric request * Flesh out testing, implement BuildPublicDashboardMetricRequest * Test for errors and missing panels * WIP: Test for multiple datasources * Refactor tests, add supporting code for multiple datasources * Handle queries from multiple datasources * Replace dashboard time range with pubdash time range settings * Fix comments from review, build failure * removes changes to DataSourceWithBackend.ts regarding getting the pubdash panel query url. Going to do this in a new class, PublicDashboardDataSource.ts * Include pubdash Uid in dashboard meta * Creates new PublicDashboardDataSource.ts and adds test * Passes pubdash uid down to PanelQueryRunner.ts to a PublicDashboardDatasource can be chosen when were looking at a public dashboard * removes comment * checks for error when unmarshalling json * Only replace dashboard time settings with pubdash time settings when pubdash time settings exist * formatting and added comment Co-authored-by: Jesse Weaver <jesse.weaver@grafana.com> Co-authored-by: Jeff Levin <jeff@levinology.com>
79 lines
3.1 KiB
Go
79 lines
3.1 KiB
Go
package dtos
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
|
)
|
|
|
|
type DashboardMeta struct {
|
|
IsStarred bool `json:"isStarred,omitempty"`
|
|
IsHome bool `json:"isHome,omitempty"`
|
|
IsSnapshot bool `json:"isSnapshot,omitempty"`
|
|
Type string `json:"type,omitempty"`
|
|
CanSave bool `json:"canSave"`
|
|
CanEdit bool `json:"canEdit"`
|
|
CanAdmin bool `json:"canAdmin"`
|
|
CanStar bool `json:"canStar"`
|
|
CanDelete bool `json:"canDelete"`
|
|
Slug string `json:"slug"`
|
|
Url string `json:"url"`
|
|
Expires time.Time `json:"expires"`
|
|
Created time.Time `json:"created"`
|
|
Updated time.Time `json:"updated"`
|
|
UpdatedBy string `json:"updatedBy"`
|
|
CreatedBy string `json:"createdBy"`
|
|
Version int `json:"version"`
|
|
HasAcl bool `json:"hasAcl"`
|
|
IsFolder bool `json:"isFolder"`
|
|
FolderId int64 `json:"folderId"`
|
|
FolderUid string `json:"folderUid"`
|
|
FolderTitle string `json:"folderTitle"`
|
|
FolderUrl string `json:"folderUrl"`
|
|
Provisioned bool `json:"provisioned"`
|
|
ProvisionedExternalId string `json:"provisionedExternalId"`
|
|
AnnotationsPermissions *AnnotationPermission `json:"annotationsPermissions"`
|
|
IsPublic bool `json:"isPublic"`
|
|
PublicDashboardUid string `json:"publicDashboardUid"`
|
|
}
|
|
type AnnotationPermission struct {
|
|
Dashboard AnnotationActions `json:"dashboard"`
|
|
Organization AnnotationActions `json:"organization"`
|
|
}
|
|
|
|
type AnnotationActions struct {
|
|
CanAdd bool `json:"canAdd"`
|
|
CanEdit bool `json:"canEdit"`
|
|
CanDelete bool `json:"canDelete"`
|
|
}
|
|
|
|
type DashboardFullWithMeta struct {
|
|
Meta DashboardMeta `json:"meta"`
|
|
Dashboard *simplejson.Json `json:"dashboard"`
|
|
}
|
|
|
|
type TrimDashboardFullWithMeta struct {
|
|
Meta *simplejson.Json `json:"meta"`
|
|
Dashboard *simplejson.Json `json:"dashboard"`
|
|
}
|
|
|
|
type DashboardRedirect struct {
|
|
RedirectUri string `json:"redirectUri"`
|
|
}
|
|
|
|
type CalculateDiffOptions struct {
|
|
Base CalculateDiffTarget `json:"base" binding:"Required"`
|
|
New CalculateDiffTarget `json:"new" binding:"Required"`
|
|
DiffType string `json:"diffType" binding:"Required"`
|
|
}
|
|
|
|
type CalculateDiffTarget struct {
|
|
DashboardId int64 `json:"dashboardId"`
|
|
Version int `json:"version"`
|
|
UnsavedDashboard *simplejson.Json `json:"unsavedDashboard"`
|
|
}
|
|
|
|
type RestoreDashboardVersionCommand struct {
|
|
Version int `json:"version" binding:"Required"`
|
|
}
|