From 52cb47e5c98cb8908ddd2493f376a5e408798953 Mon Sep 17 00:00:00 2001 From: Smittix Date: Wed, 28 Jan 2026 20:30:08 +0000 Subject: [PATCH] refactor: Consolidate settings and dependencies into single modal Merged the two gear icons in the header bar into one unified Settings modal. Added a "Tools" tab to display dependency status, removing the separate dependencies modal and button. Co-Authored-By: Claude Opus 4.5 --- static/js/core/settings-manager.js | 93 ++++++++++++++++ templates/index.html | 141 +------------------------ templates/partials/settings-modal.html | 30 ++++++ 3 files changed, 124 insertions(+), 140 deletions(-) diff --git a/static/js/core/settings-manager.js b/static/js/core/settings-manager.js index b926ef1..ddc0831 100644 --- a/static/js/core/settings-manager.js +++ b/static/js/core/settings-manager.js @@ -391,6 +391,99 @@ function switchSettingsTab(tabName) { document.querySelectorAll('.settings-section').forEach(section => { section.classList.toggle('active', section.id === `settings-${tabName}`); }); + + // Load tools/dependencies when that tab is selected + if (tabName === 'tools') { + loadSettingsTools(); + } +} + +/** + * Load tool dependencies into settings modal + */ +function loadSettingsTools() { + const content = document.getElementById('settingsToolsContent'); + if (!content) return; + + content.innerHTML = '
Loading dependencies...
'; + + fetch('/dependencies') + .then(r => r.json()) + .then(data => { + if (data.status !== 'success') { + content.innerHTML = '
Error loading dependencies
'; + return; + } + + let html = ''; + let totalMissing = 0; + + for (const [modeKey, mode] of Object.entries(data.modes)) { + const statusColor = mode.ready ? 'var(--accent-green)' : 'var(--accent-red)'; + const statusIcon = mode.ready ? '✓' : '✗'; + + html += ` +
+
+ ${mode.name} + ${statusIcon} ${mode.ready ? 'Ready' : 'Missing'} +
+
+ `; + + for (const [toolName, tool] of Object.entries(mode.tools)) { + const installed = tool.installed; + const dotColor = installed ? 'var(--accent-green)' : 'var(--accent-red)'; + const requiredBadge = tool.required ? 'REQ' : ''; + + if (!installed) totalMissing++; + + let installCmd = ''; + if (tool.install) { + if (tool.install.pip) { + installCmd = tool.install.pip; + } else if (data.pkg_manager && tool.install[data.pkg_manager]) { + installCmd = tool.install[data.pkg_manager]; + } else if (tool.install.manual) { + installCmd = tool.install.manual; + } + } + + html += ` +
+ +
+ ${toolName}${requiredBadge} +
${tool.description}
+
+ ${!installed && installCmd ? ` + ${installCmd} + ` : ''} + ${installed ? 'OK' : 'MISSING'} +
+ `; + } + + html += '
'; + } + + // Summary at top + const summaryHtml = ` +
+
+ ${totalMissing > 0 ? '⚠️ ' + totalMissing + ' tool(s) not found' : '✓ All tools installed'} +
+
+ OS: ${data.os} | Package Manager: ${data.pkg_manager} +
+
+ `; + + content.innerHTML = summaryHtml + html; + }) + .catch(err => { + content.innerHTML = '
Error loading dependencies: ' + err.message + '
'; + }); } // Initialize settings on page load diff --git a/templates/index.html b/templates/index.html index d9ef0f6..011724c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -385,8 +385,6 @@ - @@ -11686,38 +11684,6 @@ - -
-
- -

Tool Dependencies

-

Check which tools are installed for each mode. = Installed, = Missing

-
-
- Loading dependencies... -
-
-
-

Quick Install (Debian/Ubuntu)

-
-
sudo apt install rtl-sdr multimon-ng rtl-433 aircrack-ng bluez dump1090-mutability hcxdumptool - hcxtools
-
pip install skyfield flask
-
-
- Note: ACARS decoding requires acarsdec which must be built from - source. - See github.com/TLeconte/acarsdec or run - ./setup.sh for automated installation. -
-
-
-
-
@@ -11779,105 +11745,6 @@