mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
Only reload JS/CSS if really required when en-/disabling a module
This commit is contained in:
parent
81c0613e68
commit
439218869b
@ -176,11 +176,22 @@ class ConfigController extends Controller
|
|||||||
|
|
||||||
$form = new ActionForm();
|
$form = new ActionForm();
|
||||||
$form->setOnSuccess(function (ActionForm $form) {
|
$form->setOnSuccess(function (ActionForm $form) {
|
||||||
$module = $form->getValue('identifier');
|
$moduleName = $form->getValue('identifier');
|
||||||
Icinga::app()->getModuleManager()->enableModule($module);
|
$module = Icinga::app()->getModuleManager()
|
||||||
Notification::success(sprintf($this->translate('Module "%s" enabled'), $module));
|
->enableModule($moduleName)
|
||||||
|
->getModule($moduleName);
|
||||||
|
Notification::success(sprintf($this->translate('Module "%s" enabled'), $moduleName));
|
||||||
$form->onSuccess();
|
$form->onSuccess();
|
||||||
$this->redirectHttp('config/modules');
|
|
||||||
|
if ($module->hasJs()) {
|
||||||
|
$this->redirectHttp('config/modules');
|
||||||
|
} else {
|
||||||
|
if ($module->hasCss()) {
|
||||||
|
$this->reloadCss();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->rerenderLayout()->redirectNow('config/modules');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -202,11 +213,22 @@ class ConfigController extends Controller
|
|||||||
|
|
||||||
$form = new ActionForm();
|
$form = new ActionForm();
|
||||||
$form->setOnSuccess(function (ActionForm $form) {
|
$form->setOnSuccess(function (ActionForm $form) {
|
||||||
$module = $form->getValue('identifier');
|
$mm = Icinga::app()->getModuleManager();
|
||||||
Icinga::app()->getModuleManager()->disableModule($module);
|
$moduleName = $form->getValue('identifier');
|
||||||
Notification::success(sprintf($this->translate('Module "%s" disabled'), $module));
|
$module = $mm->getModule($moduleName);
|
||||||
|
$mm->disableModule($moduleName);
|
||||||
|
Notification::success(sprintf($this->translate('Module "%s" disabled'), $moduleName));
|
||||||
$form->onSuccess();
|
$form->onSuccess();
|
||||||
$this->redirectHttp('config/modules');
|
|
||||||
|
if ($module->hasJs()) {
|
||||||
|
$this->redirectHttp('config/modules');
|
||||||
|
} else {
|
||||||
|
if ($module->hasCss()) {
|
||||||
|
$this->reloadCss();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->rerenderLayout()->redirectNow('config/modules');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user