provisioning: improve UX when saving provisioned dashboards

This commit is contained in:
bergquist
2018-02-27 18:51:04 +01:00
parent a20f3d196c
commit d6faa3d06f
11 changed files with 152 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import (
func init() {
bus.AddHandler("sql", GetProvisionedDashboardDataQuery)
bus.AddHandler("sql", SaveProvisionedDashboard)
bus.AddHandler("sql", GetProvisionedDataByDashboardId)
}
type DashboardExtras struct {
@@ -17,6 +18,18 @@ type DashboardExtras struct {
Value string
}
func GetProvisionedDataByDashboardId(cmd *models.GetProvisionedDashboardByDashboardId) error {
result := &models.DashboardProvisioning{}
_, err := x.Where("dashboard_id = ?", cmd.DashboardId).Get(result)
if err != nil {
return err
}
cmd.Result = result
return nil
}
func SaveProvisionedDashboard(cmd *models.SaveProvisionedDashboardCommand) error {
return inTransaction(func(sess *DBSession) error {
err := saveDashboard(sess, cmd.DashboardCmd)