Handle default datasource management

This commit is contained in:
Torkel Ödegaard
2015-01-09 16:36:23 +01:00
parent d562dcd90c
commit 68cc3f86dd
11 changed files with 120 additions and 43 deletions
+1 -2
View File
@@ -29,6 +29,7 @@ func GetDataSources(c *middleware.Context) {
Database: ds.Database,
User: ds.User,
BasicAuth: ds.BasicAuth,
IsDefault: ds.IsDefault,
}
}
@@ -69,8 +70,6 @@ func AddDataSource(c *middleware.Context) {
return
}
//bus.Publish(&m.DataSourceCreatedEvent{Account: c.GetAccountId(), })
c.JsonOK("Datasource added")
}
+1
View File
@@ -30,6 +30,7 @@ type DataSource struct {
User string `json:"user"`
Database string `json:"database"`
BasicAuth bool `json:"basicAuth"`
IsDefault bool `json:"isDefault"`
}
type MetricQueryResultDto struct {
+3 -2
View File
@@ -33,8 +33,9 @@ func getFrontendSettings(c *middleware.Context) (map[string]interface{}, error)
}
var dsMap = map[string]interface{}{
"type": ds.Type,
"url": url,
"type": ds.Type,
"url": url,
"default": ds.IsDefault,
}
if ds.Type == m.DS_INFLUXDB {