mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-01 08:48:04 +00:00
Action created
This commit is contained in:
parent
031291612f
commit
528842b713
@ -191,6 +191,7 @@ import { DuplicateActionComponent } from './components/project-map/context-menu/
|
|||||||
import { MapSettingService } from './services/mapsettings.service';
|
import { MapSettingService } from './services/mapsettings.service';
|
||||||
import { ProjectMapMenuComponent } from './components/project-map/project-map-menu/project-map-menu.component';
|
import { ProjectMapMenuComponent } from './components/project-map/project-map-menu/project-map-menu.component';
|
||||||
import { HelpComponent } from './components/help/help.component';
|
import { HelpComponent } from './components/help/help.component';
|
||||||
|
import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
||||||
@ -312,7 +313,8 @@ if (environment.production) {
|
|||||||
ConsoleComponent,
|
ConsoleComponent,
|
||||||
NodesMenuComponent,
|
NodesMenuComponent,
|
||||||
ProjectMapMenuComponent,
|
ProjectMapMenuComponent,
|
||||||
HelpComponent
|
HelpComponent,
|
||||||
|
BringToFrontActionComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -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"
|
[nodes]="nodes"
|
||||||
[drawings]="drawings"
|
[drawings]="drawings"
|
||||||
></app-move-layer-down-action>
|
></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
|
<app-start-capture-action
|
||||||
*ngIf="!projectService.isReadOnly(project) && isBundledServer
|
*ngIf="!projectService.isReadOnly(project) && isBundledServer
|
||||||
&& drawings.length===0 && nodes.length===0 && links.length===1"
|
&& drawings.length===0 && nodes.length===0 && links.length===1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user