feat(xo-web/plugins): auto-load follow load/unload (#7317)

Loading, or unloading, will respectively enable, or disable, _Auto-load at server start_,
this should lead to least surprising behaviors.
This commit is contained in:
Julien Fontanet
2024-01-19 09:55:36 +01:00
committed by GitHub
parent c1c122d92c
commit 3892efcca2
2 changed files with 6 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
- [Tasks] Hide `/rrd_updates` tasks by default
- [Sign in] Support _Remember me_ feature with external providers (PR [#7298](https://github.com/vatesfr/xen-orchestra/pull/7298))
- [Pool/Host] Add a warning if hosts do not have the same version within a pool [#7059](https://github.com/vatesfr/xen-orchestra/issues/7059) (PR [#7280](https://github.com/vatesfr/xen-orchestra/pull/7280))
- [Plugins] Loading, or unloading, will respectively enable, or disable, _Auto-load at server start_, this should lead to least surprising behaviors (PR [#7317](https://github.com/vatesfr/xen-orchestra/pull/7317))
### Bug fixes

View File

@@ -76,12 +76,15 @@ class Plugin extends Component {
_updateLoad = () => {
const { props } = this
const { id } = props
if (!props.loaded) {
return loadPlugin(props.id)
enablePluginAutoload(id).catch(console.warn)
return loadPlugin(id)
}
if (props.unloadable !== false) {
return unloadPlugin(props.id)
disablePluginAutoload(id).catch(console.warn)
return unloadPlugin(id)
}
}