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

Function handleSingleRegistration

static/js/app.js:1205–1233  ·  view source on GitHub ↗
(requestData)

Source from the content-addressed store, hash-verified

1203
1204// 单次注册
1205async function handleSingleRegistration(requestData) {
1206 // 重置任务状态
1207 taskCompleted = false;
1208 taskFinalStatus = null;
1209 displayedLogs.clear(); // 清空日志去重集合
1210 toastShown = false; // 重置 toast 标志
1211
1212 addLog('info', '[系统] 正在启动注册任务...');
1213
1214 try {
1215 const data = await api.post('/registration/start', requestData);
1216
1217 currentTask = data;
1218 activeTaskUuid = data.task_uuid; // 保存用于重连
1219 // 持久化到 sessionStorage,跨页面导航后可恢复
1220 sessionStorage.setItem('activeTask', JSON.stringify({ task_uuid: data.task_uuid, mode: 'single' }));
1221 addLog('info', `[系统] 任务已创建: ${data.task_uuid}`);
1222 showTaskStatus(data);
1223 updateTaskStatus('running');
1224
1225 // 优先使用 WebSocket
1226 connectWebSocket(data.task_uuid);
1227
1228 } catch (error) {
1229 addLog('error', `[错误] 启动失败: ${error.message}`);
1230 toast.error(error.message);
1231 resetButtons();
1232 }
1233}
1234
1235
1236// ============== WebSocket 功能 ==============

Callers 1

handleStartRegistrationFunction · 0.85

Calls 7

addLogFunction · 0.85
showTaskStatusFunction · 0.85
updateTaskStatusFunction · 0.85
connectWebSocketFunction · 0.85
resetButtonsFunction · 0.85
errorMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected