@@ -244,7 +243,7 @@ onUnmounted(() => {
>
{{ t('plugin.installToLocal') }}
-
+
{{ t('plugin.totalDownloads', { count: formatDownloadCount(props.count) }) }}
@@ -257,3 +256,30 @@ onUnmounted(() => {
+
+
diff --git a/src/components/dialog/PluginVersionHistoryDialog.vue b/src/components/dialog/PluginVersionHistoryDialog.vue
index 437dbeec..900fb0e0 100644
--- a/src/components/dialog/PluginVersionHistoryDialog.vue
+++ b/src/components/dialog/PluginVersionHistoryDialog.vue
@@ -67,6 +67,8 @@ const latestActionText = computed(() => props.actionMode === 'install' ? t('plug
const releaseItems = computed(() => releaseDetail.value?.items || [])
+const shouldShowUpdatePanel = computed(() => props.showUpdateAction)
+
const releaseByHistoryVersion = computed(() => {
const releaseMap = new Map
()
releaseItems.value.forEach(item => {
@@ -90,6 +92,11 @@ function releaseItemByHistoryVersion(version: string) {
return releaseByHistoryVersion.value.get(version)
}
+function shouldShowReleaseButton(item?: PluginReleaseVersion) {
+ if (!item || item.is_current) return false
+ return !(item.is_latest && shouldShowUpdatePanel.value && props.actionMode === 'update')
+}
+
async function loadPluginHistory() {
if (!props.plugin?.id) {
pluginDetail.value = null
@@ -130,7 +137,7 @@ async function loadPluginHistory() {
}
async function loadPluginReleases(plugin: Plugin | null | undefined = resolvedPlugin.value, force = false) {
- if (!plugin?.id || !plugin?.repo_url) {
+ if (!plugin?.id || !plugin?.repo_url || !plugin.release) {
releaseDetail.value = null
releaseError.value = ''
return
@@ -190,47 +197,47 @@ watch(
-
-
-
-
-
-
- {{ t('plugin.currentVersion') }}
-
-
- {{ t('plugin.latestVersion') }}
-
-
- {{ formatReleaseDate(releaseItemByHistoryVersion(version)?.published_at) }}
-
-
-
- {{
- releaseItemByHistoryVersion(version)?.is_current
- ? t('plugin.installed')
- : releaseItemByHistoryVersion(version)?.is_latest
- ? latestActionText
- : t('plugin.installReleaseVersion')
- }}
-
-
+
+
+
+
+ {{ formatReleaseDate(releaseItemByHistoryVersion(version)?.published_at) }}
+
+
+ {{ t('plugin.latestVersion') }}
+
+
+ {{ t('plugin.currentVersion') }}
+
+
+
+ {{
+ releaseItemByHistoryVersion(version)?.is_latest
+ ? latestActionText
+ : t('plugin.installReleaseVersion')
+ }}
+
+
-
+
-
+
@@ -261,32 +272,22 @@ watch(
justify-content: center;
}
-.plugin-release-action,
-.plugin-release-action__meta {
+.plugin-release-button {
+ white-space: nowrap;
+}
+
+.plugin-release-meta {
display: flex;
align-items: center;
gap: 0.5rem;
flex-wrap: wrap;
+ min-width: 0;
}
-.plugin-release-action {
- justify-content: flex-end;
- min-width: 10rem;
+.plugin-release-meta__date {
+ color: rgba(var(--v-theme-on-surface), var(--v-disabled-opacity));
+ font-size: 0.875rem;
+ white-space: nowrap;
}
-.plugin-release-action__meta {
- justify-content: flex-end;
-}
-
-@media (max-width: 600px) {
- .plugin-release-action,
- .plugin-release-action__meta {
- justify-content: flex-start;
- width: 100%;
- }
-
- .plugin-release-action {
- min-width: 0;
- }
-}
diff --git a/src/components/misc/VersionHistory.vue b/src/components/misc/VersionHistory.vue
index 32a14104..c7528d4a 100644
--- a/src/components/misc/VersionHistory.vue
+++ b/src/components/misc/VersionHistory.vue
@@ -27,43 +27,100 @@ function renderMarkdown(value: string) {
// 输入参数
const props = defineProps({
history: Object as PropType<{ [key: string]: string }>,
+ hasAction: Function as PropType<(version: string) => boolean>,
})
+
+function shouldRenderAction(version: string) {
+ return props.hasAction?.(version) ?? true
+}
-
-
-
- {{ key }}
-
-
-
-
-
-
-
+