Explorar o código

fix: step 9 support English UI on VPS panel

Submit button and success status matching now handles both Chinese
and English text (submit/提交, success/认证成功). Also falls back to
finding the button by DOM position in callbackSection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chendeben hai 4 meses
pai
achega
2a4a7d405a
Modificáronse 1 ficheiros con 13 adicións e 9 borrados
  1. 13 9
      content/vps-panel.js

+ 13 - 9
content/vps-panel.js

@@ -144,35 +144,39 @@ async function step9_vpsVerify(payload) {
   fillInput(urlInput, localhostUrl);
   log(`Step 9: Filled callback URL: ${localhostUrl.slice(0, 80)}...`);
 
-  // Find and click "提交回调 URL" button
+  // Find and click submit callback button (supports both Chinese and English UI)
   let submitBtn = null;
   try {
     submitBtn = await waitForElementByText(
       '[class*="callbackActions"] button, [class*="callbackSection"] button',
-      /提交/,
+      /提交|submit/i,
       5000
     );
   } catch {
     try {
-      submitBtn = await waitForElementByText('button.btn', /提交回调/, 5000);
+      submitBtn = await waitForElementByText('button.btn', /提交回调|submit.*callback/i, 5000);
     } catch {
-      throw new Error('Could not find "提交回调 URL" button. URL: ' + location.href);
+      // Last resort: find the button next to the input in callbackSection
+      const section = document.querySelector('[class*="callbackSection"]');
+      submitBtn = section?.querySelector('button');
+      if (!submitBtn) {
+        throw new Error('Could not find submit callback button. URL: ' + location.href);
+      }
     }
   }
 
   await humanPause(450, 1200);
   simulateClick(submitBtn);
-  log('Step 9: Clicked "提交回调 URL", waiting for authentication result...');
+  log('Step 9: Clicked submit callback button, waiting for authentication result...');
 
-  // Wait for "认证成功!" status badge to appear
+  // Wait for success status (supports both Chinese and English)
   try {
-    await waitForElementByText('.status-badge, [class*="status"]', /认证成功/, 30000);
+    await waitForElementByText('.status-badge, [class*="status"]', /认证成功|auth.*success|verified|active/i, 30000);
     log('Step 9: Authentication successful!', 'ok');
   } catch {
-    // Check if there's an error message instead
     const statusEl = document.querySelector('.status-badge, [class*="status"]');
     const statusText = statusEl ? statusEl.textContent : 'unknown';
-    if (/成功|success/i.test(statusText)) {
+    if (/成功|success|verified|active/i.test(statusText)) {
       log('Step 9: Authentication successful!', 'ok');
     } else {
       log(`Step 9: Status after submit: "${statusText}". May still be processing.`, 'warn');