export const authFilesModule = { // 加载认证文件 async loadAuthFiles(keyStats = null) { try { const data = await this.makeRequest('/auth-files'); if (!keyStats) { keyStats = await this.getKeyStats(); } await this.renderAuthFiles(data.files || [], keyStats); } catch (error) { console.error('加载认证文件失败:', error); } }, // 渲染认证文件列表 async renderAuthFiles(files, keyStats = null) { const container = document.getElementById('auth-files-list'); if (!container) { return; } const allFiles = Array.isArray(files) ? files : []; const visibleFiles = allFiles.filter(file => { if (!file) return false; return this.shouldDisplayDisabledGeminiCli(file) || file.disabled !== true; }); const stats = keyStats || await this.getKeyStats(); this.cachedAuthFiles = visibleFiles.map(file => ({ ...file })); this.authFileStatsCache = stats || { bySource: {}, byAuthIndex: {} }; this.syncAuthFileControls(); if (this.cachedAuthFiles.length === 0) { container.innerHTML = `
${i18n.t('auth_files.empty_desc')}
${i18n.t(descKey)}