()
| 1094 | } |
| 1095 | |
| 1096 | async function loadAutoRegistrationCpaOptions() { |
| 1097 | if (!elements.autoRegistrationCpaServiceId) return; |
| 1098 | try { |
| 1099 | const services = await api.get('/cpa-services?enabled=true'); |
| 1100 | const options = ['<option value="0">请选择 CPA 服务</option>']; |
| 1101 | services.forEach(service => { |
| 1102 | options.push(`<option value="${service.id}">${escapeHtml(service.name)} (#${service.id})</option>`); |
| 1103 | }); |
| 1104 | elements.autoRegistrationCpaServiceId.innerHTML = options.join(''); |
| 1105 | elements.autoRegistrationCpaServiceId.value = elements.autoRegistrationCpaServiceId.dataset.selectedId || '0'; |
| 1106 | } catch (error) { |
| 1107 | console.error('加载 CPA 服务失败:', error); |
| 1108 | } |
| 1109 | } |
| 1110 | |
| 1111 | function populateAutoRegistrationEmailServiceOptions(selectedId = 0) { |
| 1112 | if (!elements.autoRegistrationEmailServiceId || !elements.autoRegistrationEmailServiceType) return; |
no test coverage detected