mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 08:46:40 +08:00
fix: 优化插件卡片项目主页与版本历史入口
This commit is contained in:
@@ -129,7 +129,7 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('plugin.updateHistory'),
|
title: t('plugin.versionHistory'),
|
||||||
value: 2,
|
value: 2,
|
||||||
show: !isNullOrEmptyObject(props.plugin?.history || {}),
|
show: !isNullOrEmptyObject(props.plugin?.history || {}),
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -258,9 +258,44 @@ async function updatePlugin() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 访问作者主页
|
// 访问插件项目主页
|
||||||
function visitAuthorPage() {
|
async function visitPluginPage() {
|
||||||
window.open(props.plugin?.author_url, '_blank')
|
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),
|
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'),
|
title: t('plugin.reset'),
|
||||||
value: 4,
|
value: 4,
|
||||||
@@ -403,6 +429,15 @@ const dropdownItems = ref([
|
|||||||
click: uninstallPlugin,
|
click: uninstallPlugin,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t('plugin.versionHistory'),
|
||||||
|
value: 9,
|
||||||
|
show: !props.plugin?.has_update,
|
||||||
|
props: {
|
||||||
|
prependIcon: 'mdi-update',
|
||||||
|
click: () => showUpdateHistory(false),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('plugin.viewLogs'),
|
title: t('plugin.viewLogs'),
|
||||||
value: 6,
|
value: 6,
|
||||||
@@ -415,12 +450,12 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('plugin.authorHome'),
|
title: t('plugin.projectHome'),
|
||||||
value: 7,
|
value: 7,
|
||||||
show: true,
|
show: true,
|
||||||
props: {
|
props: {
|
||||||
prependIcon: 'mdi-home-circle-outline',
|
prependIcon: 'mdi-github',
|
||||||
click: visitAuthorPage,
|
click: visitPluginPage,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2901,6 +2901,7 @@ export default {
|
|||||||
settings: 'Settings',
|
settings: 'Settings',
|
||||||
projectHome: 'Project Home',
|
projectHome: 'Project Home',
|
||||||
updateHistory: 'Update History',
|
updateHistory: 'Update History',
|
||||||
|
versionHistory: 'Version History',
|
||||||
local: 'Local',
|
local: 'Local',
|
||||||
systemVersion: 'System Version',
|
systemVersion: 'System Version',
|
||||||
incompatibleSystemVersion: 'The current MoviePilot version does not meet this plugin requirement.',
|
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?',
|
'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',
|
resetSuccess: 'Plugin {name} data has been reset',
|
||||||
resetFailed: 'Plugin {name} reset failed: {message}',
|
resetFailed: 'Plugin {name} reset failed: {message}',
|
||||||
updateHistoryTitle: '{name} Update History',
|
updateHistoryTitle: '{name} Version History',
|
||||||
updateHistoryEmpty: 'No update history available yet',
|
updateHistoryEmpty: 'No update history available yet',
|
||||||
updateHistoryLoadFailed: 'Failed to load update history. Please try again later.',
|
updateHistoryLoadFailed: 'Failed to load update history. Please try again later.',
|
||||||
updateToLatest: 'Update to Latest Version',
|
updateToLatest: 'Update to Latest Version',
|
||||||
|
|||||||
@@ -2854,6 +2854,7 @@ export default {
|
|||||||
settings: '设置',
|
settings: '设置',
|
||||||
projectHome: '项目主页',
|
projectHome: '项目主页',
|
||||||
updateHistory: '更新说明',
|
updateHistory: '更新说明',
|
||||||
|
versionHistory: '版本历史',
|
||||||
local: '本地',
|
local: '本地',
|
||||||
systemVersion: '系统版本',
|
systemVersion: '系统版本',
|
||||||
incompatibleSystemVersion: '当前 MoviePilot 版本不满足插件要求,无法安装',
|
incompatibleSystemVersion: '当前 MoviePilot 版本不满足插件要求,无法安装',
|
||||||
@@ -2869,7 +2870,7 @@ export default {
|
|||||||
confirmReset: '此操作将恢复插件 {name} 的默认设置,并清除所有相关数据,确定要继续吗?',
|
confirmReset: '此操作将恢复插件 {name} 的默认设置,并清除所有相关数据,确定要继续吗?',
|
||||||
resetSuccess: '插件 {name} 数据已重置',
|
resetSuccess: '插件 {name} 数据已重置',
|
||||||
resetFailed: '插件 {name} 重置失败:{message}',
|
resetFailed: '插件 {name} 重置失败:{message}',
|
||||||
updateHistoryTitle: '{name} 更新说明',
|
updateHistoryTitle: '{name} 版本历史',
|
||||||
updateHistoryEmpty: '暂未获取到更新说明',
|
updateHistoryEmpty: '暂未获取到更新说明',
|
||||||
updateHistoryLoadFailed: '读取更新说明失败,请稍后重试',
|
updateHistoryLoadFailed: '读取更新说明失败,请稍后重试',
|
||||||
updateToLatest: '更新到最新版本',
|
updateToLatest: '更新到最新版本',
|
||||||
|
|||||||
@@ -2855,6 +2855,7 @@ export default {
|
|||||||
settings: '設置',
|
settings: '設置',
|
||||||
projectHome: '項目主頁',
|
projectHome: '項目主頁',
|
||||||
updateHistory: '更新說明',
|
updateHistory: '更新說明',
|
||||||
|
versionHistory: '版本歷史',
|
||||||
local: '本地',
|
local: '本地',
|
||||||
installToLocal: '安裝到本地',
|
installToLocal: '安裝到本地',
|
||||||
totalDownloads: '共 {count} 次下載',
|
totalDownloads: '共 {count} 次下載',
|
||||||
@@ -2868,7 +2869,7 @@ export default {
|
|||||||
confirmReset: '此操作將恢復插件 {name} 的默認設置,並清除所有相關數據,確定要繼續嗎?',
|
confirmReset: '此操作將恢復插件 {name} 的默認設置,並清除所有相關數據,確定要繼續嗎?',
|
||||||
resetSuccess: '插件 {name} 數據已重置',
|
resetSuccess: '插件 {name} 數據已重置',
|
||||||
resetFailed: '插件 {name} 重置失敗:{message}',
|
resetFailed: '插件 {name} 重置失敗:{message}',
|
||||||
updateHistoryTitle: '{name} 更新說明',
|
updateHistoryTitle: '{name} 版本歷史',
|
||||||
updateHistoryEmpty: '暫未獲取到更新說明',
|
updateHistoryEmpty: '暫未獲取到更新說明',
|
||||||
updateHistoryLoadFailed: '讀取更新說明失敗,請稍後重試',
|
updateHistoryLoadFailed: '讀取更新說明失敗,請稍後重試',
|
||||||
updateToLatest: '更新到最新版本',
|
updateToLatest: '更新到最新版本',
|
||||||
|
|||||||
Reference in New Issue
Block a user