From 864bb8427090cbb40dd350e821b657dc898dc738 Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Tue, 8 Oct 2019 00:21:02 -0700 Subject: [PATCH] Update export-config-action.component.ts --- .../actions/export-config/export-config-action.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/project-map/context-menu/actions/export-config/export-config-action.component.ts b/src/app/components/project-map/context-menu/actions/export-config/export-config-action.component.ts index c3fc4945..204a6ee1 100644 --- a/src/app/components/project-map/context-menu/actions/export-config/export-config-action.component.ts +++ b/src/app/components/project-map/context-menu/actions/export-config/export-config-action.component.ts @@ -25,7 +25,11 @@ export class ExportConfigActionComponent { const element = document.createElement('a'); const fileType = 'text/plain'; element.setAttribute('href', `data:${fileType};charset=utf-8,${encodeURIComponent(config)}`); - element.setAttribute('download', `${this.node.name}_startup.vpc`); + if (this.node.node_type === 'vpcs') { + element.setAttribute('download', `${this.node.name}_startup.vpc`); + } else if (this.node.node_type === 'iou' || this.node.node_type === 'dynamips') { + element.setAttribute('download', `${this.node.name}_startup.cfg`); + } var event = new MouseEvent("click"); element.dispatchEvent(event);