Link to the API doc in the menu

This commit is contained in:
piotrpekala7 2021-11-10 16:00:52 +01:00
parent 44c530d1b5
commit f721bd0d26
2 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,10 @@
<mat-icon>person</mat-icon> <mat-icon>person</mat-icon>
<span>User info</span> <span>User info</span>
</button> </button>
<button mat-menu-item (click)="goToDocumentation()">
<mat-icon>person</mat-icon>
<span>API documentation</span>
</button>
<button mat-menu-item (click)="logout()"> <button mat-menu-item (click)="logout()">
<mat-icon>highlight_off</mat-icon> <mat-icon>highlight_off</mat-icon>
<span>Logout</span> <span>Logout</span>

View File

@ -75,6 +75,13 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
}); });
} }
goToDocumentation() {
let serverId = this.router.url.split("/server/")[1].split("/")[0];
this.serverService.get(+serverId).then((server: Server) => {
(window as any).open(`http://${server.host}:${server.port}/docs`);
});
}
checkIfUserIsLoginPage() { checkIfUserIsLoginPage() {
if (this.router.url.includes("login")) { if (this.router.url.includes("login")) {
this.isLoginPage = true; this.isLoginPage = true;