diff --git a/client/src/modules/core/pluginmanager.js b/client/src/modules/core/pluginmanager.js index 03ba7ad8..881f26b2 100644 --- a/client/src/modules/core/pluginmanager.js +++ b/client/src/modules/core/pluginmanager.js @@ -17,6 +17,7 @@ class Plugin { constructor(pluginInternals) { this.__pluginInternals = pluginInternals; + this.userConfig.enabled = this.userConfig.enabled || false; this.start = this.start.bind(this); this.stop = this.stop.bind(this); } @@ -42,7 +43,7 @@ class Plugin { } return false; } - return true; //Assume plugin started since it doesn't have onStart + return this.userConfig.enabled = true; //Assume plugin started since it doesn't have onStart } stop() { @@ -54,6 +55,7 @@ class Plugin { } return false; } + this.userConfig.enabled = false; return true; //Assume plugin stopped since it doesn't have onStop } diff --git a/client/src/modules/ui/components/bd/PluginsView.vue b/client/src/modules/ui/components/bd/PluginsView.vue index 76d17aca..151096f1 100644 --- a/client/src/modules/ui/components/bd/PluginsView.vue +++ b/client/src/modules/ui/components/bd/PluginsView.vue @@ -17,7 +17,6 @@ } catch (err) { } - this.localPlugins = PluginManager.plugins; } function showLocal() { @@ -29,8 +28,11 @@ } function togglePlugin(plugin) { - if (plugin.enabled) return PluginManager.stopPlugin(plugin.name); - PluginManager.startPlugin(plugin.name); + if (plugin.enabled) { + this.pluginManager.stopPlugin(plugin.name); + } else { + this.pluginManager.startPlugin(plugin.name); + } } const methods = { showLocal, showOnline, refreshLocalPlugins, togglePlugin }; @@ -39,8 +41,13 @@ components, data() { return { - localPlugins: [], - local: true + local: true, + pluginManager: PluginManager + } + }, + computed: { + localPlugins: function () { + return this.pluginManager.plugins; } }, methods, diff --git a/client/src/styles/partials/generic.scss b/client/src/styles/partials/generic.scss index f54bf60b..011331cf 100644 --- a/client/src/styles/partials/generic.scss +++ b/client/src/styles/partials/generic.scss @@ -167,7 +167,7 @@ display: block; } -.bd-setting-switch .bd-switch-wrapper input { +.bd-switch-wrapper input { position: absolute; opacity: 0; cursor: pointer; @@ -176,7 +176,7 @@ z-index: 1; } -.bd-setting-switch .bd-switch-wrapper .bd-switch { +.bd-switch-wrapper .bd-switch { position: absolute; top: 0; right: 0; @@ -206,7 +206,7 @@ border-bottom: 0px solid hsla(218,5%,47%,.1); } -.bd-setting-switch .bd-switch-wrapper .bd-switch:before { +.bd-switch-wrapper .bd-switch:before { content: ""; display: block; width: 18px; @@ -221,11 +221,11 @@ box-shadow: 0 3px 1px 0 rgba(0,0,0,.05), 0 2px 2px 0 rgba(0,0,0,.1), 0 3px 3px 0 rgba(0,0,0,.05); } -.bd-setting-switch .bd-switch-wrapper .bd-switch.bd-checked { +.bd-switch-wrapper .bd-switch.bd-checked { background: $colbdblue; } -.bd-setting-switch .bd-switch-wrapper .bd-switch.bd-checked:before { +.bd-switch-wrapper .bd-switch.bd-checked:before { transform: translateX(20px); }