From 5566ef87f8a8ba8ad937d2bd1575a9e30ec33f57 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 30 Nov 2023 16:57:01 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=8F=92=E4=BB=B6=E8=B7=B3=E8=BD=ACGith?= =?UTF-8?q?ub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/cards/PluginAppCard.vue | 64 +++++++++++++++++++++++++- src/components/cards/PluginCard.vue | 32 +++++++++---- 3 files changed, 87 insertions(+), 11 deletions(-) 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, + }, + }, +])