From f777e36b7cb79d35b91db0e3e518904693882900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Fri, 12 Apr 2024 10:07:23 +0200 Subject: [PATCH] [feat] add settings --- src/boot/plugins.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/boot/plugins.ts b/src/boot/plugins.ts index b45bf7c..f9d4297 100644 --- a/src/boot/plugins.ts +++ b/src/boot/plugins.ts @@ -234,6 +234,12 @@ function loadPlugin( Array.prototype.push.apply(loadedPlugins.widgets, plugin.widgets); } + if (!plugin.settingWidgets) plugin.settingWidgets = []; + if (plugin.settingWidgets.length > 0) { + plugin.settingWidgets.forEach((widget) => (widget.name = plugin.id + '.' + widget.name)); + Array.prototype.push.apply(loadedPlugins.settingWidgets, plugin.settingWidgets); + } + loadedPlugins.plugins.push({ id: plugin.id, name: plugin.name, @@ -252,6 +258,7 @@ export async function loadPlugins(backend: FG.Backend, baseRoutes: RouteRecordRa shortcuts: [], outerShortcuts: [], widgets: [], + settingWidgets: [], }; // Wait for all plugins to be loaded