(vm: VmListItem)
| 1373 | } |
| 1374 | |
| 1375 | async function removeVm(vm: VmListItem) { |
| 1376 | if (dangerConfirmEnabled() && |
| 1377 | !confirm('Remove VM? This action cannot be undone.')) { |
| 1378 | return; |
| 1379 | } |
| 1380 | |
| 1381 | try { |
| 1382 | if (devMode.value && vm.status === 'running') { |
| 1383 | try { |
| 1384 | await vmmRpc.stopVm({ id: vm.id }); |
| 1385 | } catch (error) { |
| 1386 | recordError(`Failed to stop ${vm.name} before removal`, error); |
| 1387 | return; |
| 1388 | } |
| 1389 | } |
| 1390 | |
| 1391 | await vmmRpc.removeVm({ id: vm.id }); |
| 1392 | loadVMList(); |
| 1393 | } catch (error) { |
| 1394 | recordError(`Failed to remove ${vm.name}`, error); |
| 1395 | } |
| 1396 | } |
| 1397 | |
| 1398 | function showLogs(id: string, channel: string) { |
| 1399 | window.open(`/logs?id=${encodeURIComponent(id)}&follow=true&ansi=false&lines=200&ch=${channel}`, '_blank'); |
nothing calls this directly
no test coverage detected