style: Update styles.scss and types.ts to include config property in DownloaderConf and MediaServerConf

This commit is contained in:
jxxghp
2024-08-11 15:09:56 +08:00
parent 235eb82c45
commit 8bd0f7a589
7 changed files with 428 additions and 97 deletions

View File

@@ -93,6 +93,12 @@ function addFilterRuleGroup() {
})
}
// 规则变化时赋值
function onRuleChange(rule: CustomRule) {
const index = customRules.value.findIndex(item => item.id === rule.id)
if (index !== -1) customRules.value[index] = rule
}
// 移除规则组
function removeFilterRuleGroup(rule: FilterRuleGroup) {
const index = filterRuleGroups.value.findIndex(item => item.name === rule.name)
@@ -148,10 +154,10 @@ onMounted(() => {
handle=".cursor-move"
item-key="name"
tag="div"
:component-data="{ 'class': 'grid gap-3 grid-filterrule-card' }"
:component-data="{ 'class': 'grid gap-3 grid-customrule-card' }"
>
<template #item="{ element }">
<CustomerRuleCard :rule="element" @close="removeCustomRule(element)" />
<CustomerRuleCard :rule="element" @close="removeCustomRule(element)" @change="onRuleChange" />
</template>
</draggable>
</VCardText>

View File

@@ -98,6 +98,7 @@ function addDownloader(downloader: string) {
type: downloader,
default: false,
enabled: false,
config: {},
})
}
@@ -113,6 +114,7 @@ function addMediaServer(mediaserver: string) {
name: `服务器${mediaServers.value.length + 1}`,
type: mediaserver,
enabled: false,
config: {},
})
}
@@ -188,7 +190,7 @@ onMounted(() => {
<VIcon icon="mdi-plus" />
<VMenu activator="parent" close-on-content-click>
<VList>
<VListItem variant="plain" @click="addDownloader('qbittottent')">
<VListItem variant="plain" @click="addDownloader('qbittorrent')">
<VListItemTitle>Qbittorrent</VListItemTitle>
</VListItem>
<VListItem variant="plain" @click="addDownloader('transmission')">