Review fixes

This commit is contained in:
Piotr Pekala
2019-08-22 00:32:28 -07:00
parent c2d5e6fd08
commit 8ad744213b
3 changed files with 14 additions and 3 deletions

View File

@ -475,10 +475,13 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
exportProject() {
if (this.nodes.filter(node => node.node_type === 'virtualbox').length > 0) {
this.toasterService.error('Map with VirtualBox machines cannot be exported.')
} else if (this.nodes.filter(node => node.status === 'started').length > 0) {
} else if (this.nodes.filter(node =>
(node.status === 'started' && node.node_type==='vpcs') ||
(node.status === 'started' && node.node_type==='virtualbox') ||
(node.status === 'started' && node.node_type==='vmware')).length > 0) {
this.toasterService.error('Project with running nodes cannot be exported.')
} else {
window.location.href = `http://${this.server.host}:${this.server.port}/v2/projects/${this.project.project_id}/export`;
location.assign(this.projectService.getExportPath(this.server, this.project));
}
}