mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-15 13:28:10 +00:00
Action created
This commit is contained in:
@ -0,0 +1,4 @@
|
||||
<button mat-menu-item (click)="bringToFront()">
|
||||
<mat-icon>vertical_align_top</mat-icon>
|
||||
<span>Bring to front</span>
|
||||
</button>
|
@ -0,0 +1,43 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import { Node } from '../../../../../cartography/models/node';
|
||||
import { NodesDataSource } from '../../../../../cartography/datasources/nodes-datasource';
|
||||
import { NodeService } from '../../../../../services/node.service';
|
||||
import { Drawing } from '../../../../../cartography/models/drawing';
|
||||
import { DrawingsDataSource } from '../../../../../cartography/datasources/drawings-datasource';
|
||||
import { DrawingService } from '../../../../../services/drawing.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bring-to-front-action',
|
||||
templateUrl: './bring-to-front-action.component.html'
|
||||
})
|
||||
export class BringToFrontActionComponent implements OnInit {
|
||||
@Input() server: Server;
|
||||
@Input() nodes: Node[];
|
||||
@Input() drawings: Drawing[];
|
||||
|
||||
constructor(
|
||||
private nodesDataSource: NodesDataSource,
|
||||
private drawingsDataSource: DrawingsDataSource,
|
||||
private nodeService: NodeService,
|
||||
private drawingService: DrawingService
|
||||
) {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
bringToFront() {
|
||||
this.nodes.forEach((node) => {
|
||||
node.z = 100;
|
||||
this.nodesDataSource.update(node);
|
||||
|
||||
this.nodeService.update(this.server, node).subscribe((node: Node) => {});
|
||||
});
|
||||
|
||||
this.drawings.forEach((drawing) => {
|
||||
drawing.z = 100;
|
||||
this.drawingsDataSource.update(drawing);
|
||||
|
||||
this.drawingService.update(this.server, drawing).subscribe((drawing: Drawing) => {});
|
||||
});
|
||||
}
|
||||
}
|
@ -44,6 +44,12 @@
|
||||
[nodes]="nodes"
|
||||
[drawings]="drawings"
|
||||
></app-move-layer-down-action>
|
||||
<app-bring-to-front-action
|
||||
*ngIf="!projectService.isReadOnly(project) && (drawings.length || nodes.length) && labels.length===0"
|
||||
[server]="server"
|
||||
[nodes]="nodes"
|
||||
[drawings]="drawings"
|
||||
></app-bring-to-front-action>
|
||||
<app-start-capture-action
|
||||
*ngIf="!projectService.isReadOnly(project) && isBundledServer
|
||||
&& drawings.length===0 && nodes.length===0 && links.length===1"
|
||||
|
Reference in New Issue
Block a user