mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
feat 优化插件界面交互
This commit is contained in:
@@ -526,6 +526,9 @@ export interface Plugin {
|
|||||||
|
|
||||||
// 运行状态
|
// 运行状态
|
||||||
state?: boolean
|
state?: boolean
|
||||||
|
|
||||||
|
// 是否有详情页面
|
||||||
|
has_page?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
// 种子信息
|
// 种子信息
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ async function savePluginConf() {
|
|||||||
|
|
||||||
// 显示插件详情
|
// 显示插件详情
|
||||||
async function showPluginInfo() {
|
async function showPluginInfo() {
|
||||||
|
// 加载详情
|
||||||
|
await loadPluginPage()
|
||||||
pluginConfigDialog.value = false
|
pluginConfigDialog.value = false
|
||||||
pluginInfoDialog.value = true
|
pluginInfoDialog.value = true
|
||||||
}
|
}
|
||||||
@@ -129,17 +131,35 @@ async function showPluginConfig() {
|
|||||||
await loadPluginForm()
|
await loadPluginForm()
|
||||||
// 加载配置
|
// 加载配置
|
||||||
await loadPluginConf()
|
await loadPluginConf()
|
||||||
// 加载详情
|
|
||||||
await loadPluginPage()
|
|
||||||
// 显示对话框
|
// 显示对话框
|
||||||
|
pluginInfoDialog.value = false
|
||||||
pluginConfigDialog.value = true
|
pluginConfigDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹出菜单
|
// 弹出菜单
|
||||||
const dropdownItems = ref([
|
const dropdownItems = ref([
|
||||||
{
|
{
|
||||||
title: '卸载',
|
title: '查看详情',
|
||||||
value: 1,
|
value: 1,
|
||||||
|
show: props.plugin?.has_page,
|
||||||
|
props: {
|
||||||
|
prependIcon: 'mdi-information-outline',
|
||||||
|
click: showPluginInfo,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '插件配置',
|
||||||
|
value: 2,
|
||||||
|
show: true,
|
||||||
|
props: {
|
||||||
|
prependIcon: 'mdi-cog-outline',
|
||||||
|
click: showPluginConfig,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '卸载插件',
|
||||||
|
value: 3,
|
||||||
|
show: true,
|
||||||
props: {
|
props: {
|
||||||
prependIcon: 'mdi-trash-can-outline',
|
prependIcon: 'mdi-trash-can-outline',
|
||||||
color: 'error',
|
color: 'error',
|
||||||
@@ -155,7 +175,12 @@ const dropdownItems = ref([
|
|||||||
v-if="isVisible"
|
v-if="isVisible"
|
||||||
:width="props.width"
|
:width="props.width"
|
||||||
:height="props.height"
|
:height="props.height"
|
||||||
@click="showPluginConfig"
|
@click="() => {
|
||||||
|
if (props.plugin?.has_page)
|
||||||
|
showPluginInfo()
|
||||||
|
else
|
||||||
|
showPluginConfig()
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="relative pa-4 text-center card-cover-blurred"
|
class="relative pa-4 text-center card-cover-blurred"
|
||||||
@@ -171,6 +196,7 @@ const dropdownItems = ref([
|
|||||||
<VList>
|
<VList>
|
||||||
<VListItem
|
<VListItem
|
||||||
v-for="(item, i) in dropdownItems"
|
v-for="(item, i) in dropdownItems"
|
||||||
|
v-show="item.show"
|
||||||
:key="i"
|
:key="i"
|
||||||
variant="plain"
|
variant="plain"
|
||||||
:base-color="item.props.color"
|
:base-color="item.props.color"
|
||||||
@@ -253,6 +279,9 @@ const dropdownItems = ref([
|
|||||||
/>
|
/>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
|
<VBtn @click="showPluginConfig">
|
||||||
|
配置
|
||||||
|
</VBtn>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn @click="pluginInfoDialog = false">
|
<VBtn @click="pluginInfoDialog = false">
|
||||||
关闭
|
关闭
|
||||||
|
|||||||
Reference in New Issue
Block a user