diff --git a/containers/libreportal/backend/routes/features.js b/containers/libreportal/backend/routes/features.js index fd5f2e3..5f938e4 100644 --- a/containers/libreportal/backend/routes/features.js +++ b/containers/libreportal/backend/routes/features.js @@ -4,12 +4,12 @@ const path = require('path'); const router = express.Router(); -const FEATURES_DIR = path.join(__dirname, '..', '..', 'frontend', 'features'); +const FEATURES_DIR = path.join(__dirname, '..', '..', 'frontend', 'components'); /* ========================= GET /api/features/list - Walks frontend/features// and returns one entry per directory that + Walks frontend/components// and returns one entry per directory that contains a feature.json β€” the WebUI's page manifest, discovered from the folders themselves (exactly how /api/themes/list discovers themes). Drop a features// folder in and its page appears; delete it and the page is diff --git a/containers/libreportal/frontend/features/admin/admin-overview.js b/containers/libreportal/frontend/components/admin/admin-overview.js similarity index 100% rename from containers/libreportal/frontend/features/admin/admin-overview.js rename to containers/libreportal/frontend/components/admin/admin-overview.js diff --git a/containers/libreportal/frontend/features/admin/admin-system.js b/containers/libreportal/frontend/components/admin/admin-system.js similarity index 98% rename from containers/libreportal/frontend/features/admin/admin-system.js rename to containers/libreportal/frontend/components/admin/admin-system.js index 01337d3..50cd39f 100644 --- a/containers/libreportal/frontend/features/admin/admin-system.js +++ b/containers/libreportal/frontend/components/admin/admin-system.js @@ -401,14 +401,14 @@ class AdminSystem { return `
${this.escape(label)}${this.escape(value)}
`; } - // OS stat with a distro icon (bundled under /icons/os/, generic Linux glyph + // OS stat with a distro icon (bundled under /core/icons/os/, generic Linux glyph // for anything we don't have a logo for). _osStat(os) { const slug = String(os || '').toLowerCase().replace(/[^a-z0-9]/g, '') || 'linux'; return `
OS - + ${this.escape(os || 'β€”')}
`; @@ -430,7 +430,7 @@ class AdminSystem { _cpuStat(cpu) { const raw = String(cpu || ''); const vendor = /amd/i.test(raw) ? 'amd' : /intel/i.test(raw) ? 'intel' : null; - const icon = vendor ? `${vendor}` : ''; + const icon = vendor ? `${vendor}` : ''; return `
CPU ${icon}${this.escape(this._cleanCpu(raw))} diff --git a/containers/libreportal/frontend/features/admin/admin.css b/containers/libreportal/frontend/components/admin/admin.css similarity index 100% rename from containers/libreportal/frontend/features/admin/admin.css rename to containers/libreportal/frontend/components/admin/admin.css diff --git a/containers/libreportal/frontend/features/admin/charts.js b/containers/libreportal/frontend/components/admin/charts.js similarity index 100% rename from containers/libreportal/frontend/features/admin/charts.js rename to containers/libreportal/frontend/components/admin/charts.js diff --git a/containers/libreportal/frontend/html/config-content.html b/containers/libreportal/frontend/components/admin/config-content.html similarity index 100% rename from containers/libreportal/frontend/html/config-content.html rename to containers/libreportal/frontend/components/admin/config-content.html diff --git a/containers/libreportal/frontend/features/admin/config-core.js b/containers/libreportal/frontend/components/admin/config-core.js similarity index 100% rename from containers/libreportal/frontend/features/admin/config-core.js rename to containers/libreportal/frontend/components/admin/config-core.js diff --git a/containers/libreportal/frontend/features/admin/config-form.js b/containers/libreportal/frontend/components/admin/config-form.js similarity index 100% rename from containers/libreportal/frontend/features/admin/config-form.js rename to containers/libreportal/frontend/components/admin/config-form.js diff --git a/containers/libreportal/frontend/features/admin/config-manager.js b/containers/libreportal/frontend/components/admin/config-manager.js similarity index 96% rename from containers/libreportal/frontend/features/admin/config-manager.js rename to containers/libreportal/frontend/components/admin/config-manager.js index c7565d7..881a33a 100755 --- a/containers/libreportal/frontend/features/admin/config-manager.js +++ b/containers/libreportal/frontend/components/admin/config-manager.js @@ -44,8 +44,8 @@ if (typeof window.ConfigManager === 'undefined') { try { this.sidebar.populateSidebar(); } catch (e) {} // charts.js is the chart-rendering helper admin-overview pulls in. await Promise.all([ - lazyLoad('/features/admin/admin-overview.js'), - lazyLoad('/features/admin/charts.js') + lazyLoad('/components/admin/admin-overview.js'), + lazyLoad('/components/admin/charts.js') ]); if (typeof AdminOverview !== 'undefined') { window.adminOverview = new AdminOverview('config-section'); @@ -60,7 +60,7 @@ if (typeof window.ConfigManager === 'undefined') { // a config category β€” render its own controller into the main pane. if (category === 'ssh-access') { try { this.sidebar.populateSidebar(); } catch (e) {} - await lazyLoad('/features/admin/ssh-page.js'); + await lazyLoad('/components/admin/ssh-page.js'); if (typeof SshPage !== 'undefined') { window.sshPage = new SshPage('config-section'); await window.sshPage.init(); @@ -76,9 +76,9 @@ if (typeof window.ConfigManager === 'undefined') { // we inject its content template, then init PeersPage. if (category === 'peers') { try { this.sidebar.populateSidebar(); } catch (e) {} - await lazyLoad('/features/admin/peers-page.js'); + await lazyLoad('/components/admin/peers-page.js'); try { - const html = await fetch('/html/peers-content.html').then(r => r.text()); + const html = await fetch('/components/admin/peers-content.html').then(r => r.text()); configSection.innerHTML = html; } catch (e) { configSection.innerHTML = '
Peers page template failed to load.
'; @@ -100,10 +100,10 @@ if (typeof window.ConfigManager === 'undefined') { if (category === 'system') { try { this.sidebar.populateSidebar(); } catch (e) {} await Promise.all([ - lazyLoad('/features/admin/charts.js'), - lazyLoad('/features/admin/admin-system.js'), - lazyLoad('/features/admin/system-metric-page.js'), - lazyLoad('/features/admin/system-storage-page.js') + lazyLoad('/components/admin/charts.js'), + lazyLoad('/components/admin/admin-system.js'), + lazyLoad('/components/admin/system-metric-page.js'), + lazyLoad('/components/admin/system-storage-page.js') ]); if (typeof AdminSystem !== 'undefined') { window.adminSystem = new AdminSystem('config-section'); @@ -216,7 +216,7 @@ if (typeof window.ConfigManager === 'undefined') { var catIcon = catMeta.icon || category; var headerHTML = '