fix: console viewport sizing and add VNC control toolbar
Some checks failed
Backend Tests / pytest (Python 3.12) (push) Failing after 1m22s
Deploy to Production / Trigger production update (push) Failing after 10s
SonarCloud / SonarCloud Analysis (push) Failing after 2m30s

Fix nested h-screen flexbox layout bug that let the noVNC canvas overflow
below the viewport until the browser zoom level was changed (missing
min-h-0 on flex children). Also add a fuller console control bar: power
menu (reboot/shutdown/hard reset/hard stop), extra-keys menu (Ctrl+Alt+Del,
Ctrl+Alt+Backspace, Tab, Esc, Ctrl+Alt+F1-F12), scale toggle, clipboard
paste to guest, and console screenshot. Adds a VM hard-reset backend
action (qemu status/reset) alongside the existing start/stop/restart/shutdown.
This commit is contained in:
markmorado
2026-08-20 02:04:15 +05:00
parent e7291bf23a
commit da8bbce62a
5 changed files with 335 additions and 27 deletions

View File

@@ -41,6 +41,18 @@ class VmMixin:
logger.error(f"Ошибка перезапуска VM {vmid} на {node}: {e}")
return None
def reset_vm(self, node: str, vmid: int) -> Optional[str]:
"""Жёсткий сброс VM (аналог кнопки Reset — без ACPI, без остановки/старта заново)."""
if not self.proxmox:
return None
try:
upid = self.proxmox.nodes(node).qemu(vmid).status.reset.post()
return upid if isinstance(upid, str) else None
except Exception as e:
logger.error(f"Ошибка жёсткого сброса VM {vmid} на {node}: {e}")
return None
def _wait_vm_stopped(self, node: str, vmid: int, timeout: int) -> bool:
"""Опрашивать статус ВМ, пока не 'stopped' или не выйдет timeout секунд."""
deadline = time.time() + timeout