Add OAuth flow timeout toggle
This commit is contained in:
@@ -394,6 +394,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row" id="row-oauth-flow-timeout">
|
||||
<span class="data-label">授权总超时</span>
|
||||
<div class="data-inline">
|
||||
<label class="toggle-switch" for="input-oauth-flow-timeout-enabled"
|
||||
title="关闭后不再用 5 分钟总预算重启授权链,但页面、点击、回调等本地等待超时仍会生效">
|
||||
<input type="checkbox" id="input-oauth-flow-timeout-enabled" checked />
|
||||
<span class="toggle-switch-track" aria-hidden="true">
|
||||
<span class="toggle-switch-thumb"></span>
|
||||
</span>
|
||||
<span>启用</span>
|
||||
</label>
|
||||
<span class="setting-caption">关闭后只取消 Step 7 后链总预算</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row module-divider-start" id="row-oauth-display">
|
||||
<span class="data-label">OAuth</span>
|
||||
<span id="display-oauth-url" class="data-value mono truncate">等待中...</span>
|
||||
|
||||
@@ -288,6 +288,7 @@ const inputAutoSkipFailuresThreadIntervalMinutes = document.getElementById('inpu
|
||||
const inputAutoDelayEnabled = document.getElementById('input-auto-delay-enabled');
|
||||
const inputAutoDelayMinutes = document.getElementById('input-auto-delay-minutes');
|
||||
const inputAutoStepDelaySeconds = document.getElementById('input-auto-step-delay-seconds');
|
||||
const inputOAuthFlowTimeoutEnabled = document.getElementById('input-oauth-flow-timeout-enabled');
|
||||
const inputVerificationResendCount = document.getElementById('input-verification-resend-count');
|
||||
const rowPhoneVerificationEnabled = document.getElementById('row-phone-verification-enabled');
|
||||
const btnTogglePhoneVerificationSection = document.getElementById('btn-toggle-phone-verification-section');
|
||||
@@ -2650,6 +2651,9 @@ function collectSettingsPayload() {
|
||||
autoRunDelayEnabled: inputAutoDelayEnabled.checked,
|
||||
autoRunDelayMinutes: normalizeAutoDelayMinutes(inputAutoDelayMinutes.value),
|
||||
autoStepDelaySeconds: normalizeAutoStepDelaySeconds(inputAutoStepDelaySeconds.value),
|
||||
oauthFlowTimeoutEnabled: inputOAuthFlowTimeoutEnabled
|
||||
? Boolean(inputOAuthFlowTimeoutEnabled.checked)
|
||||
: true,
|
||||
phoneVerificationEnabled: Boolean(inputPhoneVerificationEnabled?.checked),
|
||||
verificationResendCount: normalizeVerificationResendCount(
|
||||
inputVerificationResendCount?.value,
|
||||
@@ -4202,6 +4206,11 @@ function applySettingsState(state) {
|
||||
inputAutoDelayEnabled.checked = Boolean(state?.autoRunDelayEnabled);
|
||||
inputAutoDelayMinutes.value = String(normalizeAutoDelayMinutes(state?.autoRunDelayMinutes));
|
||||
inputAutoStepDelaySeconds.value = formatAutoStepDelayInputValue(state?.autoStepDelaySeconds);
|
||||
if (inputOAuthFlowTimeoutEnabled) {
|
||||
inputOAuthFlowTimeoutEnabled.checked = state?.oauthFlowTimeoutEnabled !== undefined
|
||||
? Boolean(state.oauthFlowTimeoutEnabled)
|
||||
: true;
|
||||
}
|
||||
if (inputVerificationResendCount) {
|
||||
const restoredVerificationResendCount = state?.verificationResendCount !== undefined
|
||||
? state.verificationResendCount
|
||||
@@ -7765,6 +7774,11 @@ inputAutoDelayMinutes.addEventListener('blur', () => {
|
||||
saveSettings({ silent: true }).catch(() => { });
|
||||
});
|
||||
|
||||
inputOAuthFlowTimeoutEnabled?.addEventListener('change', () => {
|
||||
markSettingsDirty(true);
|
||||
saveSettings({ silent: true }).catch(() => { });
|
||||
});
|
||||
|
||||
inputPhoneVerificationEnabled?.addEventListener('change', () => {
|
||||
if (inputPhoneVerificationEnabled.checked) {
|
||||
setPhoneVerificationSectionExpanded(true);
|
||||
@@ -8357,6 +8371,9 @@ chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => {
|
||||
if (message.payload.autoStepDelaySeconds !== undefined) {
|
||||
inputAutoStepDelaySeconds.value = formatAutoStepDelayInputValue(message.payload.autoStepDelaySeconds);
|
||||
}
|
||||
if (message.payload.oauthFlowTimeoutEnabled !== undefined && inputOAuthFlowTimeoutEnabled) {
|
||||
inputOAuthFlowTimeoutEnabled.checked = Boolean(message.payload.oauthFlowTimeoutEnabled);
|
||||
}
|
||||
if (
|
||||
(
|
||||
message.payload.verificationResendCount !== undefined
|
||||
|
||||
Reference in New Issue
Block a user