feat(mail): Temp-Mail 服务类型实现完成

This commit is contained in:
cnlimiter
2026-03-17 01:09:10 +08:00
parent 76ce3b9bca
commit b8c61c8b50
9 changed files with 623 additions and 3 deletions

View File

@@ -21,7 +21,8 @@ let toastShown = false; // 标记是否已显示过 toast
let availableServices = {
tempmail: { available: true, services: [] },
outlook: { available: false, services: [] },
custom_domain: { available: false, services: [] }
custom_domain: { available: false, services: [] },
temp_mail: { available: false, services: [] }
};
// WebSocket 相关变量
@@ -248,6 +249,23 @@ function updateEmailServiceOptions() {
select.appendChild(optgroup);
}
// Temp-Mail自部署
if (availableServices.temp_mail && availableServices.temp_mail.available) {
const optgroup = document.createElement('optgroup');
optgroup.label = `📮 Temp-Mail 自部署 (${availableServices.temp_mail.count} 个服务)`;
availableServices.temp_mail.services.forEach(service => {
const option = document.createElement('option');
option.value = `temp_mail:${service.id}`;
option.textContent = service.name + (service.domain ? ` (@${service.domain})` : '');
option.dataset.type = 'temp_mail';
option.dataset.serviceId = service.id;
optgroup.appendChild(option);
});
select.appendChild(optgroup);
}
}
// 处理邮箱服务切换