mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-11 18:10:49 +08:00
feat 站点重置
This commit is contained in:
@@ -12,6 +12,15 @@ const selectedSites = ref<number[]>([]);
|
||||
// 所有站点
|
||||
const allSites = ref<Site[]>([]);
|
||||
|
||||
// 站点重置
|
||||
const isConfirmResetSites = ref(false);
|
||||
|
||||
// 站点重置按钮文本
|
||||
const resetSitesText = ref("重置站点数据");
|
||||
|
||||
// 站点重置按钮可用状态
|
||||
const resetSitesDisabled = ref(false);
|
||||
|
||||
// 种子优先规则下拉框
|
||||
const TorrentPriorityItems = [
|
||||
{ title: "站点优先", value: "site" },
|
||||
@@ -91,6 +100,24 @@ const saveTorrentPriority = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 重置站点
|
||||
const resetSites = async () => {
|
||||
try {
|
||||
resetSitesDisabled.value = true;
|
||||
resetSitesText.value = "正在重置...";
|
||||
const result: { [key: string]: any } = await api.get("site/reset");
|
||||
if (result.success) {
|
||||
$toast.success("站点重置成功,请等待CookieCloud同步完成!");
|
||||
} else {
|
||||
$toast.error("站点重置失败!");
|
||||
}
|
||||
resetSitesDisabled.value = false;
|
||||
resetSitesText.value = "重置站点数据";
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
querySites();
|
||||
queryTorrentPriority();
|
||||
@@ -137,5 +164,26 @@ onMounted(() => {
|
||||
</VCardItem>
|
||||
</VCard>
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VCard title="站点重置">
|
||||
<VCardText>
|
||||
<div>
|
||||
<VCheckbox
|
||||
v-model="isConfirmResetSites"
|
||||
label="确认删除所有站点数据并重新同步"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<VBtn
|
||||
:disabled="!isConfirmResetSites && !resetSitesDisabled"
|
||||
color="error"
|
||||
class="mt-3"
|
||||
@click="resetSites"
|
||||
>
|
||||
{{ resetSitesText }}
|
||||
</VBtn>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user