diff --git a/package.json b/package.json
index 72eee2f37d4..6030416d1dc 100644
--- a/package.json
+++ b/package.json
@@ -60,8 +60,7 @@
},
"scripts": {
"test": "grunt test",
- "coveralls": "grunt karma:coveralls && rm -rf ./coverage",
- "postinstall": "./node_modules/.bin/grunt copy:node_modules"
+ "coveralls": "grunt karma:coveralls && rm -rf ./coverage"
},
"license": "Apache-2.0",
"dependencies": {
diff --git a/pkg/api/cloudwatch/metrics.go b/pkg/api/cloudwatch/metrics.go
index 7a98386347c..b4321791926 100644
--- a/pkg/api/cloudwatch/metrics.go
+++ b/pkg/api/cloudwatch/metrics.go
@@ -126,6 +126,11 @@ func handleGetNamespaces(req *cwRequest, c *middleware.Context) {
for key := range metricsMap {
keys = append(keys, key)
}
+ if customMetricsNamespaces, ok := req.DataSource.JsonData["customMetricsNamespaces"].(string); ok {
+ for _, key := range strings.Split(customMetricsNamespaces, ",") {
+ keys = append(keys, key)
+ }
+ }
sort.Sort(sort.StringSlice(keys))
result := []interface{}{}
diff --git a/pkg/api/org.go b/pkg/api/org.go
index 0316116b6d3..61af62311c6 100644
--- a/pkg/api/org.go
+++ b/pkg/api/org.go
@@ -84,7 +84,7 @@ func CreateOrg(c *middleware.Context, cmd m.CreateOrgCommand) Response {
cmd.UserId = c.UserId
if err := bus.Dispatch(&cmd); err != nil {
if err == m.ErrOrgNameTaken {
- return ApiError(400, "Organization name taken", err)
+ return ApiError(409, "Organization name taken", err)
}
return ApiError(500, "Failed to create organization", err)
}
diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go
index 3ab4bf1c00b..e3db2d7f537 100644
--- a/pkg/services/sqlstore/sqlstore.go
+++ b/pkg/services/sqlstore/sqlstore.go
@@ -149,8 +149,13 @@ func getEngine() (*xorm.Engine, error) {
if len(fields) > 1 && len(strings.TrimSpace(fields[1])) > 0 {
port = fields[1]
}
- cnnstr = fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s",
- DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode)
+ if DbCfg.Pwd == "" {
+ DbCfg.Pwd = "''"
+ }
+ if DbCfg.User == "" {
+ DbCfg.User = "''"
+ }
+ cnnstr = fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s", DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode)
case "sqlite3":
if !filepath.IsAbs(DbCfg.Path) {
DbCfg.Path = filepath.Join(setting.DataPath, DbCfg.Path)
diff --git a/public/app/core/routes/routes.ts b/public/app/core/routes/routes.ts
index 8963228210b..82da84fbc56 100644
--- a/public/app/core/routes/routes.ts
+++ b/public/app/core/routes/routes.ts
@@ -45,6 +45,7 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
.when('/datasources', {
templateUrl: 'public/app/features/datasources/partials/list.html',
controller : 'DataSourcesCtrl',
+ controllerAs: 'ctrl',
resolve: loadOrgBundle,
})
.when('/datasources/edit/:id', {
diff --git a/public/app/features/datasources/list_ctrl.js b/public/app/features/datasources/list_ctrl.js
deleted file mode 100644
index da77df252e1..00000000000
--- a/public/app/features/datasources/list_ctrl.js
+++ /dev/null
@@ -1,36 +0,0 @@
-define([
- 'angular',
- 'lodash',
-],
-function (angular) {
- 'use strict';
-
- var module = angular.module('grafana.controllers');
-
- module.controller('DataSourcesCtrl', function($scope, $http, backendSrv, datasourceSrv) {
-
- $scope.init = function() {
- $scope.datasources = [];
- $scope.getDatasources();
- };
-
- $scope.getDatasources = function() {
- backendSrv.get('/api/datasources').then(function(results) {
- $scope.datasources = results;
- });
- };
-
- $scope.remove = function(ds) {
- backendSrv.delete('/api/datasources/' + ds.id).then(function() {
- $scope.getDatasources();
-
- backendSrv.get('/api/frontend/settings').then(function(settings) {
- datasourceSrv.init(settings.datasources);
- });
- });
- };
-
- $scope.init();
-
- });
-});
diff --git a/public/app/features/datasources/list_ctrl.ts b/public/app/features/datasources/list_ctrl.ts
new file mode 100644
index 00000000000..b1f93f1a158
--- /dev/null
+++ b/public/app/features/datasources/list_ctrl.ts
@@ -0,0 +1,52 @@
+///
-
| Name | @@ -35,7 +35,7 @@|
|---|---|
| {{ds.name}} @@ -56,7 +56,7 @@ | - + | diff --git a/public/app/plugins/datasource/cloudwatch/partials/config.html b/public/app/plugins/datasource/cloudwatch/partials/config.html index 92a963da7c6..69ec729a160 100644 --- a/public/app/plugins/datasource/cloudwatch/partials/config.html +++ b/public/app/plugins/datasource/cloudwatch/partials/config.html @@ -29,5 +29,16 @@ +