initial commit
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
commit
81baed85c7
16 changed files with 705 additions and 0 deletions
2
pages/dashboard/dashboard.css
Normal file
2
pages/dashboard/dashboard.css
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/* Styles scoped to the dashboard page.
|
||||
Applied when the route is active, removed on navigation. */
|
||||
57
pages/dashboard/dashboard.js
Normal file
57
pages/dashboard/dashboard.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
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)
|
||||
})
|
||||
}
|
||||
1
pages/dashboard/index.html
Normal file
1
pages/dashboard/index.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
Cecie est la premiere page
|
||||
6
pages/dashboard/manifest.json
Normal file
6
pages/dashboard/manifest.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"route": "dashboard",
|
||||
"label": "Dashboard",
|
||||
"icon": "dashboard",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue