feat(registries): remove actual password from registry password input (#1687)

pull/1693/head
Anthony Lapenna 2018-03-02 18:16:33 +10:00 committed by GitHub
parent 73e6498d2f
commit 28bca85e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

@ -56,7 +56,7 @@
<div class="form-group">
<label for="credentials_password" class="col-sm-3 col-lg-2 control-label text-left">Password</label>
<div class="col-sm-9 col-lg-10">
<input type="password" class="form-control" id="credentials_password" ng-model="registry.Password">
<input type="password" class="form-control" id="credentials_password" ng-model="formValues.Password" placeholder="*******">
</div>
</div>
<!-- !credentials-password -->
@ -64,7 +64,7 @@
<!-- !authentication-credentials -->
<div class="form-group">
<div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !registry.Name || !registry.URL || (registry.Authentication && (!registry.Username || !registry.Password))" ng-click="updateRegistry()" button-spinner="state.actionInProgress">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !registry.Name || !registry.URL || (registry.Authentication && (!registry.Username || !formValues.Password))" ng-click="updateRegistry()" button-spinner="state.actionInProgress">
<span ng-hide="state.actionInProgress">Update registry</span>
<span ng-show="state.actionInProgress">Updating registry...</span>
</button>

View File

@ -6,8 +6,13 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications)
actionInProgress: false
};
$scope.formValues = {
Password: ''
};
$scope.updateRegistry = function() {
var registry = $scope.registry;
registry.Password = $scope.formValues.Password;
$scope.state.actionInProgress = true;
RegistryService.updateRegistry(registry)
.then(function success(data) {

View File

@ -48,7 +48,7 @@
<div class="form-group">
<label for="hub_password" class="col-sm-3 col-lg-2 control-label text-left">Password</label>
<div class="col-sm-9 col-lg-10">
<input type="password" class="form-control" id="hub_password" ng-model="dockerhub.Password">
<input type="password" class="form-control" id="hub_password" ng-model="formValues.dockerHubPassword" placeholder="*******">
</div>
</div>
<!-- !credentials-password -->
@ -56,7 +56,7 @@
<!-- !authentication-credentials -->
<div class="form-group">
<div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || dockerhub.Authentication && (!dockerhub.Username || !dockerhub.Password)" ng-click="updateDockerHub()" button-spinner="state.actionInProgress">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || dockerhub.Authentication && (!dockerhub.Username || !formValues.dockerHubPassword)" ng-click="updateDockerHub()" button-spinner="state.actionInProgress">
<span ng-hide="state.actionInProgress">Update</span>
<span ng-show="state.actionInProgress">Updating DockerHub settings...</span>
</button>

View File

@ -6,8 +6,13 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N
actionInProgress: false
};
$scope.formValues = {
dockerHubPassword: ''
};
$scope.updateDockerHub = function() {
var dockerhub = $scope.dockerhub;
dockerhub.Password = $scope.formValues.dockerHubPassword;
$scope.state.actionInProgress = true;
DockerHubService.update(dockerhub)
.then(function success(data) {