feat(registries): update registry Password wording to Access Token for Dockerhub (#6557)

pull/6709/head
LP B 3 years ago committed by GitHub
parent f154e6e0f1
commit 167825ff3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,13 @@
<form class="form-horizontal" name="registryFormDockerhub" ng-submit="$ctrl.formAction()"> <form class="form-horizontal" name="registryFormDockerhub" ng-submit="$ctrl.formAction()">
<div class="col-sm-12 form-section-title"> Important notice </div>
<div class="form-group">
<span class="col-sm-12 text-muted small">
<p>
For information on how to generate a DockerHub Access Token, follow the
<a href="https://docs.docker.com/docker-hub/access-tokens/" target="_blank">dockerhub guide</a>.
</p>
</span>
</div>
<div class="col-sm-12 form-section-title"> DockerHub account details </div> <div class="col-sm-12 form-section-title"> DockerHub account details </div>
<!-- name-input --> <!-- name-input -->
<div class="form-group"> <div class="form-group">
@ -32,7 +41,7 @@
<!-- !credentials-user --> <!-- !credentials-user -->
<!-- credentials-password --> <!-- credentials-password -->
<div class="form-group"> <div class="form-group">
<label for="registry_password" class="col-sm-3 col-lg-2 control-label text-left">DockerHub password</label> <label for="registry_password" class="col-sm-3 col-lg-2 control-label text-left">DockerHub access token</label>
<div class="col-sm-9 col-lg-10"> <div class="col-sm-9 col-lg-10">
<input type="password" class="form-control" id="registry_password" name="registry_password" ng-model="$ctrl.model.Password" required /> <input type="password" class="form-control" id="registry_password" name="registry_password" ng-model="$ctrl.model.Password" required />
</div> </div>

@ -60,7 +60,7 @@
<!-- credentials-password --> <!-- credentials-password -->
<div class="form-group"> <div class="form-group">
<label for="credentials_password" class="col-sm-3 col-lg-2 control-label text-left"> <label for="credentials_password" class="col-sm-3 col-lg-2 control-label text-left">
{{ registry.Type === RegistryTypes.ECR ? 'AWS Secret Access Key' : 'Password' }} {{ passwordLabel() }}
</label> </label>
<div class="col-sm-9 col-lg-10"> <div class="col-sm-9 col-lg-10">
<input type="password" class="form-control" id="credentials_password" ng-model="formValues.Password" placeholder="*******" /> <input type="password" class="form-control" id="credentials_password" ng-model="formValues.Password" placeholder="*******" />

@ -16,6 +16,18 @@ angular.module('portainer.app').controller('RegistryController', [
$scope.RegistryTypes = RegistryTypes; $scope.RegistryTypes = RegistryTypes;
$scope.passwordLabel = () => {
const type = $scope.registry.Type;
switch (type) {
case RegistryTypes.ECR:
return 'AWS Secret Access Key';
case RegistryTypes.DOCKERHUB:
return 'Access token';
default:
return 'Password';
}
};
$scope.updateRegistry = function () { $scope.updateRegistry = function () {
var registry = $scope.registry; var registry = $scope.registry;
registry.Password = $scope.formValues.Password; registry.Password = $scope.formValues.Password;

Loading…
Cancel
Save