mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-24 15:16:38 +00:00
Option to close project from map menu added
This commit is contained in:
parent
fabfff2e8f
commit
47cc51a68d
@ -71,6 +71,10 @@
|
|||||||
<mat-icon>call_received</mat-icon>
|
<mat-icon>call_received</mat-icon>
|
||||||
<span>Import portable project</span>
|
<span>Import portable project</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button mat-menu-item (click)="closeProject()">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
<span>Close project</span>
|
||||||
|
</button>
|
||||||
<button mat-menu-item (click)="deleteProject()">
|
<button mat-menu-item (click)="deleteProject()">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
<span>Delete project</span>
|
<span>Delete project</span>
|
||||||
|
@ -218,6 +218,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
this.subscriptions.push(
|
this.subscriptions.push(
|
||||||
this.nodesDataSource.changes.subscribe((nodes: Node[]) => {
|
this.nodesDataSource.changes.subscribe((nodes: Node[]) => {
|
||||||
|
if (!this.server) return;
|
||||||
nodes.forEach((node: Node) => {
|
nodes.forEach((node: Node) => {
|
||||||
node.symbol_url = `http://${this.server.host}:${this.server.port}/v2/symbols/${node.symbol}/raw`;
|
node.symbol_url = `http://${this.server.host}:${this.server.port}/v2/symbols/${node.symbol}/raw`;
|
||||||
});
|
});
|
||||||
@ -769,6 +770,12 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
imageToUpload.src = window.URL.createObjectURL(file);
|
imageToUpload.src = window.URL.createObjectURL(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public closeProject() {
|
||||||
|
this.projectService.close(this.server, this.project.project_id).subscribe(() => {
|
||||||
|
this.router.navigate(['/server', this.server.id, 'projects']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public deleteProject() {
|
public deleteProject() {
|
||||||
this.projectService.delete(this.server, this.project.project_id).subscribe(() => {
|
this.projectService.delete(this.server, this.project.project_id).subscribe(() => {
|
||||||
this.router.navigate(['/server', this.server.id, 'projects']);
|
this.router.navigate(['/server', this.server.id, 'projects']);
|
||||||
|
Loading…
Reference in New Issue
Block a user