diff --git a/source/app/web/instance.mjs b/source/app/web/instance.mjs index 2c6f0011..e53bd547 100644 --- a/source/app/web/instance.mjs +++ b/source/app/web/instance.mjs @@ -84,7 +84,7 @@ export default async function({mock, nosettings} = {}) { .map(([key, value]) => [key, Object.fromEntries(Object.entries(value).filter(([key]) => ["name", "icon", "category", "web", "supports", "scopes"].includes(key)))]) .map(([key, value]) => [key, key === "core" ? {...value, web:Object.fromEntries(Object.entries(value.web).filter(([key]) => /^config[.]/.test(key)).map(([key, value]) => [key.replace(/^config[.]/, ""), value]))} : value]), ) - const enabled = Object.entries(metadata).filter(([_name, {category}]) => category !== "core").map(([name]) => ({name, enabled:plugins[name]?.enabled ?? false})) + const enabled = Object.entries(metadata).filter(([_name, {category}]) => category !== "core").map(([name]) => ({name, category:metadata[name]?.category ?? "community", enabled:plugins[name]?.enabled ?? false})) const templates = Object.entries(Templates).map(([name]) => ({name, enabled:(conf.settings.templates.enabled.length ? conf.settings.templates.enabled.includes(name) : true) ?? false})) const actions = {flush:new Map()} let requests = {limit:0, used:0, remaining:0, reset:NaN} diff --git a/source/app/web/statics/app.js b/source/app/web/statics/app.js index e3707e7b..83348246 100644 --- a/source/app/web/statics/app.js +++ b/source/app/web/statics/app.js @@ -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", diff --git a/source/app/web/statics/index.html b/source/app/web/statics/index.html index dd87d7b9..fa10540f 100644 --- a/source/app/web/statics/index.html +++ b/source/app/web/statics/index.html @@ -83,12 +83,17 @@ -
+
🧩 Additional plugins - +
diff --git a/source/app/web/statics/style.css b/source/app/web/statics/style.css index 9d0240a5..8d39ba05 100644 --- a/source/app/web/statics/style.css +++ b/source/app/web/statics/style.css @@ -126,10 +126,25 @@ border-top: 1px solid var(--color-border-primary); } + .configuration.plugins label { + display: flex; + align-items: flex-start; + } + .configuration .not-available { color: var(--color-text-secondary); } + .configuration details { + display: flex; + flex-direction: column; + } + + .configuration summary { + font-weight: bold; + text-transform: capitalize; + } + .option { display: flex; flex-direction: column;