|
|
@@ -10,25 +10,25 @@ import (
|
|
|
)
|
|
|
|
|
|
type DashboardsAsConfig struct {
|
|
|
- Name string
|
|
|
- Type string
|
|
|
- OrgId int64
|
|
|
- Folder string
|
|
|
- Editable bool
|
|
|
- Options map[string]interface{}
|
|
|
- DisableDeletion bool
|
|
|
- IntervalSeconds int64
|
|
|
+ Name string
|
|
|
+ Type string
|
|
|
+ OrgId int64
|
|
|
+ Folder string
|
|
|
+ Editable bool
|
|
|
+ Options map[string]interface{}
|
|
|
+ DisableDeletion bool
|
|
|
+ UpdateIntervalSeconds int64
|
|
|
}
|
|
|
|
|
|
type DashboardsAsConfigV0 struct {
|
|
|
- Name string `json:"name" yaml:"name"`
|
|
|
- Type string `json:"type" yaml:"type"`
|
|
|
- OrgId int64 `json:"org_id" yaml:"org_id"`
|
|
|
- Folder string `json:"folder" yaml:"folder"`
|
|
|
- Editable bool `json:"editable" yaml:"editable"`
|
|
|
- Options map[string]interface{} `json:"options" yaml:"options"`
|
|
|
- DisableDeletion bool `json:"disableDeletion" yaml:"disableDeletion"`
|
|
|
- IntervalSeconds int64 `json:"intervalSeconds" yaml:"intervalSeconds"`
|
|
|
+ Name string `json:"name" yaml:"name"`
|
|
|
+ Type string `json:"type" yaml:"type"`
|
|
|
+ OrgId int64 `json:"org_id" yaml:"org_id"`
|
|
|
+ Folder string `json:"folder" yaml:"folder"`
|
|
|
+ Editable bool `json:"editable" yaml:"editable"`
|
|
|
+ Options map[string]interface{} `json:"options" yaml:"options"`
|
|
|
+ DisableDeletion bool `json:"disableDeletion" yaml:"disableDeletion"`
|
|
|
+ UpdateIntervalSeconds int64 `json:"updateIntervalSeconds" yaml:"updateIntervalSeconds"`
|
|
|
}
|
|
|
|
|
|
type ConfigVersion struct {
|
|
|
@@ -40,14 +40,14 @@ type DashboardAsConfigV1 struct {
|
|
|
}
|
|
|
|
|
|
type DashboardProviderConfigs struct {
|
|
|
- Name string `json:"name" yaml:"name"`
|
|
|
- Type string `json:"type" yaml:"type"`
|
|
|
- OrgId int64 `json:"orgId" yaml:"orgId"`
|
|
|
- Folder string `json:"folder" yaml:"folder"`
|
|
|
- Editable bool `json:"editable" yaml:"editable"`
|
|
|
- Options map[string]interface{} `json:"options" yaml:"options"`
|
|
|
- DisableDeletion bool `json:"disableDeletion" yaml:"disableDeletion"`
|
|
|
- IntervalSeconds int64 `json:"intervalSeconds" yaml:"intervalSeconds"`
|
|
|
+ Name string `json:"name" yaml:"name"`
|
|
|
+ Type string `json:"type" yaml:"type"`
|
|
|
+ OrgId int64 `json:"orgId" yaml:"orgId"`
|
|
|
+ Folder string `json:"folder" yaml:"folder"`
|
|
|
+ Editable bool `json:"editable" yaml:"editable"`
|
|
|
+ Options map[string]interface{} `json:"options" yaml:"options"`
|
|
|
+ DisableDeletion bool `json:"disableDeletion" yaml:"disableDeletion"`
|
|
|
+ UpdateIntervalSeconds int64 `json:"updateIntervalSeconds" yaml:"updateIntervalSeconds"`
|
|
|
}
|
|
|
|
|
|
func createDashboardJson(data *simplejson.Json, lastModified time.Time, cfg *DashboardsAsConfig, folderId int64) (*dashboards.SaveDashboardDTO, error) {
|
|
|
@@ -71,14 +71,14 @@ func mapV0ToDashboardAsConfig(v0 []*DashboardsAsConfigV0) []*DashboardsAsConfig
|
|
|
|
|
|
for _, v := range v0 {
|
|
|
r = append(r, &DashboardsAsConfig{
|
|
|
- Name: v.Name,
|
|
|
- Type: v.Type,
|
|
|
- OrgId: v.OrgId,
|
|
|
- Folder: v.Folder,
|
|
|
- Editable: v.Editable,
|
|
|
- Options: v.Options,
|
|
|
- DisableDeletion: v.DisableDeletion,
|
|
|
- IntervalSeconds: v.IntervalSeconds,
|
|
|
+ Name: v.Name,
|
|
|
+ Type: v.Type,
|
|
|
+ OrgId: v.OrgId,
|
|
|
+ Folder: v.Folder,
|
|
|
+ Editable: v.Editable,
|
|
|
+ Options: v.Options,
|
|
|
+ DisableDeletion: v.DisableDeletion,
|
|
|
+ UpdateIntervalSeconds: v.UpdateIntervalSeconds,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -90,14 +90,14 @@ func (dc *DashboardAsConfigV1) mapToDashboardAsConfig() []*DashboardsAsConfig {
|
|
|
|
|
|
for _, v := range dc.Providers {
|
|
|
r = append(r, &DashboardsAsConfig{
|
|
|
- Name: v.Name,
|
|
|
- Type: v.Type,
|
|
|
- OrgId: v.OrgId,
|
|
|
- Folder: v.Folder,
|
|
|
- Editable: v.Editable,
|
|
|
- Options: v.Options,
|
|
|
- DisableDeletion: v.DisableDeletion,
|
|
|
- IntervalSeconds: v.IntervalSeconds,
|
|
|
+ Name: v.Name,
|
|
|
+ Type: v.Type,
|
|
|
+ OrgId: v.OrgId,
|
|
|
+ Folder: v.Folder,
|
|
|
+ Editable: v.Editable,
|
|
|
+ Options: v.Options,
|
|
|
+ DisableDeletion: v.DisableDeletion,
|
|
|
+ UpdateIntervalSeconds: v.UpdateIntervalSeconds,
|
|
|
})
|
|
|
}
|
|
|
|