MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / updateEmailServiceOptions

Function updateEmailServiceOptions

static/js/app.js:348–559  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

346
347// 更新邮箱服务选择框
348function updateEmailServiceOptions() {
349 const select = elements.emailService;
350 select.innerHTML = '';
351
352 // 官方临时邮箱渠道
353 if ((availableServices.tempmail && availableServices.tempmail.available) ||
354 (availableServices.yyds_mail && availableServices.yyds_mail.available) ||
355 (availableServices.web2 && availableServices.web2.available)) {
356 const optgroup = document.createElement('optgroup');
357 optgroup.label = '🌐 临时邮箱';
358
359 if (availableServices.tempmail && availableServices.tempmail.available) {
360 availableServices.tempmail.services.forEach(service => {
361 const option = document.createElement('option');
362 option.value = `tempmail:${service.id || 'default'}`;
363 option.textContent = service.name;
364 option.dataset.type = 'tempmail';
365 optgroup.appendChild(option);
366 });
367 }
368
369 if (availableServices.yyds_mail && availableServices.yyds_mail.available) {
370 availableServices.yyds_mail.services.forEach(service => {
371 const option = document.createElement('option');
372 option.value = `yyds_mail:${service.id || 'default'}`;
373 option.textContent = service.name + (service.default_domain ? ` (@${service.default_domain})` : '');
374 option.dataset.type = 'yyds_mail';
375 optgroup.appendChild(option);
376 });
377 }
378
379 if (availableServices.web2 && availableServices.web2.available) {
380 availableServices.web2.services.forEach(service => {
381 const option = document.createElement('option');
382 option.value = `web2:${service.id}`;
383 option.textContent = service.name;
384 option.dataset.type = 'web2';
385 option.dataset.serviceId = service.id;
386 optgroup.appendChild(option);
387 });
388 }
389
390 select.appendChild(optgroup);
391 }
392
393 // Outlook
394 if (availableServices.outlook.available) {
395 const optgroup = document.createElement('optgroup');
396 optgroup.label = `📧 Outlook / Hotmail (${availableServices.outlook.count} 个账户)`;
397
398 availableServices.outlook.services.forEach(service => {
399 const option = document.createElement('option');
400 option.value = `outlook:${service.id}`;
401 option.textContent = service.name + (service.has_oauth ? ' (OAuth)' : '');
402 option.dataset.type = 'outlook';
403 option.dataset.serviceId = service.id;
404 optgroup.appendChild(option);
405 });

Callers 1

loadAvailableServicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected