Restored http settings directive that was hidden in an unused angular controller page

This commit is contained in:
Torkel Ödegaard 2019-01-14 21:21:58 +01:00
parent 03c6cc59a7
commit 6b4dcb38ea
3 changed files with 27 additions and 0 deletions

View File

@ -11,3 +11,4 @@ import './alerting/NotificationsListCtrl';
import './manage-dashboards';
import './teams/CreateTeamCtrl';
import './profile/all';
import './datasources/settings/HttpSettingsCtrl';

View File

@ -0,0 +1,26 @@
import { coreModule } from 'app/core/core';
coreModule.directive('datasourceHttpSettings', () => {
return {
scope: {
current: '=',
suggestUrl: '@',
noDirectAccess: '@',
},
templateUrl: 'public/app/features/datasources/partials/http_settings.html',
link: {
pre: ($scope, elem, attrs) => {
// do not show access option if direct access is disabled
$scope.showAccessOption = $scope.noDirectAccess !== 'true';
$scope.showAccessHelp = false;
$scope.toggleAccessHelp = () => {
$scope.showAccessHelp = !$scope.showAccessHelp;
};
$scope.getSuggestUrls = () => {
return [$scope.suggestUrl];
};
},
},
};
});