feat(app/web): order plugins by category [skip ci]

This commit is contained in:
lowlighter
2022-01-01 06:14:08 -05:00
parent ef7485e46c
commit af772564d9
4 changed files with 29 additions and 6 deletions

View File

@@ -32,6 +32,8 @@
(async () => {
const { data: plugins } = await axios.get("/.plugins")
this.plugins.list = plugins.filter(({name}) => metadata[name]?.supports.includes("user") || metadata[name]?.supports.includes("organization"))
const categories = [...new Set(this.plugins.list.map(({category}) => category))]
this.plugins.categories = Object.fromEntries(categories.map(category => [category, this.plugins.list.filter(value => category === value.category)]))
})(),
//Base
(async () => {
@@ -94,6 +96,7 @@
plugins: {
base: {},
list: [],
categories: [],
enabled: {},
descriptions: {
base: "🗃️ Base content",