()
| 243 | } |
| 244 | |
| 245 | async function runSessionDiagnostic() { |
| 246 | const accountId = Number(document.getElementById("account-select")?.value || 0); |
| 247 | if (!accountId) { |
| 248 | toast.warning("请先选择账号"); |
| 249 | return; |
| 250 | } |
| 251 | setButtonLoading("session-diagnostic-btn", "诊断中...", true); |
| 252 | showSessionDiagnosticPanel("正在诊断会话上下文,请稍候..."); |
| 253 | try { |
| 254 | const data = await api.get(`/payment/accounts/${accountId}/session-diagnostic?probe=1`); |
| 255 | const diag = data?.diagnostic || {}; |
| 256 | showSessionDiagnosticPanel(formatSessionDiagnosticPayload(diag)); |
| 257 | toast.success("会话诊断完成"); |
| 258 | } catch (error) { |
| 259 | const message = formatErrorMessage(error); |
| 260 | showSessionDiagnosticPanel(`会话诊断失败: ${message}`); |
| 261 | toast.error(`会话诊断失败: ${message}`); |
| 262 | } finally { |
| 263 | setButtonLoading("session-diagnostic-btn", "诊断中...", false); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | async function runSessionBootstrap() { |
| 268 | const accountId = Number(document.getElementById("account-select")?.value || 0); |
no test coverage detected