From fdf46c6a109184b5b25f1a431016bbe082865b8c Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Fri, 17 Jun 2016 14:18:00 +0300 Subject: [PATCH] Issue 4577 (#5379) * Add default-url property for datasource-http-settings directive. This will allow to set default url for datasource. * Fixed spelling. * Use typeahead for url suggestion. --- public/app/features/plugins/ds_edit_ctrl.ts | 16 ++++++++++++++-- .../plugins/partials/ds_http_settings.html | 4 ++-- .../datasource/graphite/partials/config.html | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/public/app/features/plugins/ds_edit_ctrl.ts b/public/app/features/plugins/ds_edit_ctrl.ts index a3e78c33a15..c33fe5a3b3d 100644 --- a/public/app/features/plugins/ds_edit_ctrl.ts +++ b/public/app/features/plugins/ds_edit_ctrl.ts @@ -166,7 +166,19 @@ coreModule.controller('DataSourceEditCtrl', DataSourceEditCtrl); coreModule.directive('datasourceHttpSettings', function() { return { - scope: {current: "="}, - templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html' + scope: { + current: "=", + defaultUrl: "=" + }, + templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html', + link: { + pre: function($scope, elem, attrs) { + $scope.suggestDefaultUrl = function() { + return [ + $scope.defaultUrl + ]; + }; + } + } }; }); diff --git a/public/app/features/plugins/partials/ds_http_settings.html b/public/app/features/plugins/partials/ds_http_settings.html index 08d2af5744a..90feed80935 100644 --- a/public/app/features/plugins/partials/ds_http_settings.html +++ b/public/app/features/plugins/partials/ds_http_settings.html @@ -6,7 +6,7 @@
Url - +

Specify a complete HTTP url (for example http://your_server:8080)

@@ -57,7 +57,7 @@
- Passord + Password
diff --git a/public/app/plugins/datasource/graphite/partials/config.html b/public/app/plugins/datasource/graphite/partials/config.html index d7a0f739ccb..44dc639c0b0 100644 --- a/public/app/plugins/datasource/graphite/partials/config.html +++ b/public/app/plugins/datasource/graphite/partials/config.html @@ -1,3 +1,3 @@ - +