refactor(setting): update TorrentPriorityItems in AccountSettingRule.vue

This commit is contained in:
jxxghp
2024-10-16 15:23:54 +08:00
parent e9a5c0ae69
commit 06e0f4234f
2 changed files with 19 additions and 12 deletions
+14 -11
View File
@@ -25,9 +25,10 @@ const $toast = useToast()
// 种子优先规则下拉框 // 种子优先规则下拉框
const TorrentPriorityItems = [ const TorrentPriorityItems = [
{ title: '站点排序优先', value: 'site' }, { title: '资源优先', value: 'torrent' },
{ title: '站点上传量优先', value: 'upload' }, { title: '站点优先', value: 'site' },
{ title: '资源做种数优先', value: 'seeder' }, { title: '站点上传量', value: 'upload' },
{ title: '资源做种数', value: 'seeder' },
] ]
// 调用API查询自动分类配置 // 调用API查询自动分类配置
@@ -52,13 +53,13 @@ async function saveCustomRules() {
// 添加自定义规则 // 添加自定义规则
function addCustomRule() { function addCustomRule() {
let id = `RULE${customRules.value.length + 1}`; let id = `RULE${customRules.value.length + 1}`
while (customRules.value.some(item => item.id === id)) { while (customRules.value.some(item => item.id === id)) {
id = `RULE${parseInt(id.split('RULE')[1]) + 1}`; id = `RULE${parseInt(id.split('RULE')[1]) + 1}`
} }
let name = `规则${customRules.value.length + 1}`; let name = `规则${customRules.value.length + 1}`
while (customRules.value.some(item => item.name === name)) { while (customRules.value.some(item => item.name === name)) {
name = `规则${parseInt(name.split('规则')[1]) + 1}`; name = `规则${parseInt(name.split('规则')[1]) + 1}`
} }
customRules.value.push({ customRules.value.push({
id: id, id: id,
@@ -97,9 +98,9 @@ async function saveFilterRuleGroups() {
// 添加规则组 // 添加规则组
function addFilterRuleGroup() { function addFilterRuleGroup() {
let name = `规则组${filterRuleGroups.value.length + 1}`; let name = `规则组${filterRuleGroups.value.length + 1}`
while (filterRuleGroups.value.some(item => item.name === name)) { while (filterRuleGroups.value.some(item => item.name === name)) {
name = `规则组${parseInt(name.split('规则组')[1]) + 1}`; name = `规则组${parseInt(name.split('规则组')[1]) + 1}`
} }
filterRuleGroups.value.push({ filterRuleGroups.value.push({
name: name, name: name,
@@ -245,7 +246,7 @@ onMounted(() => {
<VCard> <VCard>
<VCardItem> <VCardItem>
<VCardTitle>下载规则</VCardTitle> <VCardTitle>下载规则</VCardTitle>
<VCardSubtitle>按站点或做种数量优先下载</VCardSubtitle> <VCardSubtitle>同时命中多个资源时择优下载</VCardSubtitle>
</VCardItem> </VCardItem>
<VCardText> <VCardText>
<VForm> <VForm>
@@ -254,8 +255,10 @@ onMounted(() => {
<VSelect <VSelect
v-model="selectedTorrentPriority" v-model="selectedTorrentPriority"
:items="TorrentPriorityItems" :items="TorrentPriorityItems"
multiple
chips
label="当前使用下载优先规则" label="当前使用下载优先规则"
hint="同时命中多个站点的多个资源时下载的优先规则" hint="排在前面的优先级越高,未选择的项不纳入排序"
persistent-hint persistent-hint
/> />
</VCol> </VCol>
+5 -1
View File
@@ -14,6 +14,8 @@ const resetSitesText = ref('重置站点数据')
// 站点重置按钮可用状态 // 站点重置按钮可用状态
const resetSitesDisabled = ref(false) const resetSitesDisabled = ref(false)
const isPasswordVisible = ref(false)
// CookieCloud设置项 // CookieCloud设置项
const siteSetting = ref({ const siteSetting = ref({
COOKIECLOUD_HOST: '', COOKIECLOUD_HOST: '',
@@ -155,7 +157,9 @@ onMounted(() => {
<VCol cols="12" md="6"> <VCol cols="12" md="6">
<VTextField <VTextField
v-model="siteSetting.COOKIECLOUD_PASSWORD" v-model="siteSetting.COOKIECLOUD_PASSWORD"
type="password" :type="isPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isPasswordVisible ? 'mdi-eye-off-outline' : 'mdi-eye-outline'"
@click:append-inner="isPasswordVisible = !isPasswordVisible"
label="端对端加密密码" label="端对端加密密码"
hint="CookieCloud浏览器插件生成的端对端加密密码" hint="CookieCloud浏览器插件生成的端对端加密密码"
persistent-hint persistent-hint