From ceb2d2fffcf7636134090385a355c6b76bf46cdb Mon Sep 17 00:00:00 2001 From: overcuriousity Date: Wed, 24 Sep 2025 12:13:06 +0200 Subject: [PATCH] redundancy removal --- static/js/main.js | 51 ----------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index 3a8bd60..6cf2ce1 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -224,12 +224,6 @@ class DNScopeApp { if (e.target === this.elements.settingsModal) this.hideSettingsModal(); }); } - if (this.elements.saveApiKeys) { - this.elements.saveApiKeys.removeEventListener('click', this.saveApiKeys); - } - if (this.elements.resetApiKeys) { - this.elements.resetApiKeys.removeEventListener('click', this.resetApiKeys); - } // Setup new handlers const saveSettingsBtn = document.getElementById('save-settings'); @@ -2342,51 +2336,6 @@ class DNScopeApp { this.elements.settingsModal.style.display = 'none'; } } - - /** - * Save API Keys - */ - async saveApiKeys() { - const inputs = this.elements.apiKeyInputs.querySelectorAll('input'); - const keys = {}; - inputs.forEach(input => { - const provider = input.dataset.provider; - const value = input.value.trim(); - if (provider && value) { - keys[provider] = value; - } - }); - - if (Object.keys(keys).length === 0) { - this.showWarning('No API keys were entered.'); - return; - } - - try { - const response = await this.apiCall('/api/config/api-keys', 'POST', keys); - if (response.success) { - this.showSuccess(response.message); - this.hideSettingsModal(); - this.loadProviders(); // Refresh provider status - } else { - throw new Error(response.error || 'Failed to save API keys'); - } - } catch (error) { - this.showError(`Error saving API keys: ${error.message}`); - } - } - - /** - * Reset API Key fields - */ - resetApiKeys() { - const inputs = this.elements.apiKeyInputs.querySelectorAll('input'); - inputs.forEach(input => { - input.value = ''; - }); - } - - /** * Make API call to server