mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 23:53:25 -06:00
feat(datasource): added suggest urls for each data source, #4577
This commit is contained in:
parent
fdf46c6a10
commit
9f9fca1e76
@ -34,6 +34,7 @@ func Register(r *macaron.Macaron) {
|
||||
r.Get("/org/", reqSignedIn, Index)
|
||||
r.Get("/org/new", reqSignedIn, Index)
|
||||
r.Get("/datasources/", reqSignedIn, Index)
|
||||
r.Get("/datasources/new", reqSignedIn, Index)
|
||||
r.Get("/datasources/edit/*", reqSignedIn, Index)
|
||||
r.Get("/org/users/", reqSignedIn, Index)
|
||||
r.Get("/org/apikeys/", reqSignedIn, Index)
|
||||
|
@ -168,15 +168,13 @@ coreModule.directive('datasourceHttpSettings', function() {
|
||||
return {
|
||||
scope: {
|
||||
current: "=",
|
||||
defaultUrl: "="
|
||||
suggestUrl: "@",
|
||||
},
|
||||
templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html',
|
||||
link: {
|
||||
pre: function($scope, elem, attrs) {
|
||||
$scope.suggestDefaultUrl = function() {
|
||||
return [
|
||||
$scope.defaultUrl
|
||||
];
|
||||
$scope.getSuggestUrls = function() {
|
||||
return [$scope.suggestUrl];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,10 @@
|
||||
<div class="gf-form-inline">
|
||||
<div class="gf-form max-width-30">
|
||||
<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">
|
||||
<p>Specify a complete HTTP url (for example http://your_server:8080)</p>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<datasource-http-settings current="ctrl.current">
|
||||
<datasource-http-settings current="ctrl.current" suggest-url="http://localhost:8086">
|
||||
</datasource-http-settings>
|
||||
|
||||
<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">
|
||||
<span class="gf-form-label width-7">
|
||||
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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user