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