Support multiple standalone Proxmox hosts with shared credentials
Comma-separated host list logs into every host, merges VM lists tagged by origin host, and routes SPICE connections to the right one. Also adds a username format hint (user@realm) on the login form.
This commit is contained in:
@@ -17,12 +17,14 @@
|
||||
|
||||
<form id="loginForm" autocomplete="on">
|
||||
<div class="field">
|
||||
<label for="host">Proxmox Host</label>
|
||||
<label for="host">Proxmox Host(s)</label>
|
||||
<input type="text" id="host" placeholder="pve.example.com" autocomplete="url" spellcheck="false">
|
||||
<div class="field-hint">Mehrere eigenständige Hosts mit denselben Zugangsdaten? Mit Komma trennen, z. B. pve1.example.com, pve2.example.com</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="username">Benutzer</label>
|
||||
<input type="text" id="username" placeholder="user@pam" autocomplete="username" spellcheck="false">
|
||||
<input type="text" id="username" placeholder="root@pam" autocomplete="username" spellcheck="false">
|
||||
<div class="field-hint">Format: Benutzer@Realm — z. B. root@pam</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="password">Passwort</label>
|
||||
|
||||
@@ -76,6 +76,13 @@ body.login-page {
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.field-hint {
|
||||
font-size: 0.72rem;
|
||||
color: var(--muted);
|
||||
margin-top: 0.35rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: 100%;
|
||||
|
||||
+11
-2
@@ -91,6 +91,9 @@ loadVMs();
|
||||
// ── Render ────────────────────────────────────────────────
|
||||
|
||||
function renderList(vms) {
|
||||
// Only show the host when there's more than one — single-host setups don't need the noise.
|
||||
const multiHost = new Set(vms.map((vm) => vm.host)).size > 1;
|
||||
|
||||
listEl.innerHTML = vms
|
||||
.map(
|
||||
(vm) => `
|
||||
@@ -99,12 +102,13 @@ function renderList(vms) {
|
||||
<div class="vm-name">${esc(vm.name)}</div>
|
||||
<div class="vm-meta">
|
||||
<span class="status-dot"></span>
|
||||
Läuft · Node: ${esc(vm.node)} · ID: ${vm.vmid}
|
||||
Läuft · ${multiHost ? `Host: ${esc(vm.host)} · ` : ''}Node: ${esc(vm.node)} · ID: ${vm.vmid}
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="btn-connect"
|
||||
data-vmid="${vm.vmid}"
|
||||
data-host="${esc(vm.host)}"
|
||||
data-node="${esc(vm.node)}"
|
||||
data-name="${esc(vm.name)}"
|
||||
>Verbinden</button>
|
||||
@@ -115,7 +119,12 @@ function renderList(vms) {
|
||||
|
||||
listEl.querySelectorAll('.btn-connect').forEach((btn) => {
|
||||
btn.addEventListener('click', () =>
|
||||
connectVM({ vmid: btn.dataset.vmid, node: btn.dataset.node, name: btn.dataset.name })
|
||||
connectVM({
|
||||
vmid: btn.dataset.vmid,
|
||||
host: btn.dataset.host,
|
||||
node: btn.dataset.node,
|
||||
name: btn.dataset.name,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user