From 3b0623628c00b1fa07b9880154c1e50303a401af Mon Sep 17 00:00:00 2001 From: jxxghp Date: Tue, 2 Jun 2026 07:53:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E9=A1=B9=E7=9B=AE=E4=B8=BB=E9=A1=B5=E4=B8=8E?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8E=86=E5=8F=B2=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/PluginAppCard.vue | 2 +- src/components/cards/PluginCard.vue | 65 ++++++++++++++++++++------ src/locales/en-US.ts | 3 +- src/locales/zh-CN.ts | 3 +- src/locales/zh-TW.ts | 3 +- 5 files changed, 57 insertions(+), 19 deletions(-) diff --git a/src/components/cards/PluginAppCard.vue b/src/components/cards/PluginAppCard.vue index 9dab517b..e5b7c160 100644 --- a/src/components/cards/PluginAppCard.vue +++ b/src/components/cards/PluginAppCard.vue @@ -129,7 +129,7 @@ const dropdownItems = ref([ }, }, { - title: t('plugin.updateHistory'), + title: t('plugin.versionHistory'), value: 2, show: !isNullOrEmptyObject(props.plugin?.history || {}), props: { diff --git a/src/components/cards/PluginCard.vue b/src/components/cards/PluginCard.vue index affc1da7..3db73e37 100644 --- a/src/components/cards/PluginCard.vue +++ b/src/components/cards/PluginCard.vue @@ -258,9 +258,44 @@ async function updatePlugin() { } } -// 访问作者主页 -function visitAuthorPage() { - window.open(props.plugin?.author_url, '_blank') +// 访问插件项目主页 +async function visitPluginPage() { + let pluginDetail = props.plugin + + try { + pluginDetail = await api.get(`plugin/history/${props.plugin?.id}`, { + params: { + force: false, + }, + }) + } catch (error) { + console.error(error) + } + + let repoUrl = pluginDetail?.repo_url + if (pluginDetail?.is_local || repoUrl?.startsWith('local://')) { + repoUrl = pluginDetail?.author_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 = pluginDetail?.author_url + } + + if (repoUrl) { + window.open(repoUrl, '_blank') + } } // 打开插件详情 @@ -374,15 +409,6 @@ const dropdownItems = ref([ click: () => showUpdateHistory(true), }, }, - { - title: t('plugin.updateHistory'), - value: 9, - show: !props.plugin?.has_update, - props: { - prependIcon: 'mdi-update', - click: () => showUpdateHistory(false), - }, - }, { title: t('plugin.reset'), value: 4, @@ -403,6 +429,15 @@ const dropdownItems = ref([ click: uninstallPlugin, }, }, + { + title: t('plugin.versionHistory'), + value: 9, + show: !props.plugin?.has_update, + props: { + prependIcon: 'mdi-update', + click: () => showUpdateHistory(false), + }, + }, { title: t('plugin.viewLogs'), value: 6, @@ -415,12 +450,12 @@ const dropdownItems = ref([ }, }, { - title: t('plugin.authorHome'), + title: t('plugin.projectHome'), value: 7, show: true, props: { - prependIcon: 'mdi-home-circle-outline', - click: visitAuthorPage, + prependIcon: 'mdi-github', + click: visitPluginPage, }, }, ]) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 108bdb0e..287cd035 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -2901,6 +2901,7 @@ export default { settings: 'Settings', projectHome: 'Project Home', updateHistory: 'Update History', + versionHistory: 'Version History', local: 'Local', systemVersion: 'System Version', incompatibleSystemVersion: 'The current MoviePilot version does not meet this plugin requirement.', @@ -2917,7 +2918,7 @@ export default { 'This operation will restore plugin {name} to default settings and clear all related data. Are you sure you want to continue?', resetSuccess: 'Plugin {name} data has been reset', resetFailed: 'Plugin {name} reset failed: {message}', - updateHistoryTitle: '{name} Update History', + updateHistoryTitle: '{name} Version History', updateHistoryEmpty: 'No update history available yet', updateHistoryLoadFailed: 'Failed to load update history. Please try again later.', updateToLatest: 'Update to Latest Version', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index c488cf02..d5105f33 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -2854,6 +2854,7 @@ export default { settings: '设置', projectHome: '项目主页', updateHistory: '更新说明', + versionHistory: '版本历史', local: '本地', systemVersion: '系统版本', incompatibleSystemVersion: '当前 MoviePilot 版本不满足插件要求,无法安装', @@ -2869,7 +2870,7 @@ export default { confirmReset: '此操作将恢复插件 {name} 的默认设置,并清除所有相关数据,确定要继续吗?', resetSuccess: '插件 {name} 数据已重置', resetFailed: '插件 {name} 重置失败:{message}', - updateHistoryTitle: '{name} 更新说明', + updateHistoryTitle: '{name} 版本历史', updateHistoryEmpty: '暂未获取到更新说明', updateHistoryLoadFailed: '读取更新说明失败,请稍后重试', updateToLatest: '更新到最新版本', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 414a43f4..8944f63b 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -2855,6 +2855,7 @@ export default { settings: '設置', projectHome: '項目主頁', updateHistory: '更新說明', + versionHistory: '版本歷史', local: '本地', installToLocal: '安裝到本地', totalDownloads: '共 {count} 次下載', @@ -2868,7 +2869,7 @@ export default { confirmReset: '此操作將恢復插件 {name} 的默認設置,並清除所有相關數據,確定要繼續嗎?', resetSuccess: '插件 {name} 數據已重置', resetFailed: '插件 {name} 重置失敗:{message}', - updateHistoryTitle: '{name} 更新說明', + updateHistoryTitle: '{name} 版本歷史', updateHistoryEmpty: '暫未獲取到更新說明', updateHistoryLoadFailed: '讀取更新說明失敗,請稍後重試', updateToLatest: '更新到最新版本',