diff --git a/package.json b/package.json index 847fd55b..fe7efb7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "1.4.7-1", + "version": "1.4.8", "private": true, "bin": "dist/service.js", "scripts": { diff --git a/src/components/cards/PluginAppCard.vue b/src/components/cards/PluginAppCard.vue index 5617783d..562d6f28 100644 --- a/src/components/cards/PluginAppCard.vue +++ b/src/components/cards/PluginAppCard.vue @@ -89,6 +89,45 @@ const iconPath: Ref = computed(() => { return `/plugin_icon/${props.plugin?.plugin_icon}` }) + +// 访问插件页面 +function visitPluginPage() { + // 将raw.githubusercontent.com转换为项目地址 + let repoUrl = props.plugin?.repo_url + if (repoUrl) { + if (repoUrl.includes('raw.githubusercontent.com')) { + if (!repoUrl.endsWith('/')) + repoUrl += '/' + + if (repoUrl.split('/').length < 6) + repoUrl = `${repoUrl}main/` + + try { + const [user, repo] = repoUrl.split('/').slice(-4, -2) + repoUrl = `https://github.com/${user}/${repo}` + } + catch (error) { + return + } + } + } + else { + repoUrl = props.plugin?.author_url + } + window.open(repoUrl, '_blank') +} + +// 弹出菜单 +const dropdownItems = ref([ + { + title: '查看详情', + value: 1, + props: { + prependIcon: 'mdi-information-outline', + click: visitPluginPage, + }, + }, +])