// Auto-extracted from backup-page.js (verbatim) — augments BackupPage.prototype. Loaded after the base. Object.assign(BackupPage.prototype, { renderLocations() { const list = document.getElementById('backup-location-list'); const repoSelect = document.getElementById('backup-snapshot-repo'); if (!list) return; const locs = this.locations?.locations || []; if (!locs.length) { list.innerHTML = `
Delete location ${this.escape(name)}?
Backup data already stored at this location is not deleted — only LibrePortal's reference to it. The password file on disk also stays in place.
`; modal.dataset.locIdx = String(idx); modal.classList.add('open'); }, async confirmDeleteLocation() { const modal = document.getElementById('backup-delete-location-modal'); if (!modal) return; const idx = parseInt(modal.dataset.locIdx, 10); this.closeAllModals(); this.expandedLocs.delete(idx); await this.runTask(`libreportal backup location remove ${idx}`, 'backup', null); setTimeout(() => this.reloadAfterSave(), 2000); }, async setLocationEnabled(idx, enabled) { const encoded = `CFG_BACKUP_LOC_${idx}_ENABLED=${enabled ? 'true' : 'false'}`; try { if (!window.tasksManager?.router) throw new Error('Task system not available'); await window.tasksManager.router.routeAction('config_update', { changes: `'${encoded.replace(/'/g, "'\\''")}'` }); this.notify(`${enabled ? 'Enabling' : 'Disabling'} this location…`, 'success'); setTimeout(() => this.reloadAfterSave(), 2500); } catch (err) { this.notify(`Save failed: ${err.message || err}`, 'error'); } }, });