mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Tweaks to the ux for saved creds
This commit is contained in:
@@ -7,9 +7,9 @@
|
|||||||
import {N_} from "../i18n";
|
import {N_} from "../i18n";
|
||||||
|
|
||||||
export default
|
export default
|
||||||
['Wait', '$state', '$scope', '$rootScope', 'ProcessErrors', 'CheckLicense', 'moment', 'Rest',
|
['Wait', '$state', '$scope', '$rootScope', 'ProcessErrors', 'CheckLicense', 'moment', 'Rest', '$timeout',
|
||||||
'$window', 'ConfigService', 'pendoService', 'insightsEnablementService', 'i18n', 'config', 'GetBasePath',
|
'$window', 'ConfigService', 'pendoService', 'insightsEnablementService', 'i18n', 'config', 'GetBasePath',
|
||||||
function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment, Rest,
|
function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment, Rest, $timeout,
|
||||||
$window, ConfigService, pendoService, insightsEnablementService, i18n, config, GetBasePath) {
|
$window, ConfigService, pendoService, insightsEnablementService, i18n, config, GetBasePath) {
|
||||||
|
|
||||||
const calcDaysRemaining = function(seconds) {
|
const calcDaysRemaining = function(seconds) {
|
||||||
@@ -73,7 +73,7 @@ export default
|
|||||||
|
|
||||||
if (data.REDHAT_PASSWORD && data.REDHAT_PASSWORD !== "") {
|
if (data.REDHAT_PASSWORD && data.REDHAT_PASSWORD !== "") {
|
||||||
$scope.rhCreds.password = data.REDHAT_PASSWORD;
|
$scope.rhCreds.password = data.REDHAT_PASSWORD;
|
||||||
$scope.hasPasswordFromSettings = true;
|
$scope.showPlaceholderPassword = true;
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
initVars(config);
|
initVars(config);
|
||||||
@@ -117,6 +117,17 @@ export default
|
|||||||
$window.open('https://www.ansible.com/license', '_blank');
|
$window.open('https://www.ansible.com/license', '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.replacePassword = () => {
|
||||||
|
if ($scope.user_is_superuser && !$scope.newLicense.file) {
|
||||||
|
$scope.showPlaceholderPassword = false;
|
||||||
|
$scope.rhCreds.password = "";
|
||||||
|
$timeout(() => {
|
||||||
|
$('.tooltip').remove();
|
||||||
|
$('#rh-password').focus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$scope.submit = function() {
|
$scope.submit = function() {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
$scope.licenseError = false;
|
$scope.licenseError = false;
|
||||||
|
|||||||
@@ -128,17 +128,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="License-label d-block" translate>PASSWORD</label>
|
<label class="License-label d-block" translate>PASSWORD</label>
|
||||||
<div class="input-group Form-mixedInputGroup" ng-if="hasPasswordFromSettings">
|
<div class="input-group Form-mixedInputGroup" ng-if="showPlaceholderPassword">
|
||||||
<span class="input-group-btn input-group-prepend">
|
<input class="form-control Form-textInput" type="text" value="ENCRYPTED" disabled />
|
||||||
<button aw-password-toggle id="rh_license_pass_show_input_button" class="btn btn-default show_input_button Form-passwordButton" type="button" ng-disabled="!user_is_superuser || newLicense.file" aw-tool-tip="Toggle the display of plaintext." aw-tip-placement="top">Hide</button>
|
<span class="input-group-btn input-group-append">
|
||||||
|
<button class="btn at-ButtonHollow--default at-Input-button" ng-disabled="!user_is_superuser || newLicense.file" ng-click="replacePassword()" aw-tool-tip="Replace" data-placement="top" data-original-title="Replace">
|
||||||
|
<i class="fa fa-undo"></i>
|
||||||
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<input id="rh_license_pass" class="form-control Form-textInput" type="text" ng-model="rhCreds.password" ng-disabled="!user_is_superuser || newLicense.file" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group Form-mixedInputGroup" ng-if="!hasPasswordFromSettings">
|
<div class="input-group" ng-if="!showPlaceholderPassword">
|
||||||
<span class="input-group-btn input-group-prepend">
|
<input id="rh-password" class="form-control Form-textInput" type="password" ng-model="rhCreds.password" ng-disabled="!user_is_superuser || newLicense.file" />
|
||||||
<button aw-password-toggle id="rh_license_pass_show_input_button" class="btn btn-default show_input_button Form-passwordButton" type="button" ng-disabled="!user_is_superuser || newLicense.file" aw-tool-tip="Toggle the display of plaintext." aw-tip-placement="top">Show</button>
|
|
||||||
</span>
|
|
||||||
<input id="rh_license_pass" class="form-control Form-textInput" type="password" ng-model="rhCreds.password" ng-disabled="!user_is_superuser || newLicense.file" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user