Merge branch 'master' into Create-templates-from-appliances

This commit is contained in:
piotrpekala7
2020-06-15 12:21:30 +02:00
43 changed files with 488 additions and 186 deletions

View File

@ -68,6 +68,7 @@ import { NotificationService } from '../../services/notification.service';
import { ThemeService } from '../../services/theme.service';
import { Title } from '@angular/platform-browser';
import { NewTemplateDialogComponent } from './new-template-dialog/new-template-dialog.component';
import { NodeConsoleService } from '../../services/nodeConsole.service';
@Component({
@ -157,7 +158,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
private bottomSheet: MatBottomSheet,
private notificationService: NotificationService,
private themeService: ThemeService,
private title: Title
private title: Title,
private nodeConsoleService: NodeConsoleService
) {}
ngOnInit() {
@ -435,6 +437,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
if(!nodeAddedEvent) {
return;
}
this.progressService.activate();
this.nodeService.createFromTemplate(this.server, this.project, nodeAddedEvent.template, nodeAddedEvent.x, nodeAddedEvent.y, nodeAddedEvent.server).subscribe((node: Node) => {
// if (nodeAddedEvent.name !== nodeAddedEvent.template.name) {
// node.name = nodeAddedEvent.name;
@ -453,6 +457,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
nodeAddedEvent.x = nodeAddedEvent.x + 50 < this.project.scene_width/2 ? nodeAddedEvent.x + 50 : nodeAddedEvent.x;
nodeAddedEvent.y = nodeAddedEvent.y + 50 < this.project.scene_height/2 ? nodeAddedEvent.y + 50 : nodeAddedEvent.y;
this.onNodeCreation(nodeAddedEvent);
} else {
this.progressService.deactivate();
}
});
});
@ -864,7 +870,9 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
}
public ngOnDestroy() {
this.nodeConsoleService.openConsoles = 0;
this.title.setTitle('GNS3 Web UI');
this.drawingsDataSource.clear();
this.nodesDataSource.clear();
this.linksDataSource.clear();