mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
fix
This commit is contained in:
@@ -7,7 +7,7 @@ import type { Site } from '@/api/types'
|
|||||||
import ExistIcon from '@core/components/ExistIcon.vue'
|
import ExistIcon from '@core/components/ExistIcon.vue'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const cardProps = defineProps({
|
||||||
site: Object as PropType<Site>,
|
site: Object as PropType<Site>,
|
||||||
width: String,
|
width: String,
|
||||||
height: String,
|
height: String,
|
||||||
@@ -49,7 +49,7 @@ const userPwForm = ref({
|
|||||||
// 查询站点图标
|
// 查询站点图标
|
||||||
async function getSiteIcon() {
|
async function getSiteIcon() {
|
||||||
try {
|
try {
|
||||||
siteIcon.value = (await api.get(`site/icon/${props.site?.id}`)).data.icon
|
siteIcon.value = (await api.get(`site/icon/${cardProps.site?.id}`)).data.icon
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
@@ -62,11 +62,11 @@ async function testSite() {
|
|||||||
testButtonText.value = '测试中 ...'
|
testButtonText.value = '测试中 ...'
|
||||||
testButtonDisable.value = true
|
testButtonDisable.value = true
|
||||||
|
|
||||||
const result: { [key: string]: any } = await api.get(`site/test/${props.site?.id}`)
|
const result: { [key: string]: any } = await api.get(`site/test/${cardProps.site?.id}`)
|
||||||
if (result.success)
|
if (result.success)
|
||||||
$toast.success(`${props.site?.name} 连通性测试成功,可正常使用!`)
|
$toast.success(`${cardProps.site?.name} 连通性测试成功,可正常使用!`)
|
||||||
else
|
else
|
||||||
$toast.error(`${props.site?.name} 连通性测试失败:${result.message}`)
|
$toast.error(`${cardProps.site?.name} 连通性测试失败:${result.message}`)
|
||||||
|
|
||||||
testButtonText.value = '测试'
|
testButtonText.value = '测试'
|
||||||
testButtonDisable.value = false
|
testButtonDisable.value = false
|
||||||
@@ -98,7 +98,7 @@ async function updateSiteCookie() {
|
|||||||
updateButtonDisable.value = true
|
updateButtonDisable.value = true
|
||||||
|
|
||||||
const result: { [key: string]: any } = await api.get(
|
const result: { [key: string]: any } = await api.get(
|
||||||
`site/cookie/${props.site?.id}`,
|
`site/cookie/${cardProps.site?.id}`,
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
username: userPwForm.value.username,
|
username: userPwForm.value.username,
|
||||||
@@ -108,9 +108,9 @@ async function updateSiteCookie() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (result.success)
|
if (result.success)
|
||||||
$toast.success(`${props.site?.name} 更新Cookie & UA 成功!`)
|
$toast.success(`${cardProps.site?.name} 更新Cookie & UA 成功!`)
|
||||||
else
|
else
|
||||||
$toast.error(`${props.site?.name} 更新失败:${result.message}`)
|
$toast.error(`${cardProps.site?.name} 更新失败:${result.message}`)
|
||||||
|
|
||||||
updateButtonText.value = '更新'
|
updateButtonText.value = '更新'
|
||||||
updateButtonDisable.value = false
|
updateButtonDisable.value = false
|
||||||
@@ -123,55 +123,55 @@ async function updateSiteCookie() {
|
|||||||
// 站点编辑表单数据
|
// 站点编辑表单数据
|
||||||
const siteForm = reactive({
|
const siteForm = reactive({
|
||||||
// ID
|
// ID
|
||||||
id: props.site?.id,
|
id: cardProps.site?.id,
|
||||||
|
|
||||||
// 站点名称
|
// 站点名称
|
||||||
name: props.site?.name,
|
name: cardProps.site?.name,
|
||||||
|
|
||||||
// 站点主域名Key
|
// 站点主域名Key
|
||||||
domain: props.site?.domain,
|
domain: cardProps.site?.domain,
|
||||||
|
|
||||||
// 站点地址
|
// 站点地址
|
||||||
url: props.site?.url,
|
url: cardProps.site?.url,
|
||||||
|
|
||||||
// 站点优先级
|
// 站点优先级
|
||||||
pri: props.site?.pri,
|
pri: cardProps.site?.pri,
|
||||||
|
|
||||||
// RSS地址
|
// RSS地址
|
||||||
rss: props.site?.rss,
|
rss: cardProps.site?.rss,
|
||||||
|
|
||||||
// Cookie
|
// Cookie
|
||||||
cookie: props.site?.cookie,
|
cookie: cardProps.site?.cookie,
|
||||||
|
|
||||||
// User-Agent
|
// User-Agent
|
||||||
ua: props.site?.ua,
|
ua: cardProps.site?.ua,
|
||||||
|
|
||||||
// 是否使用代理
|
// 是否使用代理
|
||||||
proxy: !!props.site?.proxy,
|
proxy: !!cardProps.site?.proxy,
|
||||||
|
|
||||||
// 过滤规则
|
// 过滤规则
|
||||||
filter: props.site?.filter,
|
filter: cardProps.site?.filter,
|
||||||
|
|
||||||
// 是否演染
|
// 是否演染
|
||||||
render: !!props.site?.render,
|
render: !!cardProps.site?.render,
|
||||||
|
|
||||||
// 是否公开站点
|
// 是否公开站点
|
||||||
public: props.site?.public,
|
public: cardProps.site?.public,
|
||||||
|
|
||||||
// 备注
|
// 备注
|
||||||
note: props.site?.note,
|
note: cardProps.site?.note,
|
||||||
|
|
||||||
// 流控单位周期
|
// 流控单位周期
|
||||||
limit_interval: props.site?.limit_interval,
|
limit_interval: cardProps.site?.limit_interval,
|
||||||
|
|
||||||
// 流控次数
|
// 流控次数
|
||||||
limit_count: props.site?.limit_count,
|
limit_count: cardProps.site?.limit_count,
|
||||||
|
|
||||||
// 流控间隔
|
// 流控间隔
|
||||||
limit_seconds: props.site?.limit_seconds,
|
limit_seconds: cardProps.site?.limit_seconds,
|
||||||
|
|
||||||
// 是否启用
|
// 是否启用
|
||||||
is_active: props.site?.is_active,
|
is_active: cardProps.site?.is_active,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 调用API更新站点信息
|
// 调用API更新站点信息
|
||||||
@@ -182,12 +182,12 @@ async function updateSiteInfo() {
|
|||||||
|
|
||||||
const result: { [key: string]: any } = await api.put('site', siteForm)
|
const result: { [key: string]: any } = await api.put('site', siteForm)
|
||||||
if (result.success)
|
if (result.success)
|
||||||
$toast.success(`${props.site?.name} 更新成功!`)
|
$toast.success(`${cardProps.site?.name} 更新成功!`)
|
||||||
else
|
else
|
||||||
$toast.error(`${props.site?.name} 更新失败:${result.message}`)
|
$toast.error(`${cardProps.site?.name} 更新失败:${result.message}`)
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
$toast.error(`${props.site?.name} 更新失败!`)
|
$toast.error(`${cardProps.site?.name} 更新失败!`)
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,8 +206,8 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VCard
|
<VCard
|
||||||
:height="props.height"
|
:height="cardProps.height"
|
||||||
:width="props.width"
|
:width="cardProps.width"
|
||||||
:flat="!siteForm.is_active"
|
:flat="!siteForm.is_active"
|
||||||
class="overflow-hidden"
|
class="overflow-hidden"
|
||||||
@click="siteInfoDialog = true"
|
@click="siteInfoDialog = true"
|
||||||
@@ -223,9 +223,9 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
<VCardItem>
|
<VCardItem>
|
||||||
<VCardTitle class="font-bold">
|
<VCardTitle class="font-bold">
|
||||||
{{ props.site?.name }}
|
{{ cardProps.site?.name }}
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
<VCardSubtitle>{{ props.site?.url }}</VCardSubtitle>
|
<VCardSubtitle>{{ cardProps.site?.url }}</VCardSubtitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
|
|
||||||
<ExistIcon v-if="siteForm.is_active" />
|
<ExistIcon v-if="siteForm.is_active" />
|
||||||
@@ -290,7 +290,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VBtn
|
<VBtn
|
||||||
v-if="!props.site?.public"
|
v-if="!cardProps.site?.public"
|
||||||
:disabled="updateButtonDisable"
|
:disabled="updateButtonDisable"
|
||||||
@click.stop="handleSiteUpdate"
|
@click.stop="handleSiteUpdate"
|
||||||
>
|
>
|
||||||
@@ -372,8 +372,8 @@ onMounted(() => {
|
|||||||
scrollable
|
scrollable
|
||||||
>
|
>
|
||||||
<!-- Dialog Content -->
|
<!-- Dialog Content -->
|
||||||
<VCard :title="`编辑站点 - ${props.site?.name}`">
|
<VCard :title="`编辑站点 - ${cardProps.site?.name}`">
|
||||||
<VCardText>
|
<VCardText class="pt-2">
|
||||||
<VForm @submit.prevent="() => {}">
|
<VForm @submit.prevent="() => {}">
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol
|
<VCol
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ const dropdownItems = ref([
|
|||||||
>
|
>
|
||||||
<!-- Dialog Content -->
|
<!-- Dialog Content -->
|
||||||
<VCard :title="`订阅 - ${props.media?.name}`">
|
<VCard :title="`订阅 - ${props.media?.name}`">
|
||||||
<VCardText>
|
<VCardText class="pt-2">
|
||||||
<VForm @submit.prevent="() => {}">
|
<VForm @submit.prevent="() => {}">
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol
|
<VCol
|
||||||
|
|||||||
Reference in New Issue
Block a user