Merge branch 'QLHazyCoder:master' into master
This commit is contained in:
@@ -1971,6 +1971,16 @@ header {
|
||||
.data-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
|
||||
[data-theme="dark"] .data-select { color-scheme: dark; }
|
||||
|
||||
.data-input[readonly] {
|
||||
color: var(--text-secondary);
|
||||
background: var(--bg-surface);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.gpc-helper-api-input {
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
}
|
||||
|
||||
.editable-list-picker {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
@@ -2114,6 +2124,47 @@ header {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.auto-delay-setting-pair {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
#row-auto-delay-settings .setting-group-primary {
|
||||
flex: 0 0 auto;
|
||||
min-width: 116px;
|
||||
}
|
||||
|
||||
#row-auto-delay-settings .setting-group-secondary {
|
||||
margin-left: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.step6-cookie-cleanup-setting {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.auto-run-delay-setting {
|
||||
margin-left: auto !important;
|
||||
}
|
||||
|
||||
.oauth-flow-timeout-setting {
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.oauth-flow-timeout-caption {
|
||||
min-width: 0 !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#row-auto-delay-settings .setting-caption {
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.setting-caption-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.plus-payment-method-select {
|
||||
flex: 0 0 156px;
|
||||
min-width: 156px;
|
||||
|
||||
+50
-30
@@ -283,15 +283,23 @@
|
||||
<button id="btn-add-paypal-account" class="btn btn-outline btn-sm data-inline-btn" type="button">添加</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row" id="row-gpc-helper-api" style="display:none;">
|
||||
<span class="data-label">GPC API</span>
|
||||
<div class="data-inline">
|
||||
<input type="text" id="input-gpc-helper-api" class="data-input gpc-helper-api-input"
|
||||
value="https://gpc.qlhazycoder.top/" placeholder="https://gpc.qlhazycoder.top/" autocomplete="off" readonly />
|
||||
<button id="btn-gpc-helper-convert-api-key" class="btn btn-outline btn-sm data-inline-btn" type="button">转换 API Key</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row" id="row-gpc-helper-card-key" style="display:none;">
|
||||
<span class="data-label">GPC 卡密</span>
|
||||
<span class="data-label">GPC API Key</span>
|
||||
<div class="data-inline">
|
||||
<div class="input-with-icon">
|
||||
<input type="password" id="input-gpc-helper-card-key" class="data-input data-input-with-icon"
|
||||
placeholder="请输入购买的 GPC 卡密" autocomplete="off" />
|
||||
placeholder="请输入 GPC API Key(gpc-...)" autocomplete="off" />
|
||||
<button id="btn-toggle-gpc-helper-card-key" class="input-icon-btn" type="button"
|
||||
data-password-toggle="input-gpc-helper-card-key" data-show-label="显示 GPC 卡密"
|
||||
data-hide-label="隐藏 GPC 卡密" aria-label="显示 GPC 卡密" title="显示 GPC 卡密"></button>
|
||||
data-password-toggle="input-gpc-helper-card-key" data-show-label="显示 GPC API Key"
|
||||
data-hide-label="隐藏 GPC API Key" aria-label="显示 GPC API Key" title="显示 GPC API Key"></button>
|
||||
</div>
|
||||
<button id="btn-gpc-helper-balance" class="btn btn-ghost btn-xs data-inline-btn" type="button">查余额</button>
|
||||
<span id="display-gpc-helper-balance" class="data-value mono">余额未获取</span>
|
||||
@@ -334,7 +342,7 @@
|
||||
<span class="toggle-switch-thumb"></span>
|
||||
</span>
|
||||
</label>
|
||||
<span class="setting-caption">从本机 helper 读取当前通道 OTP,失败后回退手动输入</span>
|
||||
<span class="setting-caption">从本机 helper 读取当前通道 OTP,开启后不弹手动验证码</span>
|
||||
</div>
|
||||
<div class="data-row" id="row-gpc-helper-local-sms-url" style="display:none;">
|
||||
<span class="data-label">OTP 接口</span>
|
||||
@@ -542,9 +550,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row module-divider-start" id="row-auto-delay-settings">
|
||||
<span class="data-label">延迟</span>
|
||||
<div class="data-inline setting-pair">
|
||||
<div class="setting-group setting-group-primary">
|
||||
<span class="data-label">第六步</span>
|
||||
<div class="data-inline setting-pair auto-delay-setting-pair">
|
||||
<div class="setting-group setting-group-primary step6-cookie-cleanup-setting">
|
||||
<span class="setting-caption setting-caption-left">清 Cookies</span>
|
||||
<label class="toggle-switch" for="input-step6-cookie-cleanup-enabled">
|
||||
<input type="checkbox" id="input-step6-cookie-cleanup-enabled" />
|
||||
<span class="toggle-switch-track" aria-hidden="true">
|
||||
<span class="toggle-switch-thumb"></span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="setting-group setting-group-secondary auto-run-delay-setting">
|
||||
<span class="setting-caption">延迟</span>
|
||||
<label class="toggle-switch" for="input-auto-delay-enabled">
|
||||
<input type="checkbox" id="input-auto-delay-enabled" />
|
||||
<span class="toggle-switch-track" aria-hidden="true">
|
||||
@@ -557,14 +575,6 @@
|
||||
<span class="data-unit">分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-group setting-group-secondary">
|
||||
<span class="setting-caption">步间间隔</span>
|
||||
<div class="setting-controls">
|
||||
<input type="number" id="input-auto-step-delay-seconds" class="data-input auto-delay-input" value=""
|
||||
min="0" max="600" step="1" title="步间延迟秒数,0 或留空则不延迟" />
|
||||
<span class="data-unit">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row">
|
||||
@@ -578,6 +588,30 @@
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="setting-group setting-group-secondary auto-step-delay-setting">
|
||||
<span class="setting-caption">步间间隔</span>
|
||||
<div class="setting-controls">
|
||||
<input type="number" id="input-auto-step-delay-seconds" class="data-input auto-delay-input" value=""
|
||||
min="0" max="600" step="1" title="步间延迟秒数,0 或留空则不延迟" />
|
||||
<span class="data-unit">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row" id="row-oauth-flow-timeout">
|
||||
<span class="data-label">授权总超时</span>
|
||||
<div class="data-inline setting-pair">
|
||||
<div class="setting-group setting-group-primary oauth-flow-timeout-setting">
|
||||
<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 oauth-flow-timeout-caption">关闭后只取消 Step 7 后链总预算</span>
|
||||
</div>
|
||||
<div class="setting-group setting-group-secondary">
|
||||
<span class="setting-caption">线程间隔</span>
|
||||
<div class="setting-controls">
|
||||
@@ -588,20 +622,6 @@
|
||||
</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>
|
||||
|
||||
+39
-14
@@ -187,6 +187,7 @@ const payPalAccountMenu = document.getElementById('paypal-account-menu');
|
||||
const btnAddPayPalAccount = document.getElementById('btn-add-paypal-account');
|
||||
const rowGpcHelperApi = document.getElementById('row-gpc-helper-api');
|
||||
const inputGpcHelperApi = document.getElementById('input-gpc-helper-api');
|
||||
const btnGpcHelperConvertApiKey = document.getElementById('btn-gpc-helper-convert-api-key');
|
||||
const rowGpcHelperCardKey = document.getElementById('row-gpc-helper-card-key');
|
||||
const inputGpcHelperCardKey = document.getElementById('input-gpc-helper-card-key');
|
||||
const btnToggleGpcHelperCardKey = document.getElementById('btn-toggle-gpc-helper-card-key');
|
||||
@@ -375,6 +376,7 @@ const btnCfDomainMode = document.getElementById('btn-cf-domain-mode');
|
||||
const inputRunCount = document.getElementById('input-run-count');
|
||||
const inputAutoSkipFailures = document.getElementById('input-auto-skip-failures');
|
||||
const inputAutoSkipFailuresThreadIntervalMinutes = document.getElementById('input-auto-skip-failures-thread-interval-minutes');
|
||||
const inputStep6CookieCleanupEnabled = document.getElementById('input-step6-cookie-cleanup-enabled');
|
||||
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');
|
||||
@@ -507,7 +509,8 @@ const stepsList = document.querySelector('.steps-list');
|
||||
const PLUS_PAYMENT_METHOD_PAYPAL = 'paypal';
|
||||
const PLUS_PAYMENT_METHOD_GOPAY = 'gopay';
|
||||
const PLUS_PAYMENT_METHOD_GPC_HELPER = 'gpc-helper';
|
||||
const DEFAULT_GPC_HELPER_API_URL = 'https://gopay.hwork.pro';
|
||||
const DEFAULT_GPC_HELPER_API_URL = 'https://gpc.qlhazycoder.top';
|
||||
const GPC_HELPER_PORTAL_URL = 'https://gpc.qlhazycoder.top/';
|
||||
const DEFAULT_PLUS_PAYMENT_METHOD = PLUS_PAYMENT_METHOD_PAYPAL;
|
||||
const SIGNUP_METHOD_EMAIL = 'email';
|
||||
const SIGNUP_METHOD_PHONE = 'phone';
|
||||
@@ -2736,7 +2739,7 @@ function applyCloudMailSettingsState(state = {}) {
|
||||
function collectSettingsPayload() {
|
||||
const defaultGpcHelperApiUrl = typeof DEFAULT_GPC_HELPER_API_URL !== 'undefined'
|
||||
? DEFAULT_GPC_HELPER_API_URL
|
||||
: 'https://gopay.hwork.pro';
|
||||
: 'https://gpc.qlhazycoder.top';
|
||||
const { domains, activeDomain } = getCloudflareDomainsFromState();
|
||||
const selectedCloudflareDomain = normalizeCloudflareDomainValue(
|
||||
!cloudflareDomainEditMode ? selectCfDomain.value : activeDomain
|
||||
@@ -3324,13 +3327,12 @@ function collectSettingsPayload() {
|
||||
? String(inputGoPayPin.value || '')
|
||||
: String(latestState?.gopayPin || '')),
|
||||
gopayHelperApiUrl: window.GoPayUtils?.normalizeGpcHelperBaseUrl
|
||||
? window.GoPayUtils.normalizeGpcHelperBaseUrl(typeof inputGpcHelperApi !== 'undefined' && inputGpcHelperApi ? inputGpcHelperApi.value : (latestState?.gopayHelperApiUrl || defaultGpcHelperApiUrl))
|
||||
: (typeof inputGpcHelperApi !== 'undefined' && inputGpcHelperApi
|
||||
? String(inputGpcHelperApi.value || defaultGpcHelperApiUrl).trim().replace(/\/+$/g, '')
|
||||
: String(latestState?.gopayHelperApiUrl || defaultGpcHelperApiUrl).trim()),
|
||||
gopayHelperCardKey: typeof inputGpcHelperCardKey !== 'undefined' && inputGpcHelperCardKey
|
||||
? window.GoPayUtils.normalizeGpcHelperBaseUrl(defaultGpcHelperApiUrl)
|
||||
: String(defaultGpcHelperApiUrl).trim().replace(/\/+$/g, ''),
|
||||
gopayHelperApiKey: typeof inputGpcHelperCardKey !== 'undefined' && inputGpcHelperCardKey
|
||||
? String(inputGpcHelperCardKey.value || '').trim()
|
||||
: String(latestState?.gopayHelperCardKey || '').trim(),
|
||||
: String(latestState?.gopayHelperApiKey || latestState?.gopayHelperCardKey || '').trim(),
|
||||
gopayHelperCardKey: '',
|
||||
gopayHelperCountryCode: window.GoPayUtils?.normalizeGoPayCountryCode
|
||||
? window.GoPayUtils.normalizeGoPayCountryCode(typeof selectGpcHelperCountryCode !== 'undefined' && selectGpcHelperCountryCode ? selectGpcHelperCountryCode.value : latestState?.gopayHelperCountryCode)
|
||||
: (typeof selectGpcHelperCountryCode !== 'undefined' && selectGpcHelperCountryCode
|
||||
@@ -3403,6 +3405,9 @@ function collectSettingsPayload() {
|
||||
cloudMailDomain: normalizeCloudflareTempEmailDomainValue((typeof inputCloudMailDomain !== 'undefined' && inputCloudMailDomain) ? inputCloudMailDomain.value : ''),
|
||||
autoRunSkipFailures: inputAutoSkipFailures.checked,
|
||||
autoRunFallbackThreadIntervalMinutes: normalizeAutoRunThreadIntervalMinutes(inputAutoSkipFailuresThreadIntervalMinutes.value),
|
||||
step6CookieCleanupEnabled: typeof inputStep6CookieCleanupEnabled !== 'undefined' && inputStep6CookieCleanupEnabled
|
||||
? Boolean(inputStep6CookieCleanupEnabled.checked)
|
||||
: false,
|
||||
autoRunDelayEnabled: inputAutoDelayEnabled.checked,
|
||||
autoRunDelayMinutes: normalizeAutoDelayMinutes(inputAutoDelayMinutes.value),
|
||||
autoStepDelaySeconds: normalizeAutoStepDelaySeconds(inputAutoStepDelaySeconds.value),
|
||||
@@ -7224,6 +7229,7 @@ function updatePlusModeUI() {
|
||||
row.style.display = enabled && selectedMethod === paypalValue ? '' : 'none';
|
||||
});
|
||||
[
|
||||
typeof rowGpcHelperApi !== 'undefined' ? rowGpcHelperApi : null,
|
||||
typeof rowGpcHelperCardKey !== 'undefined' ? rowGpcHelperCardKey : null,
|
||||
typeof rowGpcHelperCountryCode !== 'undefined' ? rowGpcHelperCountryCode : null,
|
||||
typeof rowGpcHelperPhone !== 'undefined' ? rowGpcHelperPhone : null,
|
||||
@@ -7473,7 +7479,7 @@ async function openPlusManualConfirmationDialog(options = {}) {
|
||||
validate: (value) => {
|
||||
const normalized = String(value || '').trim().replace(/[^\d]/g, '');
|
||||
if (!normalized) return '请输入 OTP 验证码。';
|
||||
if (normalized.length < 4) return 'OTP 验证码长度过短,请检查。';
|
||||
if (!/^\d{6}$/.test(normalized)) return 'OTP 必须是 6 位数字,请检查。';
|
||||
return '';
|
||||
},
|
||||
},
|
||||
@@ -7966,11 +7972,11 @@ function applySettingsState(state) {
|
||||
if (typeof inputGpcHelperApi !== 'undefined' && inputGpcHelperApi) {
|
||||
const defaultGpcHelperApiUrl = typeof DEFAULT_GPC_HELPER_API_URL !== 'undefined'
|
||||
? DEFAULT_GPC_HELPER_API_URL
|
||||
: 'https://gopay.hwork.pro';
|
||||
inputGpcHelperApi.value = state?.gopayHelperApiUrl || defaultGpcHelperApiUrl;
|
||||
: 'https://gpc.qlhazycoder.top';
|
||||
inputGpcHelperApi.value = `${defaultGpcHelperApiUrl.replace(/\/+$/g, '')}/`;
|
||||
}
|
||||
if (typeof inputGpcHelperCardKey !== 'undefined' && inputGpcHelperCardKey) {
|
||||
inputGpcHelperCardKey.value = state?.gopayHelperCardKey || '';
|
||||
inputGpcHelperCardKey.value = state?.gopayHelperApiKey || state?.gopayHelperCardKey || '';
|
||||
}
|
||||
if (typeof selectGpcHelperCountryCode !== 'undefined' && selectGpcHelperCountryCode) {
|
||||
const normalizedCountryCode = window.GoPayUtils?.normalizeGoPayCountryCode
|
||||
@@ -8218,6 +8224,9 @@ function applySettingsState(state) {
|
||||
setCloudflareDomainEditMode(false, { clearInput: true });
|
||||
inputAutoSkipFailures.checked = Boolean(state?.autoRunSkipFailures);
|
||||
inputAutoSkipFailuresThreadIntervalMinutes.value = String(normalizeAutoRunThreadIntervalMinutes(state?.autoRunFallbackThreadIntervalMinutes));
|
||||
if (typeof inputStep6CookieCleanupEnabled !== 'undefined' && inputStep6CookieCleanupEnabled) {
|
||||
inputStep6CookieCleanupEnabled.checked = Boolean(state?.step6CookieCleanupEnabled);
|
||||
}
|
||||
inputAutoDelayEnabled.checked = Boolean(state?.autoRunDelayEnabled);
|
||||
inputAutoDelayMinutes.value = String(normalizeAutoDelayMinutes(state?.autoRunDelayMinutes));
|
||||
inputAutoStepDelaySeconds.value = formatAutoStepDelayInputValue(state?.autoStepDelaySeconds);
|
||||
@@ -11407,14 +11416,18 @@ btnGpcCardKeyPurchase?.addEventListener('click', () => {
|
||||
openExternalUrl('https://pay.ldxp.cn/shop/gpc');
|
||||
});
|
||||
|
||||
btnGpcHelperConvertApiKey?.addEventListener('click', () => {
|
||||
openExternalUrl(GPC_HELPER_PORTAL_URL);
|
||||
});
|
||||
|
||||
btnGpcHelperBalance?.addEventListener('click', async () => {
|
||||
try {
|
||||
const response = await chrome.runtime.sendMessage({
|
||||
type: 'REFRESH_GPC_CARD_BALANCE',
|
||||
source: 'sidepanel',
|
||||
payload: {
|
||||
gopayHelperApiUrl: inputGpcHelperApi?.value || DEFAULT_GPC_HELPER_API_URL,
|
||||
gopayHelperCardKey: inputGpcHelperCardKey?.value || '',
|
||||
gopayHelperApiUrl: DEFAULT_GPC_HELPER_API_URL,
|
||||
gopayHelperApiKey: inputGpcHelperCardKey?.value || '',
|
||||
gopayHelperCountryCode: selectGpcHelperCountryCode?.value || '+86',
|
||||
reason: 'manual',
|
||||
},
|
||||
@@ -12348,6 +12361,11 @@ inputAutoDelayEnabled.addEventListener('change', () => {
|
||||
saveSettings({ silent: true }).catch(() => { });
|
||||
});
|
||||
|
||||
inputStep6CookieCleanupEnabled?.addEventListener('change', () => {
|
||||
markSettingsDirty(true);
|
||||
saveSettings({ silent: true }).catch(() => { });
|
||||
});
|
||||
|
||||
inputAutoDelayMinutes.addEventListener('input', () => {
|
||||
markSettingsDirty(true);
|
||||
scheduleSettingsAutoSave();
|
||||
@@ -13483,6 +13501,13 @@ chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => {
|
||||
inputAutoDelayEnabled.checked = Boolean(message.payload.autoRunDelayEnabled);
|
||||
updateAutoDelayInputState();
|
||||
}
|
||||
if (
|
||||
message.payload.step6CookieCleanupEnabled !== undefined
|
||||
&& typeof inputStep6CookieCleanupEnabled !== 'undefined'
|
||||
&& inputStep6CookieCleanupEnabled
|
||||
) {
|
||||
inputStep6CookieCleanupEnabled.checked = Boolean(message.payload.step6CookieCleanupEnabled);
|
||||
}
|
||||
if (message.payload.autoRunDelayMinutes !== undefined) {
|
||||
inputAutoDelayMinutes.value = String(normalizeAutoDelayMinutes(message.payload.autoRunDelayMinutes));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user