mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 15:40:29 +00:00
Merge branch 'master' into Support-for-global-variables
This commit is contained in:
@ -9,6 +9,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="Usage instructions">
|
||||
<div class="textBox">
|
||||
{{usage}}
|
||||
</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="Command line">
|
||||
<div class="textBox">
|
||||
{{commandLine}}
|
||||
|
@ -13,6 +13,7 @@ export class InfoDialogComponent implements OnInit {
|
||||
@Input() server: Server;
|
||||
@Input() node: Node;
|
||||
infoList: string[] = [];
|
||||
usage: string = '';
|
||||
commandLine: string = '';
|
||||
|
||||
constructor(
|
||||
@ -23,6 +24,7 @@ export class InfoDialogComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.infoList = this.infoService.getInfoAboutNode(this.node, this.server);
|
||||
this.commandLine = this.infoService.getCommandLine(this.node);
|
||||
this.usage = this.node.usage ? this.node.usage : `No usage information has been provided for this node.`;
|
||||
}
|
||||
|
||||
onCloseClick() {
|
||||
|
@ -2,6 +2,7 @@
|
||||
<app-d3-map
|
||||
*ngIf="!settings.angular_map"
|
||||
[server]="server"
|
||||
[project]="project"
|
||||
[symbols]="symbols"
|
||||
[nodes]="nodes"
|
||||
[links]="links"
|
||||
@ -92,6 +93,12 @@
|
||||
</mat-checkbox>
|
||||
<mat-checkbox [ngModel]="layersVisibility" (change)="toggleLayers($event.checked)">
|
||||
Show layers
|
||||
</mat-checkbox><br/>
|
||||
<mat-checkbox [ngModel]="gridVisibility" (change)="toggleGrid($event.checked)">
|
||||
Show grid
|
||||
</mat-checkbox><br/>
|
||||
<mat-checkbox [ngModel]="project.snap_to_grid" (change)="toggleSnapToGrid($event.checked)">
|
||||
Snap to grid
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</mat-menu>
|
||||
@ -154,11 +161,11 @@
|
||||
<app-project-map-shortcuts *ngIf="project" [project]="project" [server]="server"></app-project-map-shortcuts>
|
||||
<app-draw-link-tool [links]="links" *ngIf="tools.draw_link"></app-draw-link-tool>
|
||||
|
||||
<app-drawing-dragged [server]="server"></app-drawing-dragged>
|
||||
<app-drawing-dragged [server]="server" [project]="project"></app-drawing-dragged>
|
||||
<app-drawing-resized [server]="server"></app-drawing-resized>
|
||||
<app-interface-label-dragged [server]="server"></app-interface-label-dragged>
|
||||
<app-link-created [server]="server" [project]="project"></app-link-created>
|
||||
<app-node-dragged [server]="server"></app-node-dragged>
|
||||
<app-node-dragged [server]="server" [project]="project"></app-node-dragged>
|
||||
<app-node-label-dragged [server]="server"></app-node-label-dragged>
|
||||
<app-text-added [server]="server" [project]="project" (drawingSaved)="onDrawingSaved()"> </app-text-added>
|
||||
<app-text-edited [server]="server"></app-text-edited>
|
||||
|
@ -144,7 +144,7 @@ export class MockedDrawingService {
|
||||
return of(drawing);
|
||||
}
|
||||
|
||||
updatePosition(_server: Server, _drawing: Drawing, _x: number, _y: number) {
|
||||
updatePosition(_server: Server, _project: Project, _drawing: Drawing, _x: number, _y: number) {
|
||||
return of(this.drawing);
|
||||
}
|
||||
|
||||
|
@ -84,6 +84,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
public isInterfaceLabelVisible: boolean = false;
|
||||
public notificationsVisibility: boolean = false;
|
||||
public layersVisibility: boolean = false;
|
||||
public gridVisibility: boolean = false;
|
||||
|
||||
tools = {
|
||||
selection: true,
|
||||
@ -240,6 +241,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.notificationsVisibility = localStorage.getItem('notificationsVisibility') === 'true' ? true : false;
|
||||
this.layersVisibility = localStorage.getItem('layersVisibility') === 'true' ? true : false;
|
||||
this.gridVisibility = localStorage.getItem('gridVisibility') === 'true' ? true : false;
|
||||
this.addKeyboardListeners();
|
||||
}
|
||||
|
||||
@ -492,6 +494,20 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
this.mapChild.applyMapSettingsChanges();
|
||||
}
|
||||
|
||||
public toggleGrid(visible: boolean) {
|
||||
this.gridVisibility = visible;
|
||||
if (this.gridVisibility) {
|
||||
localStorage.setItem('gridVisibility', 'true');
|
||||
} else {
|
||||
localStorage.removeItem('gridVisibility');
|
||||
}
|
||||
this.mapChild.gridVisibility = this.gridVisibility ? 1 : 0;
|
||||
}
|
||||
|
||||
public toggleSnapToGrid(enabled: boolean) {
|
||||
this.project.snap_to_grid = enabled;
|
||||
}
|
||||
|
||||
private showMessage(msg) {
|
||||
if (this.notificationsVisibility) {
|
||||
if (msg.type === 'error') this.toasterService.error(msg.message);
|
||||
|
Reference in New Issue
Block a user