mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashfolders: Add a helper for creating a dashboard folder
This commit is contained in:
@@ -68,6 +68,15 @@ func NewDashboard(title string) *Dashboard {
|
|||||||
return dash
|
return dash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewDashboardFolder creates a new dashboard folder
|
||||||
|
func NewDashboardFolder(title string) *Dashboard {
|
||||||
|
folder := NewDashboard(title)
|
||||||
|
folder.Data.Set("schemaVersion", 16)
|
||||||
|
folder.Data.Set("editable", true)
|
||||||
|
folder.Data.Set("hideControls", true)
|
||||||
|
return folder
|
||||||
|
}
|
||||||
|
|
||||||
// GetTags turns the tags in data json into go string array
|
// GetTags turns the tags in data json into go string array
|
||||||
func (dash *Dashboard) GetTags() []string {
|
func (dash *Dashboard) GetTags() []string {
|
||||||
return dash.Data.Get("tags").MustStringArray()
|
return dash.Data.Get("tags").MustStringArray()
|
||||||
|
|||||||
Reference in New Issue
Block a user