- 新增 TLS Sidecar 功能文档,支持绕过 Grok 等服务的 Cloudflare 403 封锁 - 重构前端提供商配置管理,实现动态配置缓存和统一数据源 - 升级配置文件管理界面 UI,优化信息展示和交互体验 - 改进 Claude Kiro 工具调用流式响应,实时推送 content_block 事件 - 修复 Codex 配额重置时间格式问题 主要变更: - README 文档新增 TLS Sidecar 配置说明和使用指南 - 新增 tutorial-manager.js 模块,动态渲染 OAuth 授权路径 - routing-examples.js 支持动态生成路径路由示例卡片 - upload-config-manager.js 重构列表项布局,支持节点关联信息展示 - config-manager、models-manager、usage-manager 统一使用提供商配置缓存 - i18n 新增多语言翻译键,更新 Gemini 模型版本信息
57 lines
1.5 KiB
JavaScript
57 lines
1.5 KiB
JavaScript
// 教程管理模块
|
|
import { getProviderConfigs } from './utils.js';
|
|
|
|
// 提供商配置缓存
|
|
let currentProviderConfigs = null;
|
|
|
|
/**
|
|
* 初始化教程功能
|
|
*/
|
|
function initTutorialManager() {
|
|
renderOauthPaths();
|
|
|
|
// 监听语言切换事件
|
|
window.addEventListener('languageChanged', () => {
|
|
renderOauthPaths(currentProviderConfigs);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 更新提供商配置
|
|
* @param {Array} configs - 提供商配置列表
|
|
*/
|
|
function updateTutorialProviderConfigs(configs) {
|
|
currentProviderConfigs = configs;
|
|
renderOauthPaths(configs);
|
|
}
|
|
|
|
/**
|
|
* 渲染 OAuth 授权路径列表
|
|
* @param {Array} configs - 提供商配置列表(可选)
|
|
*/
|
|
function renderOauthPaths(configs = null) {
|
|
const oauthPathList = document.getElementById('oauthPathList');
|
|
if (!oauthPathList) return;
|
|
|
|
// 获取所有提供商配置
|
|
const providers = configs || getProviderConfigs([]);
|
|
|
|
// 过滤出有默认路径配置的提供商(即 OAuth 类提供商)且可见的
|
|
const oauthProviders = providers.filter(p => p.defaultPath && p.visible !== false);
|
|
|
|
oauthPathList.innerHTML = oauthProviders.map(p => `
|
|
<div class="oauth-path-item">
|
|
<div class="path-header">
|
|
<i class="fas ${p.icon || 'fa-key'}"></i>
|
|
<span class="path-provider">${p.name}</span>
|
|
</div>
|
|
<code class="path-value">${p.defaultPath}</code>
|
|
</div>
|
|
`).join('');
|
|
}
|
|
|
|
export {
|
|
initTutorialManager,
|
|
renderOauthPaths,
|
|
updateTutorialProviderConfigs
|
|
};
|