2021-11-09 08:37:16 +01:00
|
|
|
import { coreModule } from 'app/angular/core_module';
|
2019-01-14 21:21:58 +01:00
|
|
|
|
|
|
|
|
coreModule.directive('datasourceHttpSettings', () => {
|
|
|
|
|
return {
|
|
|
|
|
scope: {
|
|
|
|
|
current: '=',
|
|
|
|
|
suggestUrl: '@',
|
|
|
|
|
noDirectAccess: '@',
|
2021-08-20 15:53:54 +02:00
|
|
|
showForwardOAuthIdentityOption: '@',
|
2019-01-14 21:21:58 +01:00
|
|
|
},
|
2021-11-15 15:12:45 +01:00
|
|
|
templateUrl: 'public/app/angular/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
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
});
|