mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-05 04:24:22 +00:00
Fix for login page issues
This commit is contained in:
parent
f7a3df27b8
commit
06ad9c2f07
@ -27,5 +27,9 @@
|
|||||||
<button class="loginButton" mat-raised-button color="primary" (click)="login()">Login</button>
|
<button class="loginButton" mat-raised-button color="primary" (click)="login()">Login</button>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
<div class="errorMessage">
|
||||||
|
<mat-error *ngIf="loginError">Authentication was unsuccessful</mat-error>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,8 +12,8 @@ mat-form-field {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mat-icon-login {
|
.mat-icon-login {
|
||||||
height: 200px!important;
|
height: 100px!important;
|
||||||
width: 200px!important;
|
width: 100px!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginTitle {
|
.loginTitle {
|
||||||
@ -29,3 +29,9 @@ mat-form-field {
|
|||||||
.loginButton {
|
.loginButton {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.errorMessage {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
@ -21,6 +21,7 @@ export class LoginComponent implements OnInit {
|
|||||||
private server: Server;
|
private server: Server;
|
||||||
public version: string;
|
public version: string;
|
||||||
public isLightThemeEnabled: boolean = false;
|
public isLightThemeEnabled: boolean = false;
|
||||||
|
public loginError: boolean = false;
|
||||||
|
|
||||||
loginForm = new FormGroup({
|
loginForm = new FormGroup({
|
||||||
username: new FormControl('', [Validators.required]),
|
username: new FormControl('', [Validators.required]),
|
||||||
@ -72,6 +73,8 @@ export class LoginComponent implements OnInit {
|
|||||||
await this.serverService.update(server);
|
await this.serverService.update(server);
|
||||||
|
|
||||||
this.router.navigate(['/server', this.server.id, 'projects']);
|
this.router.navigate(['/server', this.server.id, 'projects']);
|
||||||
|
}, error => {
|
||||||
|
this.loginError = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,13 @@
|
|||||||
Projects
|
Projects
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button *ngIf="recentlyOpenedProjectId && recentlyOpenedServerId" mat-button (click)="backToProject()">
|
<button *ngIf="recentlyOpenedProjectId && recentlyOpenedServerId && !isLoginPage" mat-button (click)="backToProject()">
|
||||||
Back to project
|
Back to project
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
|
|
||||||
<button mat-button [matMenuTriggerFor]="menu">
|
<button mat-button *ngIf="!isLoginPage" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import { Server } from '../../models/server';
|
|||||||
export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||||
public isInstalledSoftwareAvailable = false;
|
public isInstalledSoftwareAvailable = false;
|
||||||
public uiVersion = version;
|
public uiVersion = version;
|
||||||
|
public isLoginPage = false;
|
||||||
|
|
||||||
serverStatusSubscription: Subscription;
|
serverStatusSubscription: Subscription;
|
||||||
shouldStopServersOnClosing = true;
|
shouldStopServersOnClosing = true;
|
||||||
@ -40,6 +41,10 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
if (this.router.url.includes("login")) {
|
||||||
|
this.isLoginPage = true;
|
||||||
|
};
|
||||||
|
|
||||||
this.recentlyOpenedServerId = this.recentlyOpenedProjectService.getServerId();
|
this.recentlyOpenedServerId = this.recentlyOpenedProjectService.getServerId();
|
||||||
this.recentlyOpenedProjectId = this.recentlyOpenedProjectService.getProjectId();
|
this.recentlyOpenedProjectId = this.recentlyOpenedProjectService.getProjectId();
|
||||||
this.serverIdProjectList = this.recentlyOpenedProjectService.getServerIdProjectList();
|
this.serverIdProjectList = this.recentlyOpenedProjectService.getServerIdProjectList();
|
||||||
|
Loading…
Reference in New Issue
Block a user