feat(datasource): added suggest urls for each data source, #4577
This commit is contained in:
@@ -34,6 +34,7 @@ func Register(r *macaron.Macaron) {
|
|||||||
r.Get("/org/", reqSignedIn, Index)
|
r.Get("/org/", reqSignedIn, Index)
|
||||||
r.Get("/org/new", reqSignedIn, Index)
|
r.Get("/org/new", reqSignedIn, Index)
|
||||||
r.Get("/datasources/", reqSignedIn, Index)
|
r.Get("/datasources/", reqSignedIn, Index)
|
||||||
|
r.Get("/datasources/new", reqSignedIn, Index)
|
||||||
r.Get("/datasources/edit/*", reqSignedIn, Index)
|
r.Get("/datasources/edit/*", reqSignedIn, Index)
|
||||||
r.Get("/org/users/", reqSignedIn, Index)
|
r.Get("/org/users/", reqSignedIn, Index)
|
||||||
r.Get("/org/apikeys/", reqSignedIn, Index)
|
r.Get("/org/apikeys/", reqSignedIn, Index)
|
||||||
|
|||||||
@@ -168,15 +168,13 @@ coreModule.directive('datasourceHttpSettings', function() {
|
|||||||
return {
|
return {
|
||||||
scope: {
|
scope: {
|
||||||
current: "=",
|
current: "=",
|
||||||
defaultUrl: "="
|
suggestUrl: "@",
|
||||||
},
|
},
|
||||||
templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html',
|
templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html',
|
||||||
link: {
|
link: {
|
||||||
pre: function($scope, elem, attrs) {
|
pre: function($scope, elem, attrs) {
|
||||||
$scope.suggestDefaultUrl = function() {
|
$scope.getSuggestUrls = function() {
|
||||||
return [
|
return [$scope.suggestUrl];
|
||||||
$scope.defaultUrl
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@
|
|||||||
<div class="gf-form-inline">
|
<div class="gf-form-inline">
|
||||||
<div class="gf-form max-width-30">
|
<div class="gf-form max-width-30">
|
||||||
<span class="gf-form-label width-7">Url</span>
|
<span class="gf-form-label width-7">Url</span>
|
||||||
<input class="gf-form-input" type="text" ng-model='current.url' placeholder="for example: http://localhost:8081" bs-typeahead="suggestDefaultUrl" ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" required></input>
|
<input class="gf-form-input" type="text"
|
||||||
|
ng-model='current.url' placeholder="{{suggestUrl}}"
|
||||||
|
bs-typeahead="getSuggestUrls" min-length="0"
|
||||||
|
ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" required></input>
|
||||||
<info-popover mode="right-absolute">
|
<info-popover mode="right-absolute">
|
||||||
<p>Specify a complete HTTP url (for example http://your_server:8080)</p>
|
<p>Specify a complete HTTP url (for example http://your_server:8080)</p>
|
||||||
<span ng-show="current.access === 'direct'">
|
<span ng-show="current.access === 'direct'">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<datasource-http-settings current="ctrl.current">
|
<datasource-http-settings current="ctrl.current" suggest-url="http://localhost:9200">
|
||||||
</datasource-http-settings>
|
</datasource-http-settings>
|
||||||
|
|
||||||
<h3 class="page-heading">Elasticsearch details</h3>
|
<h3 class="page-heading">Elasticsearch details</h3>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
<datasource-http-settings current="ctrl.current" default-url="'http://localhost:8081'">
|
<datasource-http-settings
|
||||||
|
current="ctrl.current"
|
||||||
|
suggest-url="http://localhost:8080">
|
||||||
</datasource-http-settings>
|
</datasource-http-settings>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<datasource-http-settings current="ctrl.current">
|
<datasource-http-settings current="ctrl.current" suggest-url="http://localhost:8086">
|
||||||
</datasource-http-settings>
|
</datasource-http-settings>
|
||||||
|
|
||||||
<h3 class="page-heading">InfluxDB Details</h3>
|
<h3 class="page-heading">InfluxDB Details</h3>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<datasource-http-settings current="ctrl.current"></datasource-http-settings>
|
<datasource-http-settings current="ctrl.current" suggest-url="http://localhost:4242"></datasource-http-settings>
|
||||||
|
|
||||||
<h5>Opentsdb settings</h5>
|
<h5>OpenTSDB settings</h5>
|
||||||
<div class="gf-form">
|
<div class="gf-form">
|
||||||
<span class="gf-form-label width-7">
|
<span class="gf-form-label width-7">
|
||||||
Version
|
Version
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<datasource-http-settings current="ctrl.current">
|
<datasource-http-settings current="ctrl.current" suggest-url="http://localhost:9090">
|
||||||
</datasource-http-settings>
|
</datasource-http-settings>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user