Update export-config-action.component.ts

This commit is contained in:
Piotr Pekala 2019-10-08 00:21:02 -07:00
parent 70f7c54de0
commit 864bb84270

View File

@ -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);