mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-11 18:38:14 +01:00
commit
a9a79736b4
@ -17,7 +17,7 @@
|
||||
<label for="tabsystem">{{'SIDE_NAV.SYSTEM_MGMT.NAME' | translate}}</label>
|
||||
<ul class="nav-list">
|
||||
<li><a class="nav-link nav-link-override" routerLink="/harbor/users" routerLinkActive="active">{{'SIDE_NAV.SYSTEM_MGMT.USER' | translate}}</a></li>
|
||||
<li><a class="nav-link nav-link-override" routerLink="/harbor/replications/endpoints" routerLinkActive="active">{{'SIDE_NAV.SYSTEM_MGMT.REPLICATION' | translate}}</a></li>
|
||||
<li><a class="nav-link nav-link-override" routerLink="/harbor/replications" routerLinkActive="active">{{'SIDE_NAV.SYSTEM_MGMT.REPLICATION' | translate}}</a></li>
|
||||
<li><a class="nav-link nav-link-override" routerLink="/harbor/configs" routerLinkActive="active">{{'SIDE_NAV.SYSTEM_MGMT.CONFIG' | translate}}</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -90,6 +90,10 @@ const harborRoutes: Routes = [
|
||||
{
|
||||
path: 'endpoints',
|
||||
component: DestinationPageComponent
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'endpoints'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -54,7 +54,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
|
||||
createProjectOpened: boolean;
|
||||
|
||||
hasChanged: boolean;
|
||||
btnIsOk:boolean=false;
|
||||
isSubmitOnGoing:boolean=false;
|
||||
|
||||
staticBackdrop: boolean = true;
|
||||
closable: boolean = false;
|
||||
@ -86,12 +86,10 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
|
||||
this.isNameValid = cont.valid;
|
||||
if (this.isNameValid) {
|
||||
//Check exiting from backend
|
||||
this.checkOnGoing = true;
|
||||
this.projectService
|
||||
.checkProjectExists(cont.value).toPromise()
|
||||
.then(() => {
|
||||
//Project existing
|
||||
this.btnIsOk=true;
|
||||
this.isNameValid = false;
|
||||
this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS';
|
||||
this.checkOnGoing = false;
|
||||
@ -111,16 +109,24 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
this.btnIsOk=false;
|
||||
if (this.isSubmitOnGoing){
|
||||
return ;
|
||||
}
|
||||
|
||||
this.isSubmitOnGoing=true;
|
||||
this.projectService
|
||||
.createProject(this.project.name, this.project.public ? 1 : 0)
|
||||
.subscribe(
|
||||
status => {
|
||||
this.isSubmitOnGoing=false;
|
||||
|
||||
this.create.emit(true);
|
||||
this.messageHandlerService.showSuccess('PROJECT.CREATED_SUCCESS');
|
||||
this.createProjectOpened = false;
|
||||
},
|
||||
error => {
|
||||
this.isSubmitOnGoing=false;
|
||||
|
||||
let errorMessage: string;
|
||||
if (error instanceof Response) {
|
||||
switch (error.status) {
|
||||
@ -187,7 +193,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
|
||||
public get isValid(): boolean {
|
||||
return this.currentForm &&
|
||||
this.currentForm.valid &&
|
||||
this.btnIsOk&&
|
||||
!this.isSubmitOnGoing&&
|
||||
this.isNameValid &&
|
||||
!this.checkOnGoing;
|
||||
}
|
||||
@ -198,6 +204,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
|
||||
if (cont) {
|
||||
this.proNameChecker.next(cont.value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user