Skip to content

Commit 19a7680

Browse files
committed
update docs
1 parent 946bee5 commit 19a7680

1 file changed

Lines changed: 30 additions & 9 deletions

File tree

docs/.vuepress/components/PluginMarketplace.vue

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
全部
3838
</button>
3939
<button
40-
v-for="tag in validTags"
40+
v-for="tag in filteredValidTags"
4141
:key="tag"
4242
class="filter-tab"
4343
:class="{ active: currentTag === tag }"
@@ -93,9 +93,11 @@
9393
</div>
9494
</div>
9595
<p class="card-desc">{{ plugin.plugin.description }}</p>
96-
<div class="card-tags" v-if="plugin.plugin.database?.length || plugin.plugin.tags?.length">
97-
<span v-for="db in (plugin.plugin.database || [])" :key="'db-' + db" class="tag tag-db">#{{ db }}</span>
98-
<span v-for="tag in (plugin.plugin.tags || []).slice(0, 3)" :key="tag"
96+
<div class="card-tags"
97+
v-if="getValidDatabases(plugin.plugin.database).length || getValidTags(plugin.plugin.tags).length">
98+
<span v-for="db in getValidDatabases(plugin.plugin.database)" :key="'db-' + db"
99+
class="tag tag-db">#{{ getDbLabel(db) }}</span>
100+
<span v-for="tag in getValidTags(plugin.plugin.tags).slice(0, 3)" :key="tag"
99101
class="tag">#{{ getTagLabel(tag) }}</span>
100102
</div>
101103
</a>
@@ -111,18 +113,19 @@ const TAG_LABELS: Record<string, string> = {
111113
ai: 'AI',
112114
mcp: 'MCP',
113115
agent: 'Agent',
114-
rag: 'RAG',
115-
permission: '权限',
116-
sso: 'SSO',
117-
rbac: 'RBAC',
118116
auth: '认证',
119-
ldap: 'LDAP',
120117
storage: '存储',
121118
notification: '通知',
122119
task: '任务',
120+
payment: '支付',
123121
other: '其他'
124122
}
125123
124+
const DB_TABLES: Record<string, string> = {
125+
mysql: 'MySQL',
126+
postgresql: 'PostgreSQL'
127+
}
128+
126129
const CACHE_KEY = 'fba_plugins_cache'
127130
const CACHE_DURATION = 10 * 60 * 1000
128131
@@ -183,6 +186,24 @@ const getTagLabel = (tag: string): string => {
183186
return TAG_LABELS[tag] || tag
184187
}
185188
189+
const getDbLabel = (db: string): string => {
190+
return DB_TABLES[db] || db
191+
}
192+
193+
const filteredValidTags = computed(() => {
194+
return validTags.value.filter(tag => tag in TAG_LABELS)
195+
})
196+
197+
const getValidTags = (tags: string[] | undefined): string[] => {
198+
if (!tags) return []
199+
return tags.filter(tag => tag in TAG_LABELS)
200+
}
201+
202+
const getValidDatabases = (databases: string[] | undefined): string[] => {
203+
if (!databases) return []
204+
return databases.filter(db => db in DB_TABLES)
205+
}
206+
186207
const resetFilters = () => {
187208
searchQuery.value = ''
188209
currentTag.value = 'all'

0 commit comments

Comments
 (0)