Skip to content

Commit 70b95e0

Browse files
authored
feat: show plugin update time in marketplace details (#9690)
1 parent d5f7371 commit 70b95e0

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

dashboard/src/i18n/locales/en-US/features/extension.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"author": "Author",
133133
"category": "Category",
134134
"stars": "Stars",
135+
"updatedAt": "Updated At",
135136
"tags": "Tags",
136137
"astrbotVersion": "AstrBot Version Requirement",
137138
"supportPlatforms": "Supported Platforms",

dashboard/src/i18n/locales/ru-RU/features/extension.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"author": "Автор",
133133
"category": "Категория",
134134
"stars": "Звезды",
135+
"updatedAt": "Обновлено",
135136
"tags": "Теги",
136137
"astrbotVersion": "Требуемая версия AstrBot",
137138
"supportPlatforms": "Поддерживаемые платформы",

dashboard/src/i18n/locales/zh-CN/features/extension.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"author": "作者",
133133
"category": "类别",
134134
"stars": "Star数",
135+
"updatedAt": "更新时间",
135136
"tags": "标签",
136137
"astrbotVersion": "AstrBot 版本要求",
137138
"supportPlatforms": "支持平台",

dashboard/src/views/extension/PluginDetailPage.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import DOMPurify from "dompurify";
1212
import MarkdownIt from "markdown-it";
1313
import defaultPluginIcon from "/favicon.svg";
1414
import { pluginApi } from "@/api/v1";
15+
import { useI18n } from "@/i18n/composables";
1516
import { usePluginI18n } from "@/utils/pluginI18n";
1617
import PluginPlatformChip from "@/components/shared/PluginPlatformChip.vue";
1718
@@ -35,6 +36,7 @@ const props = defineProps({
3536
});
3637
3738
const { tm, router } = props.state;
39+
const { locale } = useI18n();
3840
const {
3941
pluginName,
4042
pluginDesc: resolvePluginDesc,
@@ -233,6 +235,29 @@ const supportPlatformsDisplay = computed(() => {
233235
return platforms.filter((platform) => typeof platform === "string");
234236
});
235237
238+
const updatedAtDisplay = computed(() => {
239+
if (!isMarketDetail.value) return "";
240+
241+
const value = firstPresentValue(
242+
pluginData.value?.updated_at,
243+
props.marketPlugin?.updated_at,
244+
);
245+
if (!value) return "";
246+
247+
const updatedAt = new Date(value);
248+
if (Number.isNaN(updatedAt.getTime())) return "";
249+
250+
return new Intl.DateTimeFormat(locale.value, {
251+
year: "numeric",
252+
month: "2-digit",
253+
day: "2-digit",
254+
hour: "2-digit",
255+
minute: "2-digit",
256+
second: "2-digit",
257+
hour12: false,
258+
}).format(updatedAt);
259+
});
260+
236261
const infoRows = computed(() => {
237262
const rows = [
238263
{
@@ -251,6 +276,11 @@ const infoRows = computed(() => {
251276
value: starsDisplay.value,
252277
optional: true,
253278
},
279+
{
280+
label: tm("detail.info.updatedAt"),
281+
value: updatedAtDisplay.value,
282+
optional: true,
283+
},
254284
{
255285
label: tm("detail.info.tags"),
256286
value: tagsDisplay.value,

0 commit comments

Comments
 (0)