Add button to resume individual plugins execution
Checklist before requesting a review
- [x] I have read the CONTRIBUTING document.
- [x] I have performed a self-review of my code.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [x] This change requires a documentation update.
Description
Add a "Resume plugin execution" button for "suspended" plugins, in both the classic plugin page and the marketplace page.
Handling the "suspended" state individualy is required to be able to implement the "Suspend all plugins execution" / "Resume all plugins execution" feature and to be able to set active plugins as "suspended" during the GLPI update instead of disabling them.
Screenshots (if appropriate):
Marketplace page:
Classic plugins page:
I understand the final purpose (GLPI update), but do we need UI for a single manual action?
I understand the final purpose (GLPI update), but do we need UI for a single manual action?
Individual action are not strictly required, but I guess it could help people to suspend/resume plugins one by one when they try to figure out which plugin is responsable of a specific behaviour/bug.
Anyway we need to display something in the plugin card to indicate when the plugin is suspended.
From a user perspective, the difference between paused and disabled will not be clear.
Question, apart from the update scenario, where do we need the paused state?
I suggest that when the plugin is paused to replace the enable/disable switch with a ti-pause icon button (we may switch to a ti-play on hover) with a tooltip indicating the plugin has been temporarily paused, and you can force resuming. When "resumed", you display the classic switch "disable/enable"
Question, apart from the update scenario, where do we need the paused state?
The support team asked many times to have a feature that permit to suspend/resume all the plugins execution at once, to be able to easilly check whether a plugin is responsible of a given bug/behaviour.
I suggest that when the plugin is paused to replace the enable/disable switch with a
ti-pauseicon button (we may switch to ati-playon hover) with a tooltip indicating the plugin has been temporarily paused, and you can force resuming. When "resumed", you display the classic switch "disable/enable"
OK
suspend/resume all the plugins
I was against adding single buttons to the existing ones, but I'm still OK with a global action, in both UI and console. For the legacy list, a massive action should be ok. For the marketplace UI, a dedicated button will be required.
I was against adding single buttons to the existing ones, but I'm still OK with a global action, in both UI and console. For the legacy list, a massive action should be ok. For the marketplace UI, a dedicated button will be required.
FYI from the current code there is still single buttons unless I am missing something.
I am not sure about the "per plugin" implementation.
Shouldn't this be a global flag instead, like a value in the config (
suspend_plugins true/false) ?
Indeed, I will try to see if handling a global flag is easy to do. It would be more secure indeed.
I am not sure about the "per plugin" implementation. Shouldn't this be a global flag instead, like a value in the config (
suspend_plugins true/false) ?Indeed, I will try to see if handling a global flag is easy to do. It would be more secure indeed.
Done. It simplifies the code. Also, I was able to remove the SUSPENDED state introduced in #17324 and that was used only during an update from the marketplace.
EDIT : I updated the PR description to reflect these changes.