web: start: add vnc-viewer feature

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-06-05 16:35:50 +02:00
commit 14c5f41e2b
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
7 changed files with 261 additions and 8 deletions

View file

@ -38,6 +38,17 @@ export function init(main) {
})
})
main.querySelectorAll('[data-action="console"]').forEach(btn => {
btn.addEventListener('click', () => {
SidePanel.open({
title: 'afficher une consol',
width: '700px',
content: `<vnc-viewer vm="i-test1"></vnc-viewer>`
})
// form-vm gère son propre submit et dispatche vm-saved — pas besoin de querySelector
})
})
// vm-saved est attaché sur main (pas document) → nettoyé automatiquement
// quand le router remplace le contenu de <main>
main.addEventListener('vm-saved', e => {

View file

@ -21,4 +21,9 @@
padding:7px 14px;color:#a6e3a1;font-size:13px;cursor:pointer;">
Edition
</button>
<button data-action="console"
style="background:#313244;border:1px solid #45475a;border-radius:6px;
padding:7px 14px;color:#a6e3a1;font-size:13px;cursor:pointer;">
Ouvrir la console
</button>
</div>