mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-11 18:10:49 +08:00
fix
This commit is contained in:
@@ -158,16 +158,16 @@ onMounted(() => {
|
||||
/>
|
||||
<VerticalNavLink
|
||||
:item="{
|
||||
title: '站点管理',
|
||||
icon: 'mdi-web',
|
||||
to: '/site',
|
||||
title: '插件',
|
||||
icon: 'mdi-apps',
|
||||
to: '/plugin',
|
||||
}"
|
||||
/>
|
||||
<VerticalNavLink
|
||||
:item="{
|
||||
title: '插件',
|
||||
icon: 'mdi-apps',
|
||||
to: '/plugin',
|
||||
title: '站点管理',
|
||||
icon: 'mdi-web',
|
||||
to: '/site',
|
||||
}"
|
||||
/>
|
||||
<VerticalNavLink
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import AccountSettingAccount from "@/views/account-setting/AccountSettingAccount.vue";
|
||||
import AccountSettingFilter from "@/views/account-setting/AccountSettingFilter.vue";
|
||||
import AccountSettingNotification from "@/views/account-setting/AccountSettingNotification.vue";
|
||||
import AccountSettingSystem from "@/views/account-setting/AccountSettingSystem.vue";
|
||||
import AccountSettingRule from "@/views/account-setting/AccountSettingRule.vue";
|
||||
import AccountSettingSite from "@/views/account-setting/AccountSettingSite.vue";
|
||||
import AccountSettingWords from "@/views/account-setting/AccountSettingWords.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
@@ -13,7 +13,7 @@ const activeTab = ref(route.params.tab);
|
||||
// tabs
|
||||
const tabs = [
|
||||
{ title: "用户", icon: "mdi-account", tab: "account" },
|
||||
{ title: "站点", icon: "mdi-sitemap", tab: "system" },
|
||||
{ title: "站点", icon: "mdi-web", tab: "site" },
|
||||
{ title: "规则", icon: "mdi-filter-cog", tab: "filter" },
|
||||
{ title: "通知", icon: "mdi-bell", tab: "notification" },
|
||||
{ title: "自定义词表", icon: "mdi-file-word-box", tab: "words" },
|
||||
@@ -37,13 +37,13 @@ const tabs = [
|
||||
</VWindowItem>
|
||||
|
||||
<!-- System -->
|
||||
<VWindowItem value="system">
|
||||
<AccountSettingSystem />
|
||||
<VWindowItem value="site">
|
||||
<AccountSettingSite />
|
||||
</VWindowItem>
|
||||
|
||||
<!-- Notification -->
|
||||
<VWindowItem value="filter">
|
||||
<AccountSettingFilter />
|
||||
<AccountSettingRule />
|
||||
</VWindowItem>
|
||||
|
||||
<!-- Notification -->
|
||||
|
||||
@@ -16,6 +16,15 @@ interface FilterCard {
|
||||
// 提示框
|
||||
const $toast = useToast();
|
||||
|
||||
// 种子优先规则
|
||||
const selectedTorrentPriority = ref<string>("seeder");
|
||||
|
||||
// 种子优先规则下拉框
|
||||
const TorrentPriorityItems = [
|
||||
{ title: "站点优先", value: "site" },
|
||||
{ title: "做种数优先", value: "seeder" },
|
||||
];
|
||||
|
||||
// 查询已设置过滤规则
|
||||
const queryCustomFilters = async () => {
|
||||
try {
|
||||
@@ -37,6 +46,18 @@ const queryCustomFilters = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 查询种子优先规则
|
||||
const queryTorrentPriority = async () => {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get(
|
||||
"system/setting/TorrentsPriority"
|
||||
);
|
||||
selectedTorrentPriority.value = result.data?.value;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 保存用户设置的识别词
|
||||
const saveCustomFilters = async () => {
|
||||
try {
|
||||
@@ -64,6 +85,24 @@ const saveCustomFilters = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 保存种子优先规则
|
||||
const saveTorrentPriority = async () => {
|
||||
try {
|
||||
// 用户名密码
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
"system/setting/TorrentsPriority",
|
||||
selectedTorrentPriority.value
|
||||
);
|
||||
if (result.success) {
|
||||
$toast.success("优先规则保存成功");
|
||||
} else {
|
||||
$toast.error("优先规则保存失败!");
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 规则卡片列表
|
||||
const filterCards = ref<FilterCard[]>([]);
|
||||
|
||||
@@ -78,10 +117,20 @@ const updateFilterCardValue = (pri: string, rules: string[]) => {
|
||||
// 移除卡片
|
||||
const filterCardClose = (pri: string) => {
|
||||
// 将卡片从列表中删除,并更新剩余卡片的序号
|
||||
filterCards.value = filterCards.value.filter((card) => card.pri !== pri);
|
||||
filterCards.value.forEach((card, index) => {
|
||||
card.pri = (index + 1).toString();
|
||||
});
|
||||
const index = filterCards.value.findIndex((card) => card.pri === pri);
|
||||
if (index !== -1) {
|
||||
// 创建新的数组,然后使用 splice 方法来删除元素
|
||||
const updatedCards = [...filterCards.value];
|
||||
updatedCards.splice(index, 1);
|
||||
|
||||
// 更新剩余卡片的序号
|
||||
updatedCards.forEach((card, i) => {
|
||||
card.pri = (i + 1).toString();
|
||||
});
|
||||
|
||||
// 更新 filterCards.value
|
||||
filterCards.value = updatedCards;
|
||||
}
|
||||
};
|
||||
|
||||
// 增加卡片
|
||||
@@ -95,6 +144,7 @@ const addFilterCard = () => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
queryTorrentPriority();
|
||||
queryCustomFilters();
|
||||
});
|
||||
</script>
|
||||
@@ -126,6 +176,21 @@ onMounted(() => {
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="下载优先规则">
|
||||
<VCardText>
|
||||
<VSelect
|
||||
v-model="selectedTorrentPriority"
|
||||
:items="TorrentPriorityItems"
|
||||
label="优先规则"
|
||||
outlined
|
||||
></VSelect>
|
||||
</VCardText>
|
||||
<VCardItem>
|
||||
<VBtn type="submit" @click="saveTorrentPriority"> 保存 </VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
<style type="scss">
|
||||
@@ -21,15 +21,6 @@ const resetSitesText = ref("重置站点数据");
|
||||
// 站点重置按钮可用状态
|
||||
const resetSitesDisabled = ref(false);
|
||||
|
||||
// 种子优先规则下拉框
|
||||
const TorrentPriorityItems = [
|
||||
{ title: "站点优先", value: "site" },
|
||||
{ title: "做种数优先", value: "seeder" },
|
||||
];
|
||||
|
||||
// 种子优先规则
|
||||
const selectedTorrentPriority = ref<string>("seeder");
|
||||
|
||||
// 查询所有站点
|
||||
const querySites = async () => {
|
||||
try {
|
||||
@@ -52,18 +43,6 @@ const querySelectedSites = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 查询种子优先规则
|
||||
const queryTorrentPriority = async () => {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get(
|
||||
"system/setting/TorrentsPriority"
|
||||
);
|
||||
selectedTorrentPriority.value = result.data?.value;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 保存用户选中的站点
|
||||
const saveSelectedSites = async () => {
|
||||
try {
|
||||
@@ -82,24 +61,6 @@ const saveSelectedSites = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 保存种子优先规则
|
||||
const saveTorrentPriority = async () => {
|
||||
try {
|
||||
// 用户名密码
|
||||
const result: { [key: string]: any } = await api.post(
|
||||
"system/setting/TorrentsPriority",
|
||||
selectedTorrentPriority.value
|
||||
);
|
||||
if (result.success) {
|
||||
$toast.success("优先规则保存成功");
|
||||
} else {
|
||||
$toast.error("优先规则保存失败!");
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 重置站点
|
||||
const resetSites = async () => {
|
||||
try {
|
||||
@@ -109,7 +70,6 @@ const resetSites = async () => {
|
||||
if (result.success) {
|
||||
$toast.success("站点重置成功,请等待CookieCloud同步完成!");
|
||||
querySites();
|
||||
queryTorrentPriority();
|
||||
} else {
|
||||
$toast.error("站点重置失败!");
|
||||
}
|
||||
@@ -122,7 +82,6 @@ const resetSites = async () => {
|
||||
|
||||
onMounted(() => {
|
||||
querySites();
|
||||
queryTorrentPriority();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -151,21 +110,6 @@ onMounted(() => {
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="优先规则">
|
||||
<VCardText>
|
||||
<VSelect
|
||||
v-model="selectedTorrentPriority"
|
||||
:items="TorrentPriorityItems"
|
||||
label="下载优先规则"
|
||||
outlined
|
||||
></VSelect>
|
||||
</VCardText>
|
||||
<VCardItem>
|
||||
<VBtn type="submit" @click="saveTorrentPriority"> 保存 </VBtn>
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="站点重置">
|
||||
<VCardText>
|
||||
Reference in New Issue
Block a user