Feature(custom): show last update time in plugin page

This commit is contained in:
Kuingsmile
2026-05-10 08:51:52 +08:00
parent 94f21b52f2
commit 01fd39cf07
7 changed files with 33 additions and 5 deletions

View File

@@ -11,6 +11,7 @@
- 添加了上传API服务的最大上传并发数和上传间隔设置项避免并发上传过多导致服务器压力过大或被图床服务商限制访问
- 云端页面的SM.MS迁移至S.EE平台
- 云端页面WebDAV平台现在打开官网时会优先使用当前图床配置的endpoint作为链接地址
- 插件页面现在会显示插件的最后更新时间,方便用户了解插件的维护状态
- 优化了本地文件的扩展名获取逻辑,提升了对特殊文件名的兼容性
- 更新了linux下的剪贴板图片获取脚本
- 现在支持在拷贝文件时监听系统剪贴板的变化

View File

@@ -11,6 +11,7 @@
- Added settings for maximum upload concurrency and upload interval for the Upload API service to prevent excessive concurrent uploads that could put too much pressure on the server or lead to access restrictions by image bed providers.
- The cloud page's SM.MS has migrated to the S.EE platform.
- The cloud page WebDAV platform now prioritizes using the current image bed configuration's endpoint as the link address when opening the official website.
- Plugin pages now display the last update time of the plugin, making it easier for users to understand the maintenance status of the plugin.
- Optimized the logic for obtaining local file extensions, improving compatibility with special file names.
- Updated the clipboard image acquisition script for Linux.
- Now supports monitoring system clipboard changes when copying files.

View File

@@ -692,6 +692,7 @@
"installed": "Installed",
"installing": "Installing...",
"installPluginsToGetStarted": "Please install plugins to get started",
"lastUpdated": "Last Updated",
"list": "Plugin List",
"loading": "Loading...",
"loadingPlugins": "Loading plugins...",

View File

@@ -692,6 +692,7 @@
"installed": "已安装",
"installing": "安装中",
"installPluginsToGetStarted": "请先安装插件以开始使用",
"lastUpdated": "最后更新",
"list": "插件列表",
"loading": "加载中...",
"loadingPlugins": "正在加载插件...",

View File

@@ -692,6 +692,7 @@
"installed": "已安裝",
"installing": "安裝中",
"installPluginsToGetStarted": "請先安裝插件以開始使用",
"lastUpdated": "最後更新",
"list": "插件列表",
"loading": "載入中...",
"loadingPlugins": "正在加載插件...",

View File

@@ -133,7 +133,7 @@
</div>
<!-- Plugin Header -->
<div class="mb-4 flex items-start gap-4">
<div class="mb-4 flex items-start gap-2">
<img
class="h-[48px] w-[48px] shrink-0 rounded-lg object-cover"
:src="item.logo"
@@ -153,9 +153,19 @@
>
</h3>
</div>
<p class="m-0 overflow-hidden text-sm text-ellipsis whitespace-nowrap text-secondary">
{{ item.author.replace(/<.*>/, '') }}
</p>
<div class="flex items-center gap-2">
<p class="m-0 overflow-hidden text-sm text-ellipsis whitespace-nowrap text-secondary">
{{ item.author.replace(/<.*>/, '') }}
</p>
<span
v-if="updateTimeMap[item.fullName]"
class="flex shrink-0 items-center gap-1 text-xs text-secondary/70"
:title="t('pages.plugin.lastUpdated')"
>
<CalendarIcon :size="11" />
{{ updateTimeMap[item.fullName] }}
</span>
</div>
</div>
</div>
@@ -337,7 +347,7 @@
>
<div
v-if="!item.gui"
class="absolute top-4 right-4 z-1 rounded-sm bg-accent/20 px-2 py-1 text-sm font-semibold text-secondary"
class="absolute top-4 right-4 z-1 rounded-sm bg-accent/20 px-1 py-0 text-sm font-semibold text-secondary"
>
CLI
</div>
@@ -345,6 +355,14 @@
<p class="m-0 overflow-hidden text-sm text-ellipsis whitespace-nowrap text-secondary">
{{ item.author }}
</p>
<p
v-if="item.date"
class="mt-1 flex shrink-0 items-center gap-1 text-xs text-secondary/70"
:title="t('pages.plugin.lastUpdated')"
>
<CalendarIcon :size="11" />
{{ item.date }}
</p>
</div>
</div>
<div class="mb-6 flex flex-1 items-start">
@@ -407,6 +425,7 @@ import { useStorage } from '@vueuse/core'
import { debounce, DebouncedFunc } from 'lodash-es'
import {
AlertCircleIcon,
CalendarIcon,
CheckIcon,
DownloadIcon,
ExternalLinkIcon,
@@ -448,6 +467,7 @@ const pluginNameList = ref<string[]>([])
const loading = ref(true)
const needReload = ref(false)
const latestVersionMap = reactive<Record<string, string>>({})
const updateTimeMap = reactive<Record<string, string>>({})
const $configForm = useTemplateRef('$configForm')
const strictSearch = useStorage('plugin-strict-search', true)
const showBrowseDialog = ref(false)
@@ -507,6 +527,7 @@ async function getLatestVersionOfPlugIn(pluginName: string) {
const res = await fetch(`https://registry.npmjs.com/${pluginName}`)
const data = await res.json()
latestVersionMap[pluginName] = data['dist-tags'].latest
updateTimeMap[pluginName] = (data.time?.modified || '').split('T')[0]
} catch (err) {
console.error(err)
}
@@ -718,6 +739,7 @@ function handleSearchResult(item: INPMSearchResultObject) {
}
return {
name,
date: pkg.date ? pkg.date.split('T')[0] : '',
fullName: pkg.name,
author: pkg.author?.name || pkg.publisher?.username || 'unknown',
description: pkg.description,

View File

@@ -203,6 +203,7 @@ interface IPluginMenuConfig {
interface INPMSearchResultObject {
package: {
date?: string
name: string
scope: string
version: string