Merge pull request #446 from DDSRem-Dev/rtorrent

This commit is contained in:
jxxghp
2026-02-22 16:11:12 +08:00
committed by GitHub
8 changed files with 131 additions and 2 deletions
+4
View File
@@ -52,6 +52,10 @@ export const downloaderOptions = [
value: 'transmission', value: 'transmission',
title: i18n.global.t('setting.system.transmission'), title: i18n.global.t('setting.system.transmission'),
}, },
{
value: 'rtorrent',
title: i18n.global.t('setting.system.rtorrent'),
},
] ]
export const downloaderDict = downloaderOptions.reduce((dict, item) => { export const downloaderDict = downloaderOptions.reduce((dict, item) => {
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

+47
View File
@@ -206,6 +206,8 @@ const getIcon = computed(() => {
return getLogoUrl('qbittorrent') return getLogoUrl('qbittorrent')
case 'transmission': case 'transmission':
return getLogoUrl('transmission') return getLogoUrl('transmission')
case 'rtorrent':
return getLogoUrl('rtorrent')
default: default:
return getLogoUrl('downloader') return getLogoUrl('downloader')
} }
@@ -443,6 +445,51 @@ onUnmounted(() => {
/> />
</VCol> </VCol>
</VRow> </VRow>
<VRow v-else-if="downloaderInfo.type == 'rtorrent'">
<VCol cols="12" md="6">
<VTextField
v-model="downloaderInfo.name"
:label="t('downloader.name')"
:placeholder="t('downloader.nameRequired')"
:hint="t('downloader.name')"
persistent-hint
active
prepend-inner-icon="mdi-label"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="downloaderInfo.config.host"
:label="t('downloader.host')"
placeholder="http(s)://ip:port/RPC2"
:hint="t('downloader.rtorrentHostHint')"
persistent-hint
active
prepend-inner-icon="mdi-server"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="downloaderInfo.config.username"
:label="t('downloader.username')"
:hint="t('downloader.username')"
persistent-hint
active
prepend-inner-icon="mdi-account"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="downloaderInfo.config.password"
type="password"
:label="t('downloader.password')"
:hint="t('downloader.password')"
persistent-hint
active
prepend-inner-icon="mdi-lock"
/>
</VCol>
</VRow>
<VRow v-else> <VRow v-else>
<VCol cols="12" md="6"> <VCol cols="12" md="6">
<VTextField <VTextField
+2
View File
@@ -1337,6 +1337,7 @@ export default {
reloading: 'Applying configuration...', reloading: 'Applying configuration...',
qbittorrent: 'Qbittorrent', qbittorrent: 'Qbittorrent',
transmission: 'Transmission', transmission: 'Transmission',
rtorrent: 'rTorrent',
emby: 'Emby', emby: 'Emby',
jellyfin: 'Jellyfin', jellyfin: 'Jellyfin',
plex: 'Plex', plex: 'Plex',
@@ -2782,6 +2783,7 @@ export default {
type: 'Type', type: 'Type',
enabled: 'Enabled', enabled: 'Enabled',
customTypeHint: 'Custom downloader type, for plugin scenarios', customTypeHint: 'Custom downloader type, for plugin scenarios',
rtorrentHostHint: 'HTTP: http://ip:port/RPC2 or SCGI: scgi://ip:port',
default: 'Default', default: 'Default',
host: 'Host', host: 'Host',
username: 'Username', username: 'Username',
+2
View File
@@ -1332,6 +1332,7 @@ export default {
reloading: '正在应用配置...', reloading: '正在应用配置...',
qbittorrent: 'Qbittorrent', qbittorrent: 'Qbittorrent',
transmission: 'Transmission', transmission: 'Transmission',
rtorrent: 'rTorrent',
emby: 'Emby', emby: 'Emby',
jellyfin: 'Jellyfin', jellyfin: 'Jellyfin',
plex: 'Plex', plex: 'Plex',
@@ -2746,6 +2747,7 @@ export default {
type: '类型', type: '类型',
enabled: '启用', enabled: '启用',
customTypeHint: '自定义下载器类型,用于插件等场景', customTypeHint: '自定义下载器类型,用于插件等场景',
rtorrentHostHint: 'HTTP: http://ip:port/RPC2 或 SCGI: scgi://ip:port',
default: '默认', default: '默认',
host: '地址', host: '地址',
username: '用户名', username: '用户名',
+2
View File
@@ -1333,6 +1333,7 @@ export default {
reloading: '正在應用配置...', reloading: '正在應用配置...',
qbittorrent: 'Qbittorrent', qbittorrent: 'Qbittorrent',
transmission: 'Transmission', transmission: 'Transmission',
rtorrent: 'rTorrent',
emby: 'Emby', emby: 'Emby',
jellyfin: 'Jellyfin', jellyfin: 'Jellyfin',
plex: 'Plex', plex: 'Plex',
@@ -2746,6 +2747,7 @@ export default {
name: '名稱', name: '名稱',
type: '類型', type: '類型',
customTypeHint: '自定義下載器類型,用於插件等場景', customTypeHint: '自定義下載器類型,用於插件等場景',
rtorrentHostHint: 'HTTP: http://ip:port/RPC2 或 SCGI: scgi://ip:port',
enabled: '啟用', enabled: '啟用',
default: '預設', default: '預設',
host: '地址', host: '地址',
+2
View File
@@ -6,6 +6,7 @@
// 导入所有 logo 图标 // 导入所有 logo 图标
import qbittorrentLogo from '@/assets/images/logos/qbittorrent.png' import qbittorrentLogo from '@/assets/images/logos/qbittorrent.png'
import transmissionLogo from '@/assets/images/logos/transmission.png' import transmissionLogo from '@/assets/images/logos/transmission.png'
import rtorrentLogo from '@/assets/images/logos/rtorrent.png'
import embyLogo from '@/assets/images/logos/emby.png' import embyLogo from '@/assets/images/logos/emby.png'
import jellyfinLogo from '@/assets/images/logos/jellyfin.png' import jellyfinLogo from '@/assets/images/logos/jellyfin.png'
import plexLogo from '@/assets/images/logos/plex.png' import plexLogo from '@/assets/images/logos/plex.png'
@@ -34,6 +35,7 @@ import doubanBlackLogo from '@/assets/images/logos/douban-black.png'
const logoMap: Record<string, string> = { const logoMap: Record<string, string> = {
qbittorrent: qbittorrentLogo, qbittorrent: qbittorrentLogo,
transmission: transmissionLogo, transmission: transmissionLogo,
rtorrent: rtorrentLogo,
emby: embyLogo, emby: embyLogo,
jellyfin: jellyfinLogo, jellyfin: jellyfinLogo,
plex: plexLogo, plex: plexLogo,
+72 -2
View File
@@ -27,7 +27,7 @@ const { wizardData, selectDownloader, validationErrors } = useSetupWizard()
<div class="mb-4"> <div class="mb-4">
<h4 class="text-h6 mb-4">{{ t('setupWizard.downloader.type') }}</h4> <h4 class="text-h6 mb-4">{{ t('setupWizard.downloader.type') }}</h4>
<VRow> <VRow>
<VCol cols="12" md="6"> <VCol cols="12" md="4">
<VCard <VCard
:color="wizardData.downloader.type === 'qbittorrent' ? 'primary' : 'default'" :color="wizardData.downloader.type === 'qbittorrent' ? 'primary' : 'default'"
:variant="wizardData.downloader.type === 'qbittorrent' ? 'tonal' : 'outlined'" :variant="wizardData.downloader.type === 'qbittorrent' ? 'tonal' : 'outlined'"
@@ -40,7 +40,7 @@ const { wizardData, selectDownloader, validationErrors } = useSetupWizard()
</VCardText> </VCardText>
</VCard> </VCard>
</VCol> </VCol>
<VCol cols="12" md="6"> <VCol cols="12" md="4">
<VCard <VCard
:color="wizardData.downloader.type === 'transmission' ? 'primary' : 'default'" :color="wizardData.downloader.type === 'transmission' ? 'primary' : 'default'"
:variant="wizardData.downloader.type === 'transmission' ? 'tonal' : 'outlined'" :variant="wizardData.downloader.type === 'transmission' ? 'tonal' : 'outlined'"
@@ -53,6 +53,19 @@ const { wizardData, selectDownloader, validationErrors } = useSetupWizard()
</VCardText> </VCardText>
</VCard> </VCard>
</VCol> </VCol>
<VCol cols="12" md="4">
<VCard
:color="wizardData.downloader.type === 'rtorrent' ? 'primary' : 'default'"
:variant="wizardData.downloader.type === 'rtorrent' ? 'tonal' : 'outlined'"
class="cursor-pointer"
@click="selectDownloader('rtorrent')"
>
<VCardText class="text-center">
<VImg :src="getLogoUrl('rtorrent')" height="48" width="48" class="mx-auto mb-2" />
<div class="text-h6">rTorrent</div>
</VCardText>
</VCard>
</VCol>
</VRow> </VRow>
</div> </div>
</VCol> </VCol>
@@ -203,6 +216,63 @@ const { wizardData, selectDownloader, validationErrors } = useSetupWizard()
/> />
</VCol> </VCol>
</VRow> </VRow>
<VRow v-else-if="wizardData.downloader.type === 'rtorrent'">
<VCol cols="12" md="6">
<VTextField
v-model="wizardData.downloader.name"
:label="t('downloader.name')"
:placeholder="t('downloader.nameRequired')"
:hint="t('downloader.name')"
:error="validationErrors.downloader.name"
:error-messages="validationErrors.downloader.name ? [t('downloader.nameRequired')] : []"
persistent-hint
active
prepend-inner-icon="mdi-label"
required
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="wizardData.downloader.config.host"
:label="t('downloader.host')"
placeholder="http(s)://ip:port/RPC2"
:hint="t('downloader.rtorrentHostHint')"
:error="validationErrors.downloader.host"
:error-messages="validationErrors.downloader.host ? [t('downloader.hostRequired')] : []"
persistent-hint
active
prepend-inner-icon="mdi-server"
required
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="wizardData.downloader.config.username"
:label="t('downloader.username')"
:hint="t('downloader.username')"
:error="validationErrors.downloader.username"
:error-messages="validationErrors.downloader.username ? [t('downloader.usernameRequired')] : []"
persistent-hint
active
prepend-inner-icon="mdi-account"
required
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="wizardData.downloader.config.password"
type="password"
:label="t('downloader.password')"
:hint="t('downloader.password')"
:error="validationErrors.downloader.password"
:error-messages="validationErrors.downloader.password ? [t('downloader.passwordRequired')] : []"
persistent-hint
active
prepend-inner-icon="mdi-lock"
required
/>
</VCol>
</VRow>
<VRow v-else> <VRow v-else>
<VCol cols="12" md="6"> <VCol cols="12" md="6">
<VTextField <VTextField