diff --git a/static/js/features/groups.js b/static/js/features/groups.js index 4225754..5bebcc8 100644 --- a/static/js/features/groups.js +++ b/static/js/features/groups.js @@ -129,6 +129,12 @@ } } + // 显示「注册Outlook账号」按钮(仅在非临时邮箱分组时) + const registerBtn = document.getElementById('registerOutlookBtn'); + if (registerBtn) { + registerBtn.style.display = isTempEmailGroup ? 'none' : ''; + } + // 更新底部按钮 updateAccountPanelFooter(); @@ -173,6 +179,22 @@ } } + // 获取 provider 的中文展示名(账号卡片 tag) + function getProviderLabel(provider) { + const key = (provider || 'outlook').toString().toLowerCase(); + const labels = { + outlook: 'Outlook', + gmail: 'Gmail', + qq: 'QQ邮箱', + '163': '163邮箱', + '126': '126邮箱', + yahoo: 'Yahoo邮箱', + aliyun: '阿里邮箱', + custom: '自定义IMAP' + }; + return labels[key] || provider || '未知'; + } + // 渲染邮箱列表 function renderAccountList(accounts) { const container = document.getElementById('accountList'); @@ -210,6 +232,8 @@ const initial = (acc.email || '?')[0].toUpperCase(); const isFailed = acc.last_refresh_status === 'failed'; const gradient = avatarGradients[index % avatarGradients.length]; + const providerLabel = getProviderLabel(acc.provider || acc.account_type || 'outlook'); + const providerTagHtml = `${escapeHtml(providerLabel)}`; let tokenBadge = '– 未知'; if (acc.token_status === 'valid') { @@ -235,6 +259,7 @@ ${acc.remark && acc.remark.trim() ? `
📝 ${escapeHtml(acc.remark)}
` : ''}
+ ${providerTagHtml} ${(acc.tags || []).map(tag => `${escapeHtml(tag.name)}`).join('')}
diff --git a/static/js/main.js b/static/js/main.js index a78353d..894ce3d 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -915,18 +915,20 @@ ${details} const data = await response.json(); if (data.success) { - // 生成完整的导入格式 - const importFormat = `your@outlook.com----yourpassword----${data.client_id}----${data.refresh_token}`; - - // 显示结果 - document.getElementById('refreshTokenOutput').value = importFormat; - document.getElementById('refreshTokenResult').style.display = 'block'; - - showToast('✅ Refresh Token 获取成功!', 'success'); - - // 重置按钮状态(不隐藏,允许重复使用) btn.disabled = false; btn.textContent = '换取 Token'; + + // 关闭 Token 弹窗,打开添加账号弹窗并预填充 + hideGetRefreshTokenModal(); + showAddAccountModal(); + + const inputEl = document.getElementById('accountInput'); + if (inputEl) { + inputEl.value = `your@outlook.com----yourpassword----${data.client_id}----${data.refresh_token}`; + inputEl.select(); + } + + showToast('✅ Token 获取成功!请将邮箱和密码替换后点导入', 'success'); } else { handleApiError(data, '换取 Token 失败'); btn.disabled = false; diff --git a/templates/index.html b/templates/index.html index ebc677e..844ad5e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -168,7 +168,8 @@ 选择分组 -
+
+