From a771dc5354e0fa6da2b7583b4e9d62c57d7a96e7 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:48:09 +0800 Subject: [PATCH] feat(plugin): add release version install actions (#494) --- src/api/types.ts | 34 ++++ src/components/cards/PluginAppCard.vue | 90 ++++++++- src/components/cards/PluginCard.vue | 34 +++- .../dialog/PluginMarketDetailDialog.vue | 57 +++++- .../dialog/PluginVersionHistoryDialog.vue | 182 ++++++++++++++++-- src/components/misc/VersionHistory.vue | 47 ++++- src/locales/en-US.ts | 6 + src/locales/zh-CN.ts | 6 + src/locales/zh-TW.ts | 6 + 9 files changed, 433 insertions(+), 29 deletions(-) diff --git a/src/api/types.ts b/src/api/types.ts index c40b055a..b7549857 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -656,6 +656,8 @@ export interface Plugin { system_version_message?: string // 主系统版本限定范围 system_version?: string + // 是否声明支持通过 GitHub Release 资产安装 + release?: boolean // 是否本地插件 is_local?: boolean // 插件仓库地址 @@ -668,6 +670,38 @@ export interface Plugin { page_open?: boolean } +// 插件 Release 可安装版本 +export interface PluginReleaseVersion { + // 插件版本 + version: string + // GitHub Release tag + tag_name: string + // Release 标题 + name?: string + // 发布时间 + published_at?: string + // Release 说明 + body?: string + // 匹配到的资产文件名 + asset_name?: string + // 是否为当前市场最新版本 + is_latest?: boolean + // 是否为本地已安装版本 + is_current?: boolean +} + +// 插件 Release 可安装版本响应 +export interface PluginReleaseVersionsResponse { + // 当前插件是否存在可直接安装的 Release 资产 + release_supported: boolean + // 当前市场 package 声明的最新版本 + latest_version?: string | null + // 本地已安装版本 + current_version?: string | null + // 可安装版本列表 + items: PluginReleaseVersion[] +} + // 插件侧栏全页导航项(与后端 PluginSidebarNavItem 对齐) export interface PluginSidebarNavItem { plugin_id: string diff --git a/src/components/cards/PluginAppCard.vue b/src/components/cards/PluginAppCard.vue index fd09b663..7c20a052 100644 --- a/src/components/cards/PluginAppCard.vue +++ b/src/components/cards/PluginAppCard.vue @@ -1,16 +1,20 @@