toplevel: prepare for use in dashboards

This commit is contained in:
Thomas Gelf 2015-02-13 01:52:17 +01:00
parent 46e80204e1
commit 20102fdf49
3 changed files with 14 additions and 4 deletions

View file

@ -10,6 +10,7 @@ class Businessprocess_ProcessController extends Controller
if ($this->getRequest()->isPost()) {
$this->redirectNow($this->getRequest()->getUrl()->with('processName', $this->getRequest()->getPost('processName')));
}
$this->view->compact = $this->params->get('view') === 'compact';
$storage = new LegacyStorage($this->Config()->getSection('global'));
$this->view->processList = $storage->listProcesses();
$process = $this->params->get('processName', key($this->view->processList));

View file

@ -1,4 +1,6 @@
<?php
use Icinga\Module\Businessprocess\ImportedNode;
$count = $this->bp->countChildren();
$howMany = 'normal';
@ -9,23 +11,30 @@ if ($count < 20) {
}
?>
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<h1><?= $this->escape($this->title) ?>
<a href="<?= $this->url()->without('mode') ?>" title="<?= $this->escape('Switch to tree view') ?>" style="float: right"><?= $this->icon('sitemap') ?></a>
<?= $this->render('simulationlink.phtml') ?>
<?= $this->render('editlink.phtml') ?>
</h1>
</div>
<?php endif ?>
<div class="content" data-base-target="_next">
<div class="content<?= $this->compact ? ' compact' : '' ?>" data-base-target="_next">
<?php if (! $this->compact): ?>
<form method="post" action="<?= $this->url()->without('process') ?>" data-base-target="_self">
<?= $this->formSelect('processName', $this->processName, array('class' => 'autosubmit'), $this->processList) ?>
</form>
<?php endif ?>
<div class="toplevel <?= $howMany ?>" data-base-target="_next">
<?php foreach ($this->bp->getChildren() as $name => $node): ?>
<div class="<?= strtolower($node->getStateName()) ?><?= $node->isHandled() ? ' handled' : '' ?>">
<?php if ($node instanceof ImportedNode): ?>
<a href="<?= $this->url('businessprocess/process/show', array('processName' => $node->getConfigName(), 'process' => $name)) ?>"><?= $this->escape($node->getAlias()) ?></a>
<?php else: ?>
<a href="<?= $this->url('businessprocess/process/show', array('processName' => $this->processName, 'process' => $name)) ?>"><?= $this->escape($node->getAlias()) ?></a>
<?php endif ?>
</div>
<?php endforeach ?>
</div>

View file

@ -3,7 +3,7 @@ h1 {
font-size: 1em;
}
h1 a {
.controls h1 a {
color: inherit;
float: right;
font-weight: normal;
@ -318,7 +318,7 @@ table.bp {
}
#layout.twocols, #layout.layout-minimal {
#layout.twocols, #layout.layout-minimal, .compact {
.toplevel.few {
font-size: 1.9em;
}