Fixed updater
This commit is contained in:
+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