mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 15:40:29 +00:00
Merge branch 'master' into Create-templates-from-appliances
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user