From 2ef64d8064d0f40324ea1d207da29ea0c10ea7be Mon Sep 17 00:00:00 2001 From: Supra4E8C <69194597+LTbinglingfeng@users.noreply.github.com> Date: Thu, 25 Sep 2025 17:14:50 +0800 Subject: [PATCH] Add files via upload --- app.js | 35 ----------------------------------- i18n.js | 18 ++++++++++-------- index.html | 24 +++++++++--------------- styles.css | 31 +++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 58 deletions(-) diff --git a/app.js b/app.js index c38dbe2..7689186 100644 --- a/app.js +++ b/app.js @@ -538,7 +538,6 @@ class CLIProxyManager { const updateRetry = document.getElementById('update-retry'); const switchProjectToggle = document.getElementById('switch-project-toggle'); const switchPreviewToggle = document.getElementById('switch-preview-model-toggle'); - const allowLocalhostToggle = document.getElementById('allow-localhost-toggle'); if (debugToggle) { debugToggle.addEventListener('change', (e) => this.updateDebug(e.target.checked)); @@ -558,9 +557,6 @@ class CLIProxyManager { if (switchPreviewToggle) { switchPreviewToggle.addEventListener('change', (e) => this.updateSwitchPreviewModel(e.target.checked)); } - if (allowLocalhostToggle) { - allowLocalhostToggle.addEventListener('change', (e) => this.updateAllowLocalhost(e.target.checked)); - } // API 密钥管理 const addApiKey = document.getElementById('add-api-key'); @@ -1001,10 +997,6 @@ class CLIProxyManager { } } - // 本地访问设置 - if (config['allow-localhost-unauthenticated'] !== undefined) { - document.getElementById('allow-localhost-toggle').checked = config['allow-localhost-unauthenticated']; - } // API 密钥 if (config['api-keys']) { @@ -1039,7 +1031,6 @@ class CLIProxyManager { this.loadProxySettings(), this.loadRetrySettings(), this.loadQuotaSettings(), - this.loadLocalhostSettings(), this.loadApiKeys(), this.loadGeminiKeys(), this.loadCodexKeys(), @@ -1192,32 +1183,6 @@ class CLIProxyManager { } } - // 加载本地访问设置 - async loadLocalhostSettings() { - try { - const config = await this.getConfig(); - if (config['allow-localhost-unauthenticated'] !== undefined) { - document.getElementById('allow-localhost-toggle').checked = config['allow-localhost-unauthenticated']; - } - } catch (error) { - console.error('加载本地访问设置失败:', error); - } - } - - // 更新本地访问设置 - async updateAllowLocalhost(enabled) { - try { - await this.makeRequest('/allow-localhost-unauthenticated', { - method: 'PUT', - body: JSON.stringify({ value: enabled }) - }); - this.clearCache(); // 清除缓存 - this.showNotification(i18n.t('notification.localhost_updated'), 'success'); - } catch (error) { - this.showNotification(`${i18n.t('notification.update_failed')}: ${error.message}`, 'error'); - document.getElementById('allow-localhost-toggle').checked = !enabled; - } - } // 加载API密钥 async loadApiKeys() { diff --git a/i18n.js b/i18n.js index 6cda4df..5e7a3d0 100644 --- a/i18n.js +++ b/i18n.js @@ -103,8 +103,6 @@ const i18n = { 'basic_settings.quota_title': '配额超出行为', 'basic_settings.quota_switch_project': '自动切换项目', 'basic_settings.quota_switch_preview': '切换到预览模型', - 'basic_settings.localhost_title': '本地访问', - 'basic_settings.localhost_allow': '允许本地未认证访问', // API 密钥管理 'api_keys.title': 'API 密钥管理', @@ -253,7 +251,6 @@ const i18n = { 'notification.retry_updated': '重试设置已更新', 'notification.quota_switch_project_updated': '项目切换设置已更新', 'notification.quota_switch_preview_updated': '预览模型切换设置已更新', - 'notification.localhost_updated': '本地访问设置已更新', 'notification.api_key_added': 'API密钥添加成功', 'notification.api_key_updated': 'API密钥更新成功', 'notification.api_key_deleted': 'API密钥删除成功', @@ -297,7 +294,11 @@ const i18n = { 'theme.dark': '暗色', 'theme.switch_to_light': '切换到亮色模式', 'theme.switch_to_dark': '切换到暗色模式', - 'theme.auto': '跟随系统' + 'theme.auto': '跟随系统', + + // 页脚 + 'footer.version': '版本', + 'footer.author': '作者' }, 'en-US': { @@ -397,8 +398,6 @@ const i18n = { 'basic_settings.quota_title': 'Quota Exceeded Behavior', 'basic_settings.quota_switch_project': 'Auto Switch Project', 'basic_settings.quota_switch_preview': 'Switch to Preview Model', - 'basic_settings.localhost_title': 'Local Access', - 'basic_settings.localhost_allow': 'Allow Localhost Unauthenticated Access', // API Keys management 'api_keys.title': 'API Keys Management', @@ -547,7 +546,6 @@ const i18n = { 'notification.retry_updated': 'Retry settings updated', 'notification.quota_switch_project_updated': 'Project switch settings updated', 'notification.quota_switch_preview_updated': 'Preview model switch settings updated', - 'notification.localhost_updated': 'Localhost access settings updated', 'notification.api_key_added': 'API key added successfully', 'notification.api_key_updated': 'API key updated successfully', 'notification.api_key_deleted': 'API key deleted successfully', @@ -591,7 +589,11 @@ const i18n = { 'theme.dark': 'Dark', 'theme.switch_to_light': 'Switch to light mode', 'theme.switch_to_dark': 'Switch to dark mode', - 'theme.auto': 'Follow system' + 'theme.auto': 'Follow system', + + // Footer + 'footer.version': 'Version', + 'footer.author': 'Author' } }, diff --git a/index.html b/index.html index e1587b8..b8f995d 100644 --- a/index.html +++ b/index.html @@ -309,21 +309,6 @@ - -