config/diff: allow to flip shown configs, even...

...undeployed ones
This commit is contained in:
Thomas Gelf 2016-10-27 20:40:57 +00:00
parent 5fc9aabd3e
commit 6642d8cf74
2 changed files with 19 additions and 3 deletions

View File

@ -213,7 +213,14 @@ class ConfigController extends ActionController
$rightSum = $this->view->rightSum = $this->params->get('right');
$left = IcingaConfig::load(Util::hex2binary($leftSum), $db);
$this->view->configs = $db->enumDeployedConfigs();
$configs = $db->enumDeployedConfigs();
foreach (array($leftSum, $rightSum) as $sum) {
if (! array_key_exists($sum, $configs)) {
$configs[$sum] = substr($sum, 0, 7);
}
}
$this->view->configs = $configs;
if ($rightSum === null) {
return;
}

View File

@ -8,14 +8,23 @@
<?= $this->formSelect(
'left',
$this->leftSum,
array('class' => 'autosubmit'),
array('class' => 'autosubmit', 'style' => 'width: 37%'),
array(null => $this->translate('- please choose -')) + $this->configs
)
?>
<?= $this->qlink(
'',
$this->url(),
array(
'left' => $this->rightSum,
'right' => $this->leftSum
),
array('class' => 'icon-flapping')
) ?>
<?= $this->formSelect(
'right',
$this->rightSum,
array('class' => 'autosubmit'),
array('class' => 'autosubmit', 'style' => 'width: 37%'),
array(null => $this->translate('- please choose -')) + $this->configs
)
?>