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

Function handleEditCustom

static/js/email_services.js:911–1024  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

909
910// 保存编辑自定义邮箱服务
911async function handleEditCustom(e) {
912 e.preventDefault();
913 const id = document.getElementById('edit-custom-id').value;
914 const formData = new FormData(e.target);
915 const subType = formData.get('sub_type');
916
917 let config;
918 if (subType === 'moemail') {
919 config = {
920 base_url: formData.get('api_url'),
921 default_domain: formData.get('domain')
922 };
923 const apiKey = formData.get('api_key');
924 if (apiKey && apiKey.trim()) config.api_key = apiKey.trim();
925 } else if (subType === 'tempmail_builtin') {
926 config = {
927 base_url: formData.get('tpo_base_url'),
928 timeout: parseInt(formData.get('tpo_timeout'), 10) || 30,
929 max_retries: parseInt(formData.get('tpo_max_retries'), 10) || 3
930 };
931 } else if (subType === 'yyds_mail') {
932 config = {
933 base_url: formData.get('yyds_base_url'),
934 default_domain: formData.get('yyds_default_domain'),
935 timeout: parseInt(formData.get('yyds_timeout'), 10) || 30,
936 max_retries: parseInt(formData.get('yyds_max_retries'), 10) || 3
937 };
938 const apiKey = formData.get('yyds_api_key');
939 if (apiKey && apiKey.trim()) config.api_key = apiKey.trim();
940 } else if (subType === 'web2') {
941 config = {
942 base_url: formData.get('web2_base_url') || 'https://web2.temp-mail.org',
943 timeout: parseInt(formData.get('web2_timeout'), 10) || 30,
944 max_retries: parseInt(formData.get('web2_max_retries'), 10) || 3
945 };
946 } else if (subType === 'tempmail') {
947 config = {
948 base_url: formData.get('tm_base_url'),
949 domain: formData.get('tm_domain'),
950 enable_prefix: true
951 };
952 const pwd = formData.get('tm_admin_password');
953 if (pwd && pwd.trim()) config.admin_password = pwd.trim();
954 } else if (subType === 'duckmail') {
955 config = {
956 base_url: formData.get('dm_base_url'),
957 default_domain: formData.get('dm_domain'),
958 password_length: parseInt(formData.get('dm_password_length'), 10) || 12
959 };
960 const apiKey = formData.get('dm_api_key');
961 if (apiKey && apiKey.trim()) config.api_key = apiKey.trim();
962 } else if (subType === 'luckmail') {
963 config = {
964 base_url: formData.get('lm_base_url'),
965 project_code: formData.get('lm_project_code') || 'openai',
966 email_type: formData.get('lm_email_type') || 'ms_graph',
967 preferred_domain: formData.get('lm_preferred_domain')
968 };

Callers

nothing calls this directly

Calls 7

loadCustomServicesFunction · 0.85
successMethod · 0.80
errorMethod · 0.80
loadStatsFunction · 0.70
getMethod · 0.45
filterMethod · 0.45
patchMethod · 0.45

Tested by

no test coverage detected