Просмотр исходного кода

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

Torkel Ödegaard 7 лет назад
Родитель
Сommit
feb5e20779

+ 4 - 0
public/app/features/plugins/ds_edit_ctrl.ts

@@ -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];
         };

+ 1 - 1
public/app/features/plugins/partials/ds_http_settings.html

@@ -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">