feat: 优化插件弹窗加载速度

This commit is contained in:
jxxghp
2025-02-27 12:44:39 +08:00
parent 3d64382c9b
commit 5cd021ea85
6 changed files with 222 additions and 220 deletions

View File

@@ -1,59 +1,24 @@
<script lang="ts" setup>
import api from '@/api'
import useDragAndDrop from '@core/utils/workflow'
const { onDragStart } = useDragAndDrop()
// 组件列表
const actions = [
{
type: 'AddDownloadAction',
label: '添加下载资源',
},
{
type: 'AddSubscribeAction',
label: '添加订阅',
},
{
type: 'FetchDownloadsAction',
label: '获取下载任务',
},
{
type: 'FetchMediasAction',
label: '获取媒体数据',
},
{
type: 'FetchRssAction',
label: '获取RSS数据',
},
{
type: 'FetchTorrentsAction',
label: '搜索站点资源',
},
{
type: 'FilterMediasAction',
label: '过滤媒体数据',
},
{
type: 'FilterTorrentsAction',
label: '过滤资源数据',
},
{
type: 'ScrapeFileAction',
label: '刮削文件',
},
{
type: 'SendEventAction',
label: '发送事件',
},
{
type: 'SendMessageAction',
label: '发送消息',
},
{
type: 'TransferFileAction',
label: '整理文件',
},
]
const actions = ref([])
// 加载组件列表
async function load_actions() {
try {
actions.value = await api.get('workflow/actions')
} catch (error) {
console.error(error)
}
}
onMounted(() => {
load_actions()
})
</script>
<template>
@@ -67,7 +32,7 @@ const actions = [
:draggable="true"
@dragstart="onDragStart($event, action)"
>
{{ action['label'] }}
{{ action['name'] }}
</div>
</div>
</aside>