Fixed updater
This commit is contained in:
@@ -199,7 +199,6 @@
|
||||
<!-- Status Bar -->
|
||||
<div id="status-bar">
|
||||
<span class="status-bar-item" id="status-bar-version">Argus</span>
|
||||
<button id="btn-settings" class="status-bar-btn">Settings</button>
|
||||
<span class="status-bar-item" id="privilege-status">unprivileged</span>
|
||||
</div>
|
||||
|
||||
@@ -213,24 +212,6 @@
|
||||
<div id="traceroute-output" class="traceroute-output"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Settings Modal -->
|
||||
<div id="settings-modal" class="modal-overlay">
|
||||
<div class="modal-panel" style="width: 480px;">
|
||||
<div class="modal-header">
|
||||
<span class="modal-title">Settings</span>
|
||||
<button id="settings-close" class="modal-close">×</button>
|
||||
</div>
|
||||
<div class="settings-body">
|
||||
<div class="settings-field">
|
||||
<label for="setting-update-url">Release API URL</label>
|
||||
<input type="text" id="setting-update-url" placeholder="https://your-server.com/argus/update.json"
|
||||
spellcheck="false" />
|
||||
<p class="settings-hint">JSON file with version, url, and notes fields. Leave empty to disable.</p>
|
||||
</div>
|
||||
<button id="btn-settings-save" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Context Menu -->
|
||||
<div id="context-menu" class="context-menu" hidden>
|
||||
<button class="ctx-item" data-action="copy-ip">Copy IP</button>
|
||||
|
||||
+1
-44
@@ -1022,50 +1022,6 @@ var updater = (() => {
|
||||
|
||||
return { init };
|
||||
})();
|
||||
|
||||
var settings = (() => {
|
||||
var modal = function () { return document.getElementById('settings-modal'); };
|
||||
|
||||
async function open() {
|
||||
try {
|
||||
var config = await invoke('get_config');
|
||||
document.getElementById('setting-update-url').value = config.update_url || '';
|
||||
} catch (err) {
|
||||
console.error('Failed to load config:', err);
|
||||
}
|
||||
modal().classList.add('visible');
|
||||
}
|
||||
|
||||
function close() {
|
||||
modal().classList.remove('visible');
|
||||
}
|
||||
|
||||
async function save() {
|
||||
var url = document.getElementById('setting-update-url').value.trim();
|
||||
try {
|
||||
await invoke('save_config', { config: { update_url: url } });
|
||||
close();
|
||||
} catch (err) {
|
||||
console.error('Failed to save config:', err);
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
document.getElementById('btn-settings').addEventListener('click', open);
|
||||
document.getElementById('settings-close').addEventListener('click', close);
|
||||
document.getElementById('btn-settings-save').addEventListener('click', save);
|
||||
|
||||
modal().addEventListener('click', function (e) {
|
||||
if (e.target === modal()) close();
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Escape' && modal().classList.contains('visible')) close();
|
||||
});
|
||||
}
|
||||
|
||||
return { init };
|
||||
})();
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
// Tab switching
|
||||
document.querySelectorAll('.tab').forEach((tab) => {
|
||||
@@ -1097,6 +1053,7 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||
sender.init();
|
||||
nmapTab.init();
|
||||
monitorTab.init();
|
||||
updater.init();
|
||||
document.getElementById('btn-export-all').addEventListener('click', exporter.csvAll);
|
||||
document.getElementById('btn-export-up').addEventListener('click', exporter.csvUp);
|
||||
console.log('[Argus] Ready');
|
||||
|
||||
Reference in New Issue
Block a user