This commit is contained in:
jxxghp
2023-08-19 14:56:34 +08:00
9 changed files with 47 additions and 14 deletions

View File

@@ -40,8 +40,8 @@ function getTextClass() {
async function toggleDownload() {
const operation = isDownloading.value ? 'stop' : 'start'
try {
const result: { [key: string]: any } = await api.put(
`download/${props.info?.hash}/${operation}`,
const result: { [key: string]: any } = await api.get(
`download/${operation}/${props.info?.hash}`,
)
if (result.success)
@@ -109,9 +109,10 @@ async function deleteDownload() {
</VCardText>
<VCardActions class="justify-space-between">
<VBtn @click="toggleDownload">
<span class="ms-2">{{ isDownloading ? "暂停" : "开始" }}</span>
</VBtn>
<VBtn
:icon="`${isDownloading ? 'mdi-pause' : 'mdi-play'}`"
@click="toggleDownload"
/>
<VBtn
color="error"
icon="mdi-trash-can-outline"

View File

@@ -51,6 +51,11 @@ const siteName = ref('')
// 订阅编辑表单
const rssForm = reactive<any>(props.media ?? {})
// 类型转换
rssForm.best_version = rssForm.best_version === 1
rssForm.proxy = rssForm.proxy === 1
rssForm.filter = rssForm.filter === 1
// 上一次更新时间
const lastUpdateText = ref(
`${

View File

@@ -73,7 +73,7 @@ const resourceTotalItems = ref(0)
const resourceItemsPerPage = ref(25)
// 当前页码
const resourceCurrentPage = ref(1)
const resourceCurrentPage = ref(0)
// 用户名密码表单
const userPwForm = ref({
@@ -90,6 +90,10 @@ const statusItems = [
// 站点编辑表单数据
const siteForm = reactive<any>(cardProps.site ?? {})
// 类型转换
siteForm.proxy = siteForm.proxy === 1
siteForm.render = siteForm.render === 1
// 打开种子详情页面
function openTorrentDetail(page_url: string) {
window.open(page_url, '_blank')
@@ -216,6 +220,18 @@ async function updateSiteInfo() {
}
}
// 促销Chip类
function getVolumeFactorClass(downloadVolume: number, uploadVolume: number) {
if (downloadVolume === 0)
return 'text-white bg-lime-500'
else if (downloadVolume < 1)
return 'text-white bg-green-500'
else if (uploadVolume !== 1)
return 'text-white bg-sky-500'
else
return 'text-white bg-gray-500'
}
// 调用API查询站点资源
async function getResourceList() {
resourceLoading.value = true
@@ -576,6 +592,17 @@ onMounted(() => {
>
{{ label }}
</VChip>
<VChip
v-if="item.raw?.downloadvolumefactor !== 1 || item.raw?.uploadvolumefactor !== 1"
:class="
getVolumeFactorClass(item.raw?.downloadvolumefactor, item.raw?.uploadvolumefactor)
"
variant="elevated"
size="small"
class="me-1 mb-1"
>
{{ item.raw?.volume_factor }}
</VChip>
</template>
<template #item.pubdate="{ item }">
<div>{{ item.raw.date_elapsed }}</div>

View File

@@ -32,6 +32,9 @@ const selectSitesOptions = ref<{ [key: number]: string }[]>([])
// 订阅编辑表单
const subscribeForm = reactive<any>(props.media ?? {})
// 类型转换
subscribeForm.best_version = subscribeForm.best_version === 1
// 上一次更新时间
const lastUpdateText = ref(
`${