ux(dashboard): making progress on new add panel experiance

This commit is contained in:
Torkel Ödegaard
2016-10-26 17:42:39 +02:00
parent f1f923abb9
commit c609586ff0
9 changed files with 263 additions and 165 deletions

View File

@@ -127,6 +127,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"name": panel.Name,
"id": panel.Id,
"info": panel.Info,
"sort": getPanelSort(panel.Id),
}
}
@@ -150,6 +151,25 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
return jsonObj, nil
}
func getPanelSort(id string) int {
sort := 100
switch id {
case "graph":
sort = 1
case "singlestat":
sort = 2
case "table":
sort = 3
case "text":
sort = 4
case "alertlist":
sort = 5
case "dashlist":
sort = 6
}
return sort
}
func GetFrontendSettings(c *middleware.Context) {
settings, err := getFrontendSettingsMap(c)
if err != nil {