mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 01:27:49 +01:00
Add placeholder in registry page when select helm-hub
Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
parent
a80969e7af
commit
5c8a683645
@ -45,10 +45,10 @@
|
||||
<label for="destination_url" class="col-md-4 form-group-label-override required">{{ 'DESTINATION.URL' |
|
||||
translate }}</label>
|
||||
<label class="col-md-8" for="destination_url" aria-haspopup="true" role="tooltip" [class.invalid]="targetEndpoint?.errors && (targetEndpoint?.dirty || targetEndpoint?.touched)"
|
||||
[class.valid]="targetEndpoint?.valid" class="tooltip tooltip-validation tooltip-sm tooltip-bottom-left">
|
||||
[class.valid]="targetEndpoint?.valid" class="tooltip tooltip-validation tooltip-sm tooltip-bottom-left clr-select-wrapper">
|
||||
<input *ngIf="!endpointList.length" type="text" id="destination_url" [disabled]="testOngoing || urlDisabled" [readonly]="!editable" [(ngModel)]="target.url"
|
||||
size="25" name="endpointUrl" #targetEndpoint="ngModel" required placeholder="http(s)://192.168.1.1">
|
||||
<select *ngIf="endpointList.length" [(ngModel)]="target.url" name="endpointUrl" #targetEndpoint="ngModel">
|
||||
<select *ngIf="endpointList.length" [(ngModel)]="target.url" class="clr-select" name="endpointUrl" #targetEndpoint="ngModel">
|
||||
<option class="display-none" value=""></option>
|
||||
<option *ngFor="let endpoint of endpointList" value="{{endpoint.value}}">{{endpoint.key}}</option>
|
||||
</select>
|
||||
|
@ -34,6 +34,14 @@ import { clone, compareValue, isEmptyObject } from "../utils";
|
||||
const FAKE_PASSWORD = "rjGcfuRu";
|
||||
const FAKE_JSON_KEY = "No Change";
|
||||
const DOCKERHUB_URL = "https://hub.docker.com";
|
||||
const HELM_HUB_URL = "https://hub.helm.sh";
|
||||
const HELM_HUB_ACCESS_KEY = "_json_key";
|
||||
const REGISTRY_NAME_LIST = {
|
||||
DOCKER_HUB: "docker-hub",
|
||||
HELM_HUB: "helm-hub",
|
||||
GOOGLE_GCR: "google-gcr",
|
||||
AWS_ECR: "aws-ecr"
|
||||
};
|
||||
@Component({
|
||||
selector: "hbr-create-edit-endpoint",
|
||||
templateUrl: "./create-edit-endpoint.component.html",
|
||||
@ -214,19 +222,22 @@ export class CreateEditEndpointComponent
|
||||
|
||||
adapterChange($event): void {
|
||||
let selectValue = this.targetForm.controls.adapter.value;
|
||||
if (selectValue === 'docker-hub') {
|
||||
if (selectValue === REGISTRY_NAME_LIST.DOCKER_HUB) {
|
||||
this.urlDisabled = true;
|
||||
this.targetForm.controls.endpointUrl.setValue(DOCKERHUB_URL);
|
||||
} else if (selectValue === REGISTRY_NAME_LIST.HELM_HUB) {
|
||||
this.urlDisabled = true;
|
||||
this.targetForm.controls.endpointUrl.setValue(HELM_HUB_URL);
|
||||
} else {
|
||||
this.urlDisabled = false;
|
||||
this.targetForm.controls.endpointUrl.setValue("");
|
||||
}
|
||||
if (selectValue === 'google-gcr') {
|
||||
this.targetForm.controls.access_key.setValue("_json_key");
|
||||
if (selectValue === REGISTRY_NAME_LIST.GOOGLE_GCR) {
|
||||
this.targetForm.controls.access_key.setValue(HELM_HUB_ACCESS_KEY);
|
||||
} else {
|
||||
this.targetForm.controls.access_key.setValue("");
|
||||
}
|
||||
if (selectValue === 'google-gcr') {
|
||||
if (selectValue === REGISTRY_NAME_LIST.GOOGLE_GCR) {
|
||||
this.endpointList = [
|
||||
{
|
||||
key: "gcr.io",
|
||||
@ -245,7 +256,7 @@ export class CreateEditEndpointComponent
|
||||
value: "https://asia.gcr.io"
|
||||
}
|
||||
];
|
||||
} else if (selectValue === 'aws-ecr') {
|
||||
} else if (selectValue === REGISTRY_NAME_LIST.AWS_ECR) {
|
||||
this.endpointList = [
|
||||
{
|
||||
key: "ap-northeast-1",
|
||||
|
Loading…
Reference in New Issue
Block a user