datasource: added option no-direct-access to ds-http-settings diretive, closes #12138

This commit is contained in:
Torkel Ödegaard
2018-06-04 11:17:50 +02:00
parent f5cf926364
commit feb5e20779
2 changed files with 5 additions and 1 deletions

View File

@@ -204,10 +204,14 @@ coreModule.directive('datasourceHttpSettings', function() {
scope: {
current: '=',
suggestUrl: '@',
noDirectAccess: '@',
},
templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html',
link: {
pre: function($scope, elem, attrs) {
// do not show access option if direct access is disabled
$scope.showAccessOption = $scope.noDirectAccess !== 'true';
$scope.getSuggestUrls = function() {
return [$scope.suggestUrl];
};

View File

@@ -22,7 +22,7 @@
</div>
</div>
<div class="gf-form-inline">
<div class="gf-form-inline" ng-if="showAccessOption">
<div class="gf-form max-width-30">
<span class="gf-form-label width-7">Access</span>
<div class="gf-form-select-wrapper max-width-24">