mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-19 07:18:14 +00:00
Link to the API doc in the menu
This commit is contained in:
@ -39,6 +39,10 @@
|
||||
<mat-icon>person</mat-icon>
|
||||
<span>User info</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="goToDocumentation()">
|
||||
<mat-icon>person</mat-icon>
|
||||
<span>API documentation</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="logout()">
|
||||
<mat-icon>highlight_off</mat-icon>
|
||||
<span>Logout</span>
|
||||
|
@ -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() {
|
||||
if (this.router.url.includes("login")) {
|
||||
this.isLoginPage = true;
|
||||
|
Reference in New Issue
Block a user