Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ function setupDeclarativeNetRequestRules() {
}

// ============================================================
// 状态管理(chrome.storage.session + chrome.storage.local
// State management (chrome.storage.session + chrome.storage.local)
// ============================================================

const PERSISTED_SETTING_DEFAULTS = {
Expand Down Expand Up @@ -1518,14 +1518,14 @@ const DEFAULT_STATE = {
nodeStatuses: { ...DEFAULT_NODE_STATUSES },
runtimeState: runtimeStateHelpers?.buildDefaultRuntimeState?.() || null,
...CONTRIBUTION_RUNTIME_DEFAULTS,
accounts: [], // 已生成账号记录:{ email, password, createdAt }
accountRunHistory: [], // 账号运行历史快照,实际持久化在 chrome.storage.local
accounts: [], // Generated account records: { email, password, createdAt }.
accountRunHistory: [], // Account run-history snapshot; actually persisted in chrome.storage.local.
manualAliasUsage: {},
preservedAliases: {},
icloudAliasCache: [],
icloudAliasCacheAt: 0,
logs: [], // 侧边栏展示的运行日志。
...PERSISTED_SETTING_DEFAULTS, // 合并 chrome.storage.local 中持久化保存的用户配置。
logs: [], // Run logs shown in the side panel.
...PERSISTED_SETTING_DEFAULTS, // Merge user config persisted in chrome.storage.local.
luckmailApiKey: '',
luckmailBaseUrl: DEFAULT_LUCKMAIL_BASE_URL,
luckmailEmailType: DEFAULT_LUCKMAIL_EMAIL_TYPE,
Expand All @@ -1539,14 +1539,14 @@ const DEFAULT_STATE = {
heroSmsLastPriceUserLimit: '',
heroSmsLastPriceAt: 0,
pendingPhoneActivationConfirmation: null,
autoRunning: false, // 当前是否处于自动运行中。
autoRunPhase: 'idle', // 当前自动运行阶段。
autoRunCurrentRun: 0, // 自动运行当前执行到第几轮。
autoRunTotalRuns: 1, // 自动运行计划总轮数。
autoRunAttemptRun: 0, // 当前轮次的重试序号。
autoRunning: false, // Whether auto-run is currently active.
autoRunPhase: 'idle', // Current auto-run phase.
autoRunCurrentRun: 0, // The current round number in auto-run.
autoRunTotalRuns: 1, // Total planned auto-run rounds.
autoRunAttemptRun: 0, // Retry sequence number within the current round.
autoRunSessionId: 0,
autoRunRoundSummaries: [], // 自动运行轮次摘要。
autoRunTimerPlan: null, // 自动运行可恢复计时计划快照。
autoRunRoundSummaries: [], // Auto-run round summaries.
autoRunTimerPlan: null, // Resumable auto-run timer plan snapshot.
autoRunCountdownAt: null,
autoRunCountdownTitle: '',
autoRunCountdownNote: '',
Expand Down Expand Up @@ -15327,7 +15327,7 @@ async function executeStep8(state) {
}

// ============================================================
// Step 9: 完成 OAuth(自动点击 + localhost 回调监听)
// Step 9: Complete OAuth (auto-click + localhost callback listener)
// ============================================================

let webNavListener = null;
Expand Down Expand Up @@ -15957,7 +15957,7 @@ async function executeStep9(state) {
}

// ============================================================
// Step 10: 平台回调验证
// Step 10: Platform callback verification
// ============================================================

async function executeContributionStep10(state) {
Expand Down
30 changes: 15 additions & 15 deletions background/account-run-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,33 +208,33 @@

function buildFailureLabel(finalStatus, failedNodeId = '', failedStep = null, failureDetail = '', state = {}) {
if (finalStatus === 'success') {
return '流程完成';
return 'Flow completed';
}
if (finalStatus === 'running') {
return '正在运行';
return 'Running';
}
if (finalStatus === 'stopped') {
if (failedNodeId) {
return `节点 ${getNodeDisplayName(failedNodeId, state)} 停止`;
return `Node ${getNodeDisplayName(failedNodeId, state)} stopped`;
}
if (Number.isInteger(failedStep) && failedStep > 0) {
return `步骤 ${failedStep} 停止`;
return `Step ${failedStep} stopped`;
}
return '流程已停止';
return 'Flow stopped';
}
if (finalStatus !== 'failed') {
return '';
return 'None';
}
if (isPhoneVerificationFailure(failureDetail)) {
return '出现手机号验证';
return 'Phone verification required';
}
if (failedNodeId) {
return `节点 ${getNodeDisplayName(failedNodeId, state)} 失败`;
return `Node ${getNodeDisplayName(failedNodeId, state)} failed`;
}
if (Number.isInteger(failedStep) && failedStep > 0) {
return `步骤 ${failedStep} 失败`;
return `Step ${failedStep} failed`;
}
return '流程失败';
return 'Flow failed';
}

function normalizeAccountIdentifierType(value = '') {
Expand Down Expand Up @@ -674,11 +674,11 @@
try {
payload = await response.json();
} catch (err) {
throw new Error(`账号记录快照同步失败:本地 helper 返回了无法解析的响应(${getErrorMessage(err)}`);
throw new Error(`Account run snapshot sync failed: local helper returned unparseable response (${getErrorMessage(err)})`);
}

if (!response.ok || payload?.ok === false) {
throw new Error(`账号记录快照同步失败:${payload?.error || `HTTP ${response.status}`}`);
throw new Error(`Account run snapshot sync failed: ${payload?.error || `HTTP ${response.status}`}`);
}

return payload?.filePath || '';
Expand All @@ -695,7 +695,7 @@
const history = await getPersistedAccountRunHistory();
const filePath = await syncAccountRunHistorySnapshot(history, state);
if (filePath) {
await addLog(`账号记录快照已同步到本地:${filePath}`, 'info');
await addLog(`Account run snapshot synced locally: ${filePath}`, 'info');
}
} catch (err) {
await addLog(getErrorMessage(err), 'warn');
Expand All @@ -712,7 +712,7 @@
try {
const filePath = await syncAccountRunHistorySnapshot([], state);
if (filePath) {
await addLog(`账号记录快照已同步到本地:${filePath}`, 'info');
await addLog(`Account run snapshot synced locally: ${filePath}`, 'info');
}
} catch (err) {
await addLog(getErrorMessage(err), 'warn');
Expand Down Expand Up @@ -740,7 +740,7 @@
try {
const filePath = await syncAccountRunHistorySnapshot(nextHistory, state);
if (filePath) {
await addLog(`账号记录快照已同步到本地:${filePath}`, 'info');
await addLog(`Account run snapshot synced locally: ${filePath}`, 'info');
}
} catch (err) {
await addLog(getErrorMessage(err), 'warn');
Expand Down
Loading