refactor(webui): separate backup component into sub-system folders
backup/ held 15 loose .js plus css/html at the component root. Split into
per-tab sub-systems mirroring the admin/apps layout:
backup/core/{js,css,html}/ schema, base BackupPage, fetch-client,
cron-schedule, backup.css, backup-content.html
backup/dashboard/js/ backup-dashboard
backup/snapshots/js/ backup-snapshots, backup-snapshot-actions
backup/locations/js/ backup-locations, backup-location-fields,
backup-location-modal, backup-ssh-key
backup/migrate/js/ backup-migrate
backup/configuration/js/ backup-configuration, backup-retention-presets,
backup-engine-details
Updated the scripts[] array + loadFragment in index.js, the backup.css href in
index.html, and the handleBackup() fallback paths in spa.js. No behaviour
change — files moved verbatim (prototype-augment clusters), all 17 referenced
paths verified to resolve, node --check clean.
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
parent
be7f45def9
commit
939f0223fb
@ -13,29 +13,30 @@ LP.features.register({
|
||||
id: 'backup',
|
||||
routes: ['/backup', '/backup*'],
|
||||
// Controllers the feature needs; lazy-loaded on first mount (idempotent).
|
||||
// Controllers, organised by sub-system (tabs). core/ first: schema + base
|
||||
// class + the shared data/cron, then each tab's prototype-augment clusters.
|
||||
scripts: [
|
||||
'/components/backup/js/backup-schema.js',
|
||||
'/components/backup/js/backup-page.js', // base: class + constructor + init/switchTab/render
|
||||
// prototype-augment clusters (load after the base, order among them is free):
|
||||
'/components/backup/js/backup-fetch-client.js',
|
||||
'/components/backup/js/backup-dashboard.js',
|
||||
'/components/backup/js/backup-snapshots.js',
|
||||
'/components/backup/js/backup-locations.js',
|
||||
'/components/backup/js/backup-location-fields.js',
|
||||
'/components/backup/js/backup-ssh-key.js',
|
||||
'/components/backup/js/backup-retention-presets.js',
|
||||
'/components/backup/js/backup-configuration.js',
|
||||
'/components/backup/js/backup-engine-details.js',
|
||||
'/components/backup/js/backup-location-modal.js',
|
||||
'/components/backup/js/backup-snapshot-actions.js',
|
||||
'/components/backup/js/backup-migrate.js',
|
||||
'/components/backup/js/backup-cron-schedule.js',
|
||||
'/components/backup/core/js/backup-schema.js',
|
||||
'/components/backup/core/js/backup-page.js', // base: class + constructor + init/switchTab/render
|
||||
'/components/backup/core/js/backup-fetch-client.js',
|
||||
'/components/backup/core/js/backup-cron-schedule.js',
|
||||
'/components/backup/dashboard/js/backup-dashboard.js',
|
||||
'/components/backup/snapshots/js/backup-snapshots.js',
|
||||
'/components/backup/snapshots/js/backup-snapshot-actions.js',
|
||||
'/components/backup/locations/js/backup-locations.js',
|
||||
'/components/backup/locations/js/backup-location-fields.js',
|
||||
'/components/backup/locations/js/backup-location-modal.js',
|
||||
'/components/backup/locations/js/backup-ssh-key.js',
|
||||
'/components/backup/migrate/js/backup-migrate.js',
|
||||
'/components/backup/configuration/js/backup-configuration.js',
|
||||
'/components/backup/configuration/js/backup-retention-presets.js',
|
||||
'/components/backup/configuration/js/backup-engine-details.js',
|
||||
'/core/lib/backup-app-card.js',
|
||||
],
|
||||
|
||||
async mount(ctx) {
|
||||
await ctx.loadScripts(this.scripts);
|
||||
const html = await ctx.loadFragment('/components/backup/html/backup-content.html');
|
||||
const html = await ctx.loadFragment('/components/backup/core/html/backup-content.html');
|
||||
ctx.setContent(html, 'Backups');
|
||||
if (typeof BackupPage === 'undefined') {
|
||||
throw new Error('BackupPage controller failed to load');
|
||||
|
||||
@ -370,10 +370,10 @@ class LibrePortalSPAClean {
|
||||
// backup-page.js + backup-app-card.js are loaded on first navigation.
|
||||
// loadScript is idempotent — subsequent /backup navigations are no-ops.
|
||||
await Promise.all([
|
||||
this.loadScript('/components/backup/js/backup-page.js'),
|
||||
this.loadScript('/components/backup/core/js/backup-page.js'),
|
||||
this.loadScript('/core/lib/backup-app-card.js')
|
||||
]);
|
||||
const html = await this.fetchContent('/components/backup/html/backup-content.html');
|
||||
const html = await this.fetchContent('/components/backup/core/html/backup-content.html');
|
||||
this.loadContent(html, 'Backups');
|
||||
if (typeof BackupPage !== 'undefined') {
|
||||
window.backupPage = new BackupPage();
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<link rel="stylesheet" href="/core/css/style.css">
|
||||
<link rel="stylesheet" href="/components/admin/config/css/ip-whitelist.css">
|
||||
<link rel="stylesheet" href="/components/apps/port-manager/css/port-manager.css">
|
||||
<link rel="stylesheet" href="/components/backup/css/backup.css">
|
||||
<link rel="stylesheet" href="/components/backup/core/css/backup.css">
|
||||
<link rel="stylesheet" href="/components/admin/ssh/css/ssh.css">
|
||||
<link rel="stylesheet" href="/components/admin/core/css/admin.css">
|
||||
<link rel="stylesheet" href="/components/apps/services/css/services.css">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user