From fc17a7486507ae93956ca728204862caa2892b5c Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 21 Dec 2024 14:54:43 -0600 Subject: [PATCH] Update plugin to use uuid for id, update example plugin with taskmanager and socketauthority test --- .../config/plugins/{_slug.vue => _id.vue} | 5 +- client/pages/config/plugins/index.vue | 2 +- client/pages/item/_id/index.vue | 14 +- server/Auth.js | 5 +- server/PluginAbstract.js | 20 --- server/Server.js | 4 +- server/controllers/PluginController.js | 16 +-- server/managers/PluginManager.js | 46 +++++-- server/routers/ApiRouter.js | 4 +- test/server/managers/plugins/Example/index.js | 124 +++++++++++------- .../managers/plugins/Example/manifest.json | 3 +- 11 files changed, 138 insertions(+), 105 deletions(-) rename client/pages/config/plugins/{_slug.vue => _id.vue} (95%) delete mode 100644 server/PluginAbstract.js diff --git a/client/pages/config/plugins/_slug.vue b/client/pages/config/plugins/_id.vue similarity index 95% rename from client/pages/config/plugins/_slug.vue rename to client/pages/config/plugins/_id.vue index 619b6608..3f7d84b7 100644 --- a/client/pages/config/plugins/_slug.vue +++ b/client/pages/config/plugins/_id.vue @@ -42,7 +42,7 @@ export default { if (!store.getters['user/getIsAdminOrUp']) { redirect('/') } - const plugin = store.state.plugins.find((plugin) => plugin.slug === params.slug) + const plugin = store.state.plugins.find((plugin) => plugin.id === params.id) if (!plugin) { redirect('/config/plugins') } @@ -95,14 +95,13 @@ export default { console.log('Form data', formData) const payload = { - pluginSlug: this.plugin.slug, config: formData } this.processing = true this.$axios - .$post(`/api/plugins/config`, payload) + .$post(`/api/plugins/${this.plugin.id}/config`, payload) .then(() => { console.log('Plugin configuration saved') }) diff --git a/client/pages/config/plugins/index.vue b/client/pages/config/plugins/index.vue index d9244744..925248f9 100644 --- a/client/pages/config/plugins/index.vue +++ b/client/pages/config/plugins/index.vue @@ -11,7 +11,7 @@

Installed Plugins