diff --git a/src/components/cards/PluginCard.vue b/src/components/cards/PluginCard.vue
index 0ae3ba6f..ff4341ed 100644
--- a/src/components/cards/PluginCard.vue
+++ b/src/components/cards/PluginCard.vue
@@ -3,7 +3,6 @@ import { useToast } from 'vue-toastification'
import { useConfirm } from '@/composables/useConfirm'
import api from '@/api'
import type { Plugin } from '@/api/types'
-import { isNullOrEmptyObject } from '@core/utils'
import { getLogoUrl } from '@/utils/imageUtils'
import { getDominantColor } from '@/@core/utils/image'
import { formatDownloadCount } from '@/@core/utils/formatters'
@@ -104,17 +103,12 @@ async function imageLoaded() {
// 显示更新日志
function showUpdateHistory() {
- // 检查当前版本是否有更新日志
- if (isNullOrEmptyObject(props.plugin?.history)) {
- updatePlugin()
- } else {
- openSharedDialog(
- PluginVersionHistoryDialog,
- { plugin: props.plugin, showUpdateAction: true },
- { update: updatePlugin },
- { closeOn: ['close', 'update', 'update:modelValue'] },
- )
- }
+ openSharedDialog(
+ PluginVersionHistoryDialog,
+ { plugin: props.plugin, showUpdateAction: true },
+ { update: updatePlugin },
+ { closeOn: ['close', 'update', 'update:modelValue'] },
+ )
}
// 调用API卸载插件
@@ -377,6 +371,15 @@ const dropdownItems = ref([
props: {
prependIcon: 'mdi-arrow-up-circle-outline',
color: 'success',
+ click: updatePlugin,
+ },
+ },
+ {
+ title: t('plugin.updateHistory'),
+ value: 9,
+ show: !props.plugin?.has_update,
+ props: {
+ prependIcon: 'mdi-update',
click: showUpdateHistory,
},
},
@@ -428,6 +431,9 @@ watch(
(newHasUpdate, _) => {
const updateItemIndex = dropdownItems.value.findIndex(item => item.value === 3)
if (updateItemIndex !== -1) dropdownItems.value[updateItemIndex].show = newHasUpdate
+
+ const updateHistoryItemIndex = dropdownItems.value.findIndex(item => item.value === 9)
+ if (updateHistoryItemIndex !== -1) dropdownItems.value[updateHistoryItemIndex].show = !newHasUpdate
},
)
diff --git a/src/components/dialog/PluginVersionHistoryDialog.vue b/src/components/dialog/PluginVersionHistoryDialog.vue
index a4742882..e9aac3a7 100644
--- a/src/components/dialog/PluginVersionHistoryDialog.vue
+++ b/src/components/dialog/PluginVersionHistoryDialog.vue
@@ -1,4 +1,5 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -68,3 +121,12 @@ function handleUpdate() {
+
+
diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts
index 4dd083de..108bdb0e 100644
--- a/src/locales/en-US.ts
+++ b/src/locales/en-US.ts
@@ -2918,6 +2918,8 @@ export default {
resetSuccess: 'Plugin {name} data has been reset',
resetFailed: 'Plugin {name} reset failed: {message}',
updateHistoryTitle: '{name} Update History',
+ updateHistoryEmpty: 'No update history available yet',
+ updateHistoryLoadFailed: 'Failed to load update history. Please try again later.',
updateToLatest: 'Update to Latest Version',
updatingTo: 'Updating {name} to v{version} ...',
folderNameEmpty: 'Folder name cannot be empty',
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index e0d5516a..c488cf02 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -2870,6 +2870,8 @@ export default {
resetSuccess: '插件 {name} 数据已重置',
resetFailed: '插件 {name} 重置失败:{message}',
updateHistoryTitle: '{name} 更新说明',
+ updateHistoryEmpty: '暂未获取到更新说明',
+ updateHistoryLoadFailed: '读取更新说明失败,请稍后重试',
updateToLatest: '更新到最新版本',
updatingTo: '更新 {name} 到 {version} 版本...',
folderNameEmpty: '文件夹名称不能为空',
diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts
index 86faf426..414a43f4 100644
--- a/src/locales/zh-TW.ts
+++ b/src/locales/zh-TW.ts
@@ -2869,6 +2869,8 @@ export default {
resetSuccess: '插件 {name} 數據已重置',
resetFailed: '插件 {name} 重置失敗:{message}',
updateHistoryTitle: '{name} 更新說明',
+ updateHistoryEmpty: '暫未獲取到更新說明',
+ updateHistoryLoadFailed: '讀取更新說明失敗,請稍後重試',
updateToLatest: '更新到最新版本',
updatingTo: '正在更新 {name} 至 v{version} ...',
folderNameEmpty: '文件夾名稱不能為空',