diff --git a/app.js b/app.js index 2124597..794db62 100644 --- a/app.js +++ b/app.js @@ -97,6 +97,10 @@ class CLIProxyManager { this.authFilesPageSizeKey = STORAGE_KEY_AUTH_FILES_PAGE_SIZE; this.loadAuthFilePreferences(); + // OAuth 模型排除列表状态 + this.oauthExcludedModels = {}; + this._oauthExcludedLoading = false; + // Vertex AI credential import state this.vertexImportState = { file: null, @@ -385,6 +389,17 @@ class CLIProxyManager { this.bindAuthFilesPageSizeControl(); this.syncAuthFileControls(); + // OAuth 排除列表 + const oauthExcludedAdd = document.getElementById('oauth-excluded-add'); + const oauthExcludedRefresh = document.getElementById('oauth-excluded-refresh'); + + if (oauthExcludedAdd) { + oauthExcludedAdd.addEventListener('click', () => this.openOauthExcludedEditor()); + } + if (oauthExcludedRefresh) { + oauthExcludedRefresh.addEventListener('click', () => this.loadOauthExcludedModels(true)); + } + // Vertex AI credential import const vertexSelectFile = document.getElementById('vertex-select-file'); const vertexFileInput = document.getElementById('vertex-file-input'); diff --git a/i18n.js b/i18n.js index 608a30b..0a328ea 100644 --- a/i18n.js +++ b/i18n.js @@ -306,6 +306,40 @@ const i18n = { 'vertex_import.result_location': '区域', 'vertex_import.result_file': '存储文件', + // OAuth 排除模型 + 'oauth_excluded.title': 'OAuth 排除列表', + 'oauth_excluded.description': '按提供商分列展示,点击卡片编辑或删除;支持 * 通配符,范围跟随上方的配置文件过滤标签。', + 'oauth_excluded.add': '新增排除', + 'oauth_excluded.add_title': '新增提供商排除列表', + 'oauth_excluded.edit_title': '编辑 {provider} 的排除列表', + 'oauth_excluded.refresh': '刷新', + 'oauth_excluded.refreshing': '刷新中...', + 'oauth_excluded.provider_label': '提供商', + 'oauth_excluded.provider_auto': '跟随当前过滤', + 'oauth_excluded.provider_placeholder': '例如 gemini-cli / openai', + 'oauth_excluded.provider_hint': '默认选中当前筛选的提供商,也可直接输入或选择其他名称。', + 'oauth_excluded.models_label': '排除的模型', + 'oauth_excluded.models_placeholder': 'gpt-4.1-mini\n*-preview', + 'oauth_excluded.models_hint': '逗号或换行分隔;留空保存将删除该提供商记录;支持 * 通配符。', + 'oauth_excluded.save': '保存/更新', + 'oauth_excluded.saving': '正在保存...', + 'oauth_excluded.save_success': '排除列表已更新', + 'oauth_excluded.save_failed': '更新排除列表失败', + 'oauth_excluded.delete': '删除提供商', + 'oauth_excluded.delete_confirm': '确定要删除 {provider} 的排除列表吗?', + 'oauth_excluded.delete_success': '已删除该提供商的排除列表', + 'oauth_excluded.delete_failed': '删除排除列表失败', + 'oauth_excluded.deleting': '正在删除...', + 'oauth_excluded.no_models': '未配置排除模型', + 'oauth_excluded.model_count': '排除 {count} 个模型', + 'oauth_excluded.list_empty_all': '暂无任何提供商的排除列表,点击“新增排除”创建。', + 'oauth_excluded.list_empty_filtered': '当前筛选下没有排除项,点击“新增排除”添加。', + 'oauth_excluded.disconnected': '请先连接服务器以查看排除列表', + 'oauth_excluded.load_failed': '加载排除列表失败', + 'oauth_excluded.provider_required': '请先填写提供商名称', + 'oauth_excluded.scope_all': '当前范围:全局(显示所有提供商)', + 'oauth_excluded.scope_provider': '当前范围:{provider}', + // Codex OAuth 'auth_login.codex_oauth_title': 'Codex OAuth', @@ -878,6 +912,40 @@ const i18n = { 'vertex_import.result_location': 'Region', 'vertex_import.result_file': 'Persisted file', + // OAuth excluded models + 'oauth_excluded.title': 'OAuth Excluded Models', + 'oauth_excluded.description': 'Per-provider exclusions are shown as cards; click edit to adjust. Wildcards * are supported and the scope follows the auth file filter.', + 'oauth_excluded.add': 'Add Exclusion', + 'oauth_excluded.add_title': 'Add provider exclusion', + 'oauth_excluded.edit_title': 'Edit exclusions for {provider}', + 'oauth_excluded.refresh': 'Refresh', + 'oauth_excluded.refreshing': 'Refreshing...', + 'oauth_excluded.provider_label': 'Provider', + 'oauth_excluded.provider_auto': 'Follow current filter', + 'oauth_excluded.provider_placeholder': 'e.g. gemini-cli', + 'oauth_excluded.provider_hint': 'Defaults to the current filter; pick an existing provider or type a new name.', + 'oauth_excluded.models_label': 'Models to exclude', + 'oauth_excluded.models_placeholder': 'gpt-4.1-mini\n*-preview', + 'oauth_excluded.models_hint': 'Separate by commas or new lines; saving an empty list removes that provider. * wildcards are supported.', + 'oauth_excluded.save': 'Save/Update', + 'oauth_excluded.saving': 'Saving...', + 'oauth_excluded.save_success': 'Excluded models updated', + 'oauth_excluded.save_failed': 'Failed to update excluded models', + 'oauth_excluded.delete': 'Delete Provider', + 'oauth_excluded.delete_confirm': 'Delete the exclusion list for {provider}?', + 'oauth_excluded.delete_success': 'Exclusion list removed', + 'oauth_excluded.delete_failed': 'Failed to delete exclusion list', + 'oauth_excluded.deleting': 'Deleting...', + 'oauth_excluded.no_models': 'No excluded models', + 'oauth_excluded.model_count': '{count} models excluded', + 'oauth_excluded.list_empty_all': 'No exclusions yet—use “Add Exclusion” to create one.', + 'oauth_excluded.list_empty_filtered': 'No exclusions in this scope; click “Add Exclusion” to add.', + 'oauth_excluded.disconnected': 'Connect to the server to view exclusions', + 'oauth_excluded.load_failed': 'Failed to load exclusion list', + 'oauth_excluded.provider_required': 'Please enter a provider first', + 'oauth_excluded.scope_all': 'Scope: All providers', + 'oauth_excluded.scope_provider': 'Scope: {provider}', + // Codex OAuth 'auth_login.codex_oauth_title': 'Codex OAuth', 'auth_login.codex_oauth_button': 'Start Codex Login', diff --git a/index.html b/index.html index 0bbf488..06494d6 100644 --- a/index.html +++ b/index.html @@ -557,6 +557,31 @@ + +
为 OAuth/文件凭据配置模型黑名单,支持通配符。
+ +${i18n.t('oauth_excluded.provider_hint')}
+${i18n.t('oauth_excluded.models_hint')}
+