Handle default datasource management
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user