Compare commits

...

2 Commits

Author SHA1 Message Date
librelad
55eecd6dfe Merge claude/1 2026-05-30 02:10:09 +01:00
librelad
eaafd1bb38 refactor(webui): relocate admin area into features/admin/ + shared extractions
- features/admin/: the 10 admin-owned config controllers, the 5 admin pages
  (overview/system/charts/metric/storage), ssh-page.js, peers-page.js, plus
  admin.css/ip-whitelist.css/ssh.css (eager). config-manager.js kept last in
  the load order (it news the sub-managers).
- shared/js/: config-shared.js + config-options.js (ConfigShared/ConfigOptions
  globals consumed cross-feature by backup/apps/tasks).
- shared/css/: forms.css + config.css (generic form + config-form primitives
  borrowed by apps/backup/admin).
- Updated all path strings in system-loader.js (config component) and
  config-manager.js (lazyLoad of admin/ssh/peers controllers); index.html CSS
  hrefs. No /js/components/{config,admin,ssh,peers}/ refs remain.

js/components/ now holds only shared UI (topbar, notifications, eo-modal,
update-notifier, mobile-menu, confirmation-dialog).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-30 02:10:09 +01:00
26 changed files with 25 additions and 25 deletions

View File

@ -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('/js/components/admin/admin-overview.js'),
lazyLoad('/js/components/admin/charts.js')
lazyLoad('/features/admin/admin-overview.js'),
lazyLoad('/features/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('/js/components/ssh/ssh-page.js');
await lazyLoad('/features/admin/ssh-page.js');
if (typeof SshPage !== 'undefined') {
window.sshPage = new SshPage('config-section');
await window.sshPage.init();
@ -76,7 +76,7 @@ if (typeof window.ConfigManager === 'undefined') {
// we inject its content template, then init PeersPage.
if (category === 'peers') {
try { this.sidebar.populateSidebar(); } catch (e) {}
await lazyLoad('/js/components/peers/peers-page.js');
await lazyLoad('/features/admin/peers-page.js');
try {
const html = await fetch('/html/peers-content.html').then(r => r.text());
configSection.innerHTML = html;
@ -100,10 +100,10 @@ if (typeof window.ConfigManager === 'undefined') {
if (category === 'system') {
try { this.sidebar.populateSidebar(); } catch (e) {}
await Promise.all([
lazyLoad('/js/components/admin/charts.js'),
lazyLoad('/js/components/admin/admin-system.js'),
lazyLoad('/js/components/admin/system-metric-page.js'),
lazyLoad('/js/components/admin/system-storage-page.js')
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')
]);
if (typeof AdminSystem !== 'undefined') {
window.adminSystem = new AdminSystem('config-section');

View File

@ -16,11 +16,11 @@
<link rel="stylesheet" href="/css/loading-screen.css">
<link rel="stylesheet" href="/css/setup-wizard.css">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/ip-whitelist.css">
<link rel="stylesheet" href="/features/admin/ip-whitelist.css">
<link rel="stylesheet" href="/features/apps/port-manager.css">
<link rel="stylesheet" href="/features/backup/backup.css">
<link rel="stylesheet" href="/css/ssh.css">
<link rel="stylesheet" href="/css/admin.css">
<link rel="stylesheet" href="/features/admin/ssh.css">
<link rel="stylesheet" href="/features/admin/admin.css">
<link rel="stylesheet" href="/features/apps/services.css">
<link rel="stylesheet" href="/css/modal.css">
<link rel="stylesheet" href="/features/apps/tools.css">
@ -31,8 +31,8 @@
<link rel="stylesheet" href="/css/sidebar.css">
<link rel="stylesheet" href="/features/apps/apps-layout.css">
<link rel="stylesheet" href="/features/apps/apps.css">
<link rel="stylesheet" href="/css/forms.css">
<link rel="stylesheet" href="/css/config.css">
<link rel="stylesheet" href="/shared/css/forms.css">
<link rel="stylesheet" href="/shared/css/config.css">
<link rel="stylesheet" href="/features/apps/service-buttons.css">
<link rel="stylesheet" href="/features/dashboard/dashboard.css">
<link rel="stylesheet" href="/features/tasks/tasks.css">

View File

@ -39,18 +39,18 @@ class SystemLoader {
global: 'configManager',
dependencies: ['data'],
scripts: [
'/js/components/config/config-options.js',
'/js/components/config/config-shared.js',
'/js/components/config/config-validator.js',
'/js/components/config/toggle-manager.js',
'/js/components/config/config-core.js',
'/js/components/config/domain-manager.js',
'/js/components/config/ip-whitelist-manager.js',
'/js/components/config/config-renderer.js',
'/js/components/config/config-sidebar.js',
'/js/components/config/config-form.js',
'/js/components/config/config-utils.js',
'/js/components/config/config-manager.js'
'/shared/js/config-options.js',
'/shared/js/config-shared.js',
'/features/admin/config-validator.js',
'/features/admin/toggle-manager.js',
'/features/admin/config-core.js',
'/features/admin/domain-manager.js',
'/features/admin/ip-whitelist-manager.js',
'/features/admin/config-renderer.js',
'/features/admin/config-sidebar.js',
'/features/admin/config-form.js',
'/features/admin/config-utils.js',
'/features/admin/config-manager.js'
]
});