Skip to content

Commit 1ae35ab

Browse files
committed
update docs
1 parent cf49498 commit 1ae35ab

File tree

2 files changed

+43
-12
lines changed

2 files changed

+43
-12
lines changed

docs/.vuepress/components/PluginMarket.vue

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,25 @@ onUnmounted(() => {
272272
}
273273
})
274274
275-
const pluginCategories = ['前端', '后端']
275+
const mixedAlphabeticalCompare = (a: string, b: string): number => {
276+
return a.localeCompare(b, 'zh-CN', {
277+
sensitivity: 'base',
278+
numeric: true,
279+
ignorePunctuation: true
280+
})
281+
}
282+
283+
const pluginCategories = computed(() => {
284+
const allTags = new Set<string>()
285+
props.items.forEach(item => {
286+
item.tags.forEach(tag => {
287+
if (tag !== 'unfree') {
288+
allTags.add(tag)
289+
}
290+
})
291+
})
292+
return Array.from(allTags).sort((a, b) => mixedAlphabeticalCompare(a, b))
293+
})
276294
277295
const baseFilteredItems = computed(() => {
278296
let result = [...props.items]
@@ -314,14 +332,6 @@ const getTypeSortWeight = (item: PluginItem): number => {
314332
return 3
315333
}
316334
317-
const mixedAlphabeticalCompare = (a: string, b: string): number => {
318-
return a.localeCompare(b, 'zh-CN', {
319-
sensitivity: 'base',
320-
numeric: true,
321-
ignorePunctuation: true
322-
})
323-
}
324-
325335
const filteredItems = computed(() => {
326336
const result = [...baseFilteredItems.value]
327337
@@ -348,7 +358,12 @@ const resetFilters = () => {
348358
sortOption.value = 'category'
349359
}
350360
351-
const colors = {
361+
const predefinedColors = {
362+
'unfree': {
363+
color: '#ff5733',
364+
backgroundColor: 'rgba(255, 87, 51, 0.1)',
365+
borderColor: 'rgba(255, 87, 51, 0.2)',
366+
},
352367
'mysql': {
353368
color: '#006484',
354369
backgroundColor: 'rgba(0, 100, 132, 0.1)',
@@ -371,6 +386,22 @@ const colors = {
371386
},
372387
}
373388
389+
const colors = computed(() => {
390+
const colorMap: Record<string, any> = { ...predefinedColors }
391+
const allTags = [...new Set(props.items.flatMap(item => item.tags))]
392+
allTags.forEach((tag, index) => {
393+
if (!colorMap[tag]) {
394+
const hue = (index * 137.5) % 360
395+
colorMap[tag] = {
396+
color: `hsl(${ hue }, 65%, 50%)`,
397+
backgroundColor: `hsl(${ hue }, 65%, 50%, 0.1)`,
398+
borderColor: `hsl(${ hue }, 65%, 50%, 0.2)`
399+
}
400+
}
401+
})
402+
return colorMap
403+
})
404+
374405
const handleCardClick = (item: PluginItem) => {
375406
if (item.link) {
376407
window.open(item.link, '_blank')

docs/.vuepress/data/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const pluginItems: PluginItem[] = [
5858
title: "MCP 服务器管理",
5959
description: "提供了 MCP 服务器管理功能,并添加了可调用 MCP 的 AI 聊天接口",
6060
label: '官方',
61-
tags: ["pgsql", "mysql", "后端"],
61+
tags: ["AI", "mcp", "pgsql", "mysql", "后端"],
6262
link: "https://github.com/fastapi-practices/mcp",
6363
logo: 'https://wu-clan.github.io/picx-images-hosting/logo/fba.png',
6464
},
@@ -97,7 +97,7 @@ export const pluginItems: PluginItem[] = [
9797
title: "Casdoor SSO",
9898
description: "通过 Casdoor 实现 SSO 单点登录集成",
9999
label: '官方',
100-
tags: ["unfree", "pgsql", "mysql", "后端"],
100+
tags: ["pgsql", "mysql", "后端"],
101101
link: "https://github.com/fastapi-practices/casdoor_sso",
102102
image: "https://casdoor.org/zh/img/casdoor.png",
103103
logo: 'https://wu-clan.github.io/picx-images-hosting/logo/fba.png',

0 commit comments

Comments
 (0)