CI / Build & Test (push) Failing after 28s
Split monolithic dashboard.js (2753 lines) into 18 focused modules
under dashboard/{core,data,ui,pages}/ with refresh.js and events.js
as orchestrators. Extracted ~900-line inline <style> into dashboard.css
and moved dashboard.html to dashboard/dashboard.html.
Split background.js (609 lines) into background/{logs,state,proxy,
native-messaging,tab-lifecycle,message-router}.js with a thin entry
point using importScripts().
Deleted dead files: wrong-domain.js (duplicate of inline script).
Updated manifest.json web_accessible_resources for new paths.
Updated docs/ARCHITECTURE.md to reflect the new file structure.
No functionality changed. No build step introduced.
32 lines
797 B
JavaScript
32 lines
797 B
JavaScript
// Depends on: all other modules (loaded before this file)
|
|
|
|
/**
|
|
* Guard: only run when loaded as the actual dashboard page.
|
|
*/
|
|
if (!document.getElementById('page-dashboard') && !document.querySelector('.sidebar-logo')) {
|
|
throw new Error('dashboard scripts loaded outside dashboard context — aborting');
|
|
}
|
|
|
|
async function init() {
|
|
log('Dashboard initializing…');
|
|
|
|
try {
|
|
const manifest = chrome.runtime.getManifest();
|
|
const versionEl = $('sidebarVersion');
|
|
if (versionEl && manifest.version) {
|
|
versionEl.textContent = 'v' + manifest.version + ' · hole.sail';
|
|
}
|
|
} catch (_) {}
|
|
|
|
setupNavigation();
|
|
setupEvents();
|
|
setupCertValidator();
|
|
setupSshEvents();
|
|
setupRdpEvents();
|
|
setupBackupEvents();
|
|
await refresh();
|
|
setInterval(refresh, 2000);
|
|
}
|
|
|
|
init();
|