clean old code
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
e4bc3cce4f
commit
9b5856f3c3
2 changed files with 2 additions and 62 deletions
|
|
@ -78,15 +78,10 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<login-gate></login-gate>
|
||||
<api-client></api-client>
|
||||
|
||||
<header>
|
||||
<h1>two</h1>
|
||||
<span>network orchestrator</span>
|
||||
<h1>Syn</h1>
|
||||
<span>web framwork</span>
|
||||
<div class="spacer"></div>
|
||||
<logout-button></logout-button>
|
||||
</header>
|
||||
|
||||
<div class="layout">
|
||||
|
|
|
|||
|
|
@ -1,57 +1,2 @@
|
|||
import { SidePanel } from '../../components/side-panel/side-panel.js'
|
||||
|
||||
export function init(main) {
|
||||
main.querySelectorAll('[data-panel-title]').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
SidePanel.open({
|
||||
title: btn.dataset.panelTitle,
|
||||
width: btn.dataset.panelWidth ?? '480px',
|
||||
content: `<p style="color:#a6adc8;font-size:14px;line-height:1.6">
|
||||
Contenu du panneau <strong style="color:#cdd6f4">${btn.dataset.panelTitle}</strong>.<br>
|
||||
Largeur : ${btn.dataset.panelWidth}.<br><br>
|
||||
Tu peux ouvrir plusieurs panneaux — ils s'empilent vers la gauche.
|
||||
Ferme avec ✕, Échap, ou en cliquant le fond.
|
||||
</p>`,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
main.querySelectorAll('[data-action="create-vm"]').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
SidePanel.open({
|
||||
title: 'Nouvelle VM',
|
||||
width: '520px',
|
||||
content: `<form-vm></form-vm>`,
|
||||
})
|
||||
// form-vm gère son propre submit et dispatche vm-saved — pas besoin de querySelector
|
||||
})
|
||||
})
|
||||
|
||||
main.querySelectorAll('[data-action="edit-vm-i-test1"]').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
SidePanel.open({
|
||||
title: 'Modifier i-test1',
|
||||
width: '520px',
|
||||
content: `<form-vm vm-name="i-test1"></form-vm>`
|
||||
})
|
||||
// form-vm gère son propre submit et dispatche vm-saved — pas besoin de querySelector
|
||||
})
|
||||
})
|
||||
|
||||
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 => {
|
||||
console.log('vm-saved', e.detail)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue