mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-02 00:40:27 +00:00
This commit is contained in:
parent
2a96a6b601
commit
c0cff3a6db
@ -383,16 +383,27 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
Mousetrap.bind('del', (event: Event) => {
|
Mousetrap.bind('del', (event: Event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const selected = this.selectionManager.getSelected();
|
this.deleteItems();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
selected
|
deleteItems() {
|
||||||
.filter((item) => item instanceof MapNode)
|
this.bottomSheet.open(ConfirmationBottomSheetComponent);
|
||||||
.forEach((item: MapNode) => {
|
let bottomSheetRef = this.bottomSheet._openedBottomSheetRef;
|
||||||
const node = this.mapNodeToNode.convert(item);
|
bottomSheetRef.instance.message = 'Do you want to delete all selected objects?';
|
||||||
this.nodeService.delete(this.server, node).subscribe((data) => {
|
const bottomSheetSubscription = bottomSheetRef.afterDismissed().subscribe((result: boolean) => {
|
||||||
this.toasterService.success('Node has been deleted');
|
if (result) {
|
||||||
|
const selected = this.selectionManager.getSelected();
|
||||||
|
|
||||||
|
selected
|
||||||
|
.filter((item) => item instanceof MapNode)
|
||||||
|
.forEach((item: MapNode) => {
|
||||||
|
const node = this.mapNodeToNode.convert(item);
|
||||||
|
this.nodeService.delete(this.server, node).subscribe((data) => {
|
||||||
|
this.toasterService.success('Node has been deleted');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user