2019-01-14 21:21:58 +01:00
|
|
|
import { coreModule } from 'app/core/core';
|
|
|
|
|
|
|
|
|
|
coreModule.directive('datasourceHttpSettings', () => {
|
|
|
|
|
return {
|
|
|
|
|
scope: {
|
|
|
|
|
current: '=',
|
|
|
|
|
suggestUrl: '@',
|
|
|
|
|
noDirectAccess: '@',
|
|
|
|
|
},
|
2019-10-18 12:09:53 +02:00
|
|
|
templateUrl: 'public/app/features/datasources/partials/http_settings_next.html',
|
2019-01-14 21:21:58 +01:00
|
|
|
link: {
|
2019-10-18 12:09:53 +02:00
|
|
|
pre: ($scope: any) => {
|
2019-01-14 21:21:58 +01:00
|
|
|
// do not show access option if direct access is disabled
|
|
|
|
|
$scope.showAccessOption = $scope.noDirectAccess !== 'true';
|
2019-10-18 12:09:53 +02:00
|
|
|
$scope.onChange = (datasourceSetting: any) => {
|
|
|
|
|
$scope.current = datasourceSetting;
|
2019-01-14 21:21:58 +01:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
});
|