diff --git a/src/components/cards/DownloaderCard.vue b/src/components/cards/DownloaderCard.vue
index f152d395..f7717a86 100644
--- a/src/components/cards/DownloaderCard.vue
+++ b/src/components/cards/DownloaderCard.vue
@@ -346,11 +346,23 @@ onUnmounted(() => {
prepend-inner-icon="mdi-server"
/>
+
+
+
{
type="password"
:label="t('downloader.password')"
:hint="t('downloader.password')"
+ :disabled="!!downloaderInfo.config.apikey"
persistent-hint
active
prepend-inner-icon="mdi-lock"
diff --git a/src/composables/useSetupWizard.ts b/src/composables/useSetupWizard.ts
index df98483e..b676507b 100644
--- a/src/composables/useSetupWizard.ts
+++ b/src/composables/useSetupWizard.ts
@@ -107,6 +107,7 @@ export interface ValidationErrorState {
downloader: {
name: boolean
host: boolean
+ apikey: boolean
username: boolean
password: boolean
}
@@ -277,6 +278,7 @@ const validationErrors = ref({
downloader: {
name: false,
host: false,
+ apikey: false,
username: false,
password: false,
},
@@ -466,6 +468,7 @@ export function useSetupWizard() {
validationErrors.value.downloader = {
name: false,
host: false,
+ apikey: false,
username: false,
password: false,
}
@@ -548,9 +551,18 @@ export function useSetupWizard() {
}
// 根据下载器类型验证其他必输项
- if (
- wizardData.value.downloader.type === 'qbittorrent'
- || wizardData.value.downloader.type === 'transmission'
+ if (wizardData.value.downloader.type === 'qbittorrent') {
+ const hasApiKey = !!wizardData.value.downloader.config?.apikey?.trim()
+ if (!hasApiKey && !wizardData.value.downloader.config?.username?.trim()) {
+ errors.push(t('downloader.usernameRequired'))
+ validationErrors.value.downloader.username = true
+ }
+ if (!hasApiKey && !wizardData.value.downloader.config?.password?.trim()) {
+ errors.push(t('downloader.passwordRequired'))
+ validationErrors.value.downloader.password = true
+ }
+ } else if (
+ wizardData.value.downloader.type === 'transmission'
|| wizardData.value.downloader.type === 'rtorrent'
) {
if (!wizardData.value.downloader.config?.username?.trim()) {
diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts
index 7b5bc5e7..4b1e3381 100644
--- a/src/locales/en-US.ts
+++ b/src/locales/en-US.ts
@@ -2933,8 +2933,10 @@ export default {
rtorrentHostHint: 'HTTP: http://ip:port/RPC2 or SCGI: scgi://ip:port',
default: 'Default',
host: 'Host',
+ apiKey: 'API Key',
username: 'Username',
password: 'Password',
+ qbittorrentApiKeyHint: 'For qBittorrent 5.2+, you can use the WebUI API Key directly. When set, API Key auth is preferred.',
category: 'Auto Category Management',
sequentail: 'Sequential Download',
force_resume: 'Force Resume',
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index e408cb16..e23ecb24 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -2886,8 +2886,10 @@ export default {
rtorrentHostHint: 'HTTP: http://ip:port/RPC2 或 SCGI: scgi://ip:port',
default: '默认',
host: '地址',
+ apiKey: 'API Key',
username: '用户名',
password: '密码',
+ qbittorrentApiKeyHint: 'qBittorrent 5.2+ 可直接使用 WebUI API Key;填写后将优先使用 API Key 登录。',
category: '自动分类管理',
sequentail: '顺序下载',
force_resume: '强制继续',
diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts
index 10a65bac..501886a4 100644
--- a/src/locales/zh-TW.ts
+++ b/src/locales/zh-TW.ts
@@ -2888,8 +2888,10 @@ export default {
enabled: '啟用',
default: '預設',
host: '地址',
+ apiKey: 'API Key',
username: '用戶名',
password: '密碼',
+ qbittorrentApiKeyHint: 'qBittorrent 5.2+ 可直接使用 WebUI API Key;填寫後將優先使用 API Key 登入。',
category: '自動分類管理',
sequentail: '順序下載',
force_resume: '強制繼續',
diff --git a/src/views/setup/DownloaderSettingsStep.vue b/src/views/setup/DownloaderSettingsStep.vue
index 3e8c1d8f..50e4f63c 100644
--- a/src/views/setup/DownloaderSettingsStep.vue
+++ b/src/views/setup/DownloaderSettingsStep.vue
@@ -104,6 +104,17 @@ const { wizardData, selectDownloader, validationErrors } = useSetupWizard()
required
/>
+
+
+
@@ -125,10 +137,11 @@ const { wizardData, selectDownloader, validationErrors } = useSetupWizard()
:hint="t('downloader.password')"
:error="validationErrors.downloader.password"
:error-messages="validationErrors.downloader.password ? [t('downloader.passwordRequired')] : []"
+ :disabled="!!wizardData.downloader.config.apikey"
persistent-hint
active
prepend-inner-icon="mdi-lock"
- required
+ :required="!wizardData.downloader.config.apikey"
/>