From 64bef67a0ea2a784cdcfe3deaec7f52ae5229f90 Mon Sep 17 00:00:00 2001 From: GnomeZworc Date: Tue, 2 Jun 2026 23:24:50 +0200 Subject: [PATCH] web: start: clean some code Signed-off-by: GnomeZworc --- .gitignore | 5 + web/components.json | 9 -- web/components/api-client/api-client.js | 1 - web/components/date-display/date-display.js | 3 - web/components/login-gate/login-gate.js | 5 - web/config.json | 5 - web/core/config.js | 6 - web/navigation.json | 29 ---- web/pages.json | 34 ----- web/vpc.html | 140 -------------------- 10 files changed, 5 insertions(+), 232 deletions(-) delete mode 100644 web/components.json delete mode 100644 web/config.json delete mode 100644 web/core/config.js delete mode 100644 web/navigation.json delete mode 100644 web/pages.json delete mode 100644 web/vpc.html diff --git a/.gitignore b/.gitignore index 68ae417..594473d 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,8 @@ go.work.sum # ignore local info data/ + + +web/components.json +web/navigation.json +web/pages.json diff --git a/web/components.json b/web/components.json deleted file mode 100644 index 8377a10..0000000 --- a/web/components.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "components/login-gate/login-gate.js", - "components/api-client/api-client.js", - "components/side-nav/side-nav.js", - "components/logout-button/logout-button.js", - "components/side-panel/side-panel.js", - "components/date-display/date-display.js", - "components/form-vm/form-vm.js" -] diff --git a/web/components/api-client/api-client.js b/web/components/api-client/api-client.js index 1d4c104..4973e1e 100644 --- a/web/components/api-client/api-client.js +++ b/web/components/api-client/api-client.js @@ -12,7 +12,6 @@ // await api.agent.delete('/vpcs/vp-admin') // await api.agent.waitFor('/vms/i-test1', 'started') // -// Credentials come from .ready — no direct config.json dependency. // Phase 2: swap login-gate for oidc-gate → this component unchanged. export class ApiError extends Error { diff --git a/web/components/date-display/date-display.js b/web/components/date-display/date-display.js index c008c93..38f5598 100644 --- a/web/components/date-display/date-display.js +++ b/web/components/date-display/date-display.js @@ -1,5 +1,3 @@ -import { config } from '../../core/config.js' - const CSS = new URL('./date-display.css', import.meta.url).href class DateDisplay extends HTMLElement { @@ -14,7 +12,6 @@ class DateDisplay extends HTMLElement {
agent →
` - this.shadowRoot.getElementById('agent-url').textContent = config.agent_url this.#tick() this.#interval = setInterval(() => this.#tick(), 1000) } diff --git a/web/components/login-gate/login-gate.js b/web/components/login-gate/login-gate.js index 1de65de..2596c6e 100644 --- a/web/components/login-gate/login-gate.js +++ b/web/components/login-gate/login-gate.js @@ -44,12 +44,7 @@ class LoginGate extends HTMLElement { return } - // Load config.json defaults to pre-fill the form let defaults = {} - try { - const r = await fetch('./config.json') - if (r.ok) defaults = await r.json() - } catch { /* no defaults */ } this.#renderOverlay(defaults) } diff --git a/web/config.json b/web/config.json deleted file mode 100644 index bf6e218..0000000 --- a/web/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "netbox_url": "http://netbox.local", - "netbox_token": "your-token-here", - "agent_url": "http://127.0.0.1:8080" -} diff --git a/web/core/config.js b/web/core/config.js deleted file mode 100644 index 21618e4..0000000 --- a/web/core/config.js +++ /dev/null @@ -1,6 +0,0 @@ -// Single source of truth for configuration. -// Phase 2: replace the fetch with a call to the orchestrator. -const response = await fetch('./config.json') -if (!response.ok) throw new Error('Failed to load config.json') - -export const config = await response.json() diff --git a/web/navigation.json b/web/navigation.json deleted file mode 100644 index 773cf36..0000000 --- a/web/navigation.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "label": "Dashboard", - "href": "#/dashboard", - "icon": "dashboard" - }, - { - "type": "section", - "label": "Réseau" - }, - { - "label": "VPCs", - "href": "#/vpcs", - "icon": "vpc" - }, - { - "label": "Subnets", - "href": "#/subnets", - "icon": "subnet" - }, - { - "type": "separator" - }, - { - "label": "VMs", - "href": "#/vms", - "icon": "vm" - } -] diff --git a/web/pages.json b/web/pages.json deleted file mode 100644 index e018e51..0000000 --- a/web/pages.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "route": "dashboard", - "label": "Dashboard", - "icon": "dashboard", - "html": "pages/dashboard/index.html", - "css": "pages/dashboard/dashboard.css", - "js": "pages/dashboard/dashboard.js" - }, - { - "route": "vpcs", - "label": "VPCs", - "icon": "vpc", - "html": "pages/vpcs/index.html", - "css": null, - "js": null - }, - { - "route": "subnets", - "label": "Subnets", - "icon": "subnet", - "html": "pages/subnets/index.html", - "css": null, - "js": null - }, - { - "route": "vms", - "label": "VMs", - "icon": "vm", - "html": "pages/vms/index.html", - "css": null, - "js": null - } -] diff --git a/web/vpc.html b/web/vpc.html deleted file mode 100644 index 0961b64..0000000 --- a/web/vpc.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - two — dashboard - - - - - - - - -
-

two

- network orchestrator -
- -
- -
- - -
-
- - - -
- - -
-
-
- - - - -