(service)
| 351 | } |
| 352 | |
| 353 | function getCustomServiceAddress(service) { |
| 354 | if (service._subType === 'imap') { |
| 355 | const host = service.config?.host || '-'; |
| 356 | const emailAddr = service.config?.email || ''; |
| 357 | return `${escapeHtml(host)}<div style="color: var(--text-muted); margin-top: 4px;">${escapeHtml(emailAddr)}</div>`; |
| 358 | } |
| 359 | if (service._subType === 'tempmail_builtin') { |
| 360 | const baseUrl = service.config?.base_url || '-'; |
| 361 | const timeout = service.config?.timeout || 30; |
| 362 | return `${escapeHtml(baseUrl)}<div style="color: var(--text-muted); margin-top: 4px;">超时:${escapeHtml(String(timeout))} 秒</div>`; |
| 363 | } |
| 364 | if (service._subType === 'yyds_mail') { |
| 365 | const baseUrl = service.config?.base_url || '-'; |
| 366 | const domain = service.config?.default_domain || ''; |
| 367 | if (!domain) { |
| 368 | return escapeHtml(baseUrl); |
| 369 | } |
| 370 | return `${escapeHtml(baseUrl)}<div style="color: var(--text-muted); margin-top: 4px;">默认域名:@${escapeHtml(domain)}</div>`; |
| 371 | } |
| 372 | if (service._subType === 'web2') { |
| 373 | const baseUrl = service.config?.base_url || 'https://web2.temp-mail.org'; |
| 374 | return `${escapeHtml(baseUrl)}<div style="color: var(--text-muted); margin-top: 4px;">固定代理:127.0.0.1:7890</div>`; |
| 375 | } |
| 376 | if (service._subType === 'luckmail') { |
| 377 | const baseUrl = service.config?.base_url || '-'; |
| 378 | const projectCode = service.config?.project_code || 'openai'; |
| 379 | const preferredDomain = service.config?.preferred_domain || ''; |
| 380 | const detail = preferredDomain |
| 381 | ? `项目:${escapeHtml(projectCode)} / 优先域名:${escapeHtml(preferredDomain)}` |
| 382 | : `项目:${escapeHtml(projectCode)}`; |
| 383 | return `${escapeHtml(baseUrl)}<div style="color: var(--text-muted); margin-top: 4px;">${detail}</div>`; |
| 384 | } |
| 385 | const baseUrl = service.config?.base_url || '-'; |
| 386 | const domain = service.config?.default_domain || service.config?.domain; |
| 387 | if (!domain) { |
| 388 | return escapeHtml(baseUrl); |
| 389 | } |
| 390 | return `${escapeHtml(baseUrl)}<div style="color: var(--text-muted); margin-top: 4px;">默认域名:@${escapeHtml(domain)}</div>`; |
| 391 | } |
| 392 | |
| 393 | // 加载自定义邮箱服务(moe_mail + temp_mail + cloudmail + duck_mail + freemail + imap_mail 合并) |
| 394 | async function loadCustomServices() { |
no test coverage detected