diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index e1f5ab63f..9e070a6da 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -138,6 +138,8 @@ class ConfigController extends Controller } $this->view->module = $module; + $this->view->libraries = $app->getLibraries(); + $this->view->moduleManager = $manager; $this->view->toggleForm = $toggleForm; $this->view->title = $module->getName(); $this->view->tabs = $module->getConfigTabs()->activate('info'); diff --git a/application/views/scripts/config/module.phtml b/application/views/scripts/config/module.phtml index 684c62f6d..6cadd8a90 100644 --- a/application/views/scripts/config/module.phtml +++ b/application/views/scripts/config/module.phtml @@ -6,9 +6,11 @@ translate('There is no such module installed.') ?> getDependencies(); + $requiredMods = $module->getRequiredModules(); + $requiredLibs = $module->getRequiredLibraries(); $restrictions = $module->getProvidedRestrictions(); $permissions = $module->getProvidedPermissions(); + $unmetDependencies = $moduleManager->hasUnmetDependencies($module->getName()); $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled' ?> @@ -20,9 +22,13 @@ @@ -43,13 +49,58 @@ - diff --git a/public/css/icinga/main.less b/public/css/icinga/main.less index 4588750c3..9276a170b 100644 --- a/public/css/icinga/main.less +++ b/public/css/icinga/main.less @@ -178,6 +178,12 @@ a:hover > .icon-cancel { width: 100%; } +.name-value-table > caption { + margin-top: .5em; + text-align: left; + font-weight: bold; +} + .name-value-table > tbody > tr > th { color: @text-color-light; // Reset default font-weight @@ -350,4 +356,30 @@ a:hover > .icon-cancel { padding-right: 0; } } +} + +.module-dependencies { + .unmet-dependencies { + background-color: @color-warning; + color: @text-color-on-icinga-blue; + padding: .25em .5em; + margin-left: -.5em; + } + + .name-value-table { + > caption { + font-weight: normal; + color: @text-color-light; + } + + > tbody > tr > th { + font-weight: bold; + color: @text-color; + } + + .missing { + color: @color-critical; + font-weight: bold; + } + } } \ No newline at end of file
translate('State') ?> - toggleForm)): ?> + toggleForm)): ?> + enabled || ! $unmetDependencies): ?> toggleForm ?> + + icon('attention-alt', $this->translate('Module can\'t be enabled due to unmet dependencies')) ?> +
escape($this->translate('Version')) ?>
escape($this->translate('Dependencies')) ?> - translate('This module has no dependencies'); - else: foreach ($dependencies as $name => $versionString): ?> - escape($name) ?>: escape($versionString) ?>
- +
+ + translate('This module has no dependencies') ?> + + + + translate('Unmet dependencies found! Module can\'t be enabled unless all dependencies are met.') ?> + + + + + + $versionString): ?> + + + + + +
translate('Libraries') ?>
escape($libraryName) ?> + has($libraryName, $versionString === true ? null : $versionString)): ?> + escape($versionString) ?> + + escape($versionString) ?> + get($libraryName)) !== null): ?> + (getVersion() ?>) + + +
+ + + + + $versionString): ?> + + + + + +
translate('Modules') ?>
escape($moduleName) ?> + has($moduleName, $versionString === true ? null : $versionString)): ?> + escape($versionString) ?> + + escape($versionString) ?> + hasInstalled($moduleName)): ?> + (translate('not installed') ?>) + + (getModule($moduleName, false)->getVersion() ?>hasEnabled($moduleName) ? '' : ', ' . $this->translate('disabled') ?>) + + +
+ +