mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 01:27:49 +01:00
fix issue about endpontUrl,username,password should have data when connent-test button could click #2435
This commit is contained in:
parent
8236e0358e
commit
34f9a3b911
@ -45,7 +45,7 @@ export const CREATE_EDIT_ENDPOINT_TEMPLATE: string = `<clr-modal [(clrModalOpen)
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="testConnection()" [disabled]="testOngoing || targetEndpoint.errors">{{ 'DESTINATION.TEST_CONNECTION' | translate }}</button>
|
||||
<button type="button" class="btn btn-outline" (click)="testConnection()" [disabled]="testOngoing || hasConnectData">{{ 'DESTINATION.TEST_CONNECTION' | translate }}</button>
|
||||
<button type="button" class="btn btn-outline" (click)="onCancel()" [disabled]="testOngoing">{{ 'BUTTON.CANCEL' | translate }}</button>
|
||||
<button type="submit" class="btn btn-primary" (click)="onSubmit()" [disabled]="testOngoing || targetForm.form.invalid || !editable">{{ 'BUTTON.OK' | translate }}</button>
|
||||
</div>
|
||||
|
@ -83,6 +83,10 @@ export class CreateEditEndpointComponent implements AfterViewChecked {
|
||||
};
|
||||
}
|
||||
|
||||
get hasConnectData():boolean{
|
||||
return !this.target.endpoint || !this.target.username || !this.target.password;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private endpointService: EndpointService,
|
||||
private errorHandler: ErrorHandler,
|
||||
|
@ -81,7 +81,7 @@ export const CREATE_EDIT_RULE_TEMPLATE: string = `
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline" (click)="testConnection()" [disabled]="testOngoing || endpointUrl.errors || connectAbled">{{'REPLICATION.TEST_CONNECTION' | translate}}</button>
|
||||
<button type="button" class="btn btn-outline" (click)="testConnection()" [disabled]="testOngoing || hasConnectData || connectAbled">{{'REPLICATION.TEST_CONNECTION' | translate}}</button>
|
||||
<button type="button" class="btn btn-outline" [disabled]="btnAbled" (click)="onCancel()">{{'BUTTON.CANCEL' | translate }}</button>
|
||||
<button type="submit" class="btn btn-primary" [disabled]="!ruleForm.form.valid || testOngoing || !editable" (click)="onSubmit()">{{'BUTTON.OK' | translate}}</button>
|
||||
</div>
|
||||
|
@ -144,7 +144,9 @@ export class CreateEditRuleComponent implements AfterViewChecked {
|
||||
}
|
||||
get connectAbled():boolean{
|
||||
return !this.createEditRule.endpointId && !this.isCreateEndpoint;
|
||||
|
||||
}
|
||||
get hasConnectData():boolean{
|
||||
return !this.createEditRule.endpointUrl || !this.createEditRule.username || !this.createEditRule.password;
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
Loading…
Reference in New Issue
Block a user