Always render VM list; surface SPICE connect target for diagnosis
- Auto-connect (single-VM shortcut and autostart match) now renders the VM list first instead of skipping straight to the connect attempt. With cluster dedup collapsing 3 duplicate entries down to 1, the VM vanished from the screen entirely whenever the connection failed. - proxmox:connect now returns the resolved host:port it handed to remote-viewer, shown in the success notice, so connection failures (e.g. Proxmox handing out a cluster-internal node address the client cannot route to) can be diagnosed without racing delete-this-file.
This commit is contained in:
+8
-3
@@ -222,9 +222,9 @@ ipcMain.handle('proxmox:connect', async (_e, { host, node, vmid }) => {
|
||||
const entry = clients.find((c) => c.host === host) || clients[0];
|
||||
if (!entry) throw new Error('Nicht angemeldet.');
|
||||
const params = await entry.client.getSpiceTicket(node, vmid);
|
||||
const vvPath = buildVVFile(params, vmid, entry.client);
|
||||
const { vvPath, target } = buildVVFile(params, vmid, entry.client);
|
||||
launchRemoteViewer(vvPath);
|
||||
return { success: true };
|
||||
return { success: true, target };
|
||||
} catch (err) {
|
||||
return { success: false, error: err.message };
|
||||
}
|
||||
@@ -290,7 +290,12 @@ function buildVVFile(params, vmid, client) {
|
||||
|
||||
const vvPath = path.join(os.tmpdir(), `spice-${vmid}-${Date.now()}.vv`);
|
||||
fs.writeFileSync(vvPath, lines.join('\n') + '\n', { mode: 0o600 });
|
||||
return vvPath;
|
||||
|
||||
// Surfaced to the renderer so a failed connection (e.g. Proxmox handing out
|
||||
// a cluster-internal node address the client can't route to) is diagnosable
|
||||
// without having to catch the .vv file before remote-viewer deletes it.
|
||||
const port = params['tls-port'] || params.port || '?';
|
||||
return { vvPath, target: `${host}:${port}` };
|
||||
}
|
||||
|
||||
// VirtViewer's Windows installer names its folder after the bundled version
|
||||
|
||||
Reference in New Issue
Block a user