mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Store passwords in secureJsonData * Revert unnecessary refactors * Fix for nil jsonSecureData value * Remove copied encryption code from migration * Fix wrong field reference * Remove migration and provisioning changes * Use password getters in datasource proxy * Refactor password handling in datasource configs * Add provisioning warnings * Update documentation * Remove migration command, moved to separate PR * Remove unused code * Set the upgrade version * Remove unused code * Remove double reference
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { coreModule } from 'app/core/core';
|
|
import { createChangeHandler, createResetHandler, PasswordFieldEnum } from '../utils/passwordHandlers';
|
|
|
|
coreModule.directive('datasourceHttpSettings', () => {
|
|
return {
|
|
scope: {
|
|
current: '=',
|
|
suggestUrl: '@',
|
|
noDirectAccess: '@',
|
|
},
|
|
templateUrl: 'public/app/features/datasources/partials/http_settings.html',
|
|
link: {
|
|
pre: ($scope: any, 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];
|
|
};
|
|
|
|
$scope.onBasicAuthPasswordReset = createResetHandler($scope, PasswordFieldEnum.BasicAuthPassword);
|
|
$scope.onBasicAuthPasswordChange = createChangeHandler($scope, PasswordFieldEnum.BasicAuthPassword);
|
|
},
|
|
},
|
|
};
|
|
});
|