feat: 移除贡献模式确认弹窗,简化进入流程,更新相关测试

This commit is contained in:
QLHazyCoder
2026-04-20 01:18:59 +08:00
parent 0d0cf4b2af
commit 95750056ad
6 changed files with 26 additions and 233 deletions
-11
View File
@@ -247,17 +247,6 @@
}
async function enterContributionMode() {
const confirmed = await helpers.openConfirmModal?.({
title: '贡献账号',
message: '是否确认给作者 QLHazyCoder 提供账号以支持继续维护项目?',
confirmLabel: '确定',
confirmVariant: 'btn-primary',
});
if (!confirmed) {
return;
}
await requestContributionMode(true);
helpers.showToast?.('已进入贡献模式。', 'success', 1800);
}
+1 -3
View File
@@ -35,7 +35,7 @@
<div class="header-btns">
<div class="run-group">
<button id="btn-contribution-mode" class="btn btn-outline btn-sm btn-contribution-mode" type="button"
title="打开账号贡献上传页面">贡献</button>
aria-pressed="false" title="进入贡献模式">贡献</button>
<input type="number" id="input-run-count" class="run-count-input" value="1" min="1" max="50" title="运行次数" />
<button id="btn-auto-run" class="btn btn-success" title="自动执行全部步骤">
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
@@ -52,8 +52,6 @@
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10" />
</svg>
</button>
<button id="btn-contribution-mode" class="btn btn-outline btn-sm btn-contribution-mode" type="button"
aria-pressed="false">贡献</button>
<button id="btn-theme" class="theme-toggle" title="切换主题">
<svg class="icon-moon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
-18
View File
@@ -235,7 +235,6 @@ const DEFAULT_LUCKMAIL_BASE_URL = 'https://mails.luckyous.com';
const DEFAULT_LUCKMAIL_EMAIL_TYPE = 'ms_graph';
const DISPLAY_TIMEZONE = 'Asia/Shanghai';
const DEFAULT_ACCOUNT_RUN_HISTORY_HELPER_BASE_URL = 'http://127.0.0.1:17373';
const CONTRIBUTION_UPLOAD_URL = 'https://apikey.qzz.io/';
function getManagedAliasUtils() {
return window.MultiPageManagedAliasUtils || null;
@@ -1900,15 +1899,6 @@ function openReleaseListPage() {
openExternalUrl(getReleaseListUrl());
}
async function openContributionUploadPage() {
if (isContributionButtonLocked()) {
throw new Error('当前流程运行中,请先停止后再打开贡献页面。');
}
openExternalUrl(CONTRIBUTION_UPLOAD_URL);
return true;
}
function createUpdateNoteList(notes = []) {
if (!Array.isArray(notes) || notes.length === 0) {
const empty = document.createElement('p');
@@ -3410,14 +3400,6 @@ btnConfigMenu?.addEventListener('click', (event) => {
toggleConfigMenu();
});
btnContributionMode?.addEventListener('click', async () => {
try {
await openContributionUploadPage();
} catch (err) {
showToast(err.message, 'error');
}
});
btnRepoHome?.addEventListener('click', () => {
openRepositoryHomePage();
});