From 15734a65d88ff8ccf340719edec03440d1ae5eff Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 30 Nov 2014 11:32:10 +0100 Subject: [PATCH] process/show: let the process render himself --- application/views/scripts/process/show.phtml | 240 +------------------ 1 file changed, 6 insertions(+), 234 deletions(-) diff --git a/application/views/scripts/process/show.phtml b/application/views/scripts/process/show.phtml index 9eb2a77..2c56581 100644 --- a/application/views/scripts/process/show.phtml +++ b/application/views/scripts/process/show.phtml @@ -1,239 +1,11 @@ -showMenu) { - - if ($this->compact) { - - } else { - -?>
tabs ?> +

escape($this->title) ?> + icon('dashboard') ?> +

-getState() == 0) { - $opened = false; - } - if ($level > 0) $opened = false; - $opened = false; - - -// Example "open three problem levels" - if ($node instanceof BpNode && $node->getState() > 0 && $level < 2) { -// $opened = true; - } - - if ($hidden) { - $opened = false; - } - - $id = $id_prefix . $node->getAlias(); - - if (array_key_exists(md5($id), $opened_list)) { - $opened_list = $opened_list[md5($id)]; - $opened = true; - } else { - $opened_list = array(); - } - if (! $opened) { - $extra = ' collapsed'; - } else { - $extra = ''; - } - - $htm .= ''; - - - - if ($node->isMissing()) { - $state_classes = 'state missing'; - } else { - $state_classes = 'state ' . stateName($node->getState()); - } - if ($node->isInDowntime() || $node->isAcknowledged()) { - $state_classes .= ' handled'; - } - - if ($node instanceof BpNode) { - $htm .= '\n"; - - if ($node->hasChildren()) { - $htm .= '' - . '\n"; - } - } else { - $htm .= '\n"; - } - - $htm .= '
' - . ' ' - . preg_replace('~^\d{2}\.\s*~', '', $node->getAlias()); -/* . ': ' - . $node->getState() - . '/' - . $node->getSortingState(); - */ - if ($node->isInDowntime()) $htm .= ' '; - if ($node->isAcknowledged()) $htm .= ' '; - - if ($node->hasUrl()) { - $htm .= ' '; - } - - // Summaries, PIE -if (! $self->compact) { - $summary = $node->getStateSummary(); - $sumtxt = array(); - foreach ($summary as $k => $v) { - if ($v > 0) { - $sumtxt[] = $v . 'x ' . stateName($k); - } - } - $sumtxt = implode(', ', $sumtxt); - if ($sumtxt === '') $sumtxt = '-'; - if ($level === 0) { - $htm .= '' - . implode(',', $node->getStateSummary()) - . ''; - } -} - // END of PIE - $alias = $node->getAlias(); - if (array_key_exists($alias, $slas)) { - $sla = $slas[$alias]; - $sla_style = ''; - if ($sla->level === null) $sla->level = 0; - if ($sla->value < $sla->level) { - $sla_style = ' color: red; font-weight: bold;'; - } elseif ($sla->value < $sla->level * 1.002) { - $sla_style = ' color: orange;'; - } - $htm .= sprintf(' [SLA] %0.3f%% (Soll: %0.2f%%)', $sla->value, $sla->level); - } - - - // Problem info: - if ($node->getState() > 0) { - $problems = array(); - foreach ($node->getChildren() as $child) { - if ($child->getState() > 0) { - $problems[] = '' . htmlspecialchars($child->getAlias()) . ''; - } - } - $htm .= ':

' . implode(', ', $problems) . '

'; - } - // END of Problem Info - - $htm .= "
hasInfoCommand() ? ' rowspan="2"' : '') . '>' - . $node->getOperator() - . ''; -//$htm .= ''; - - foreach ($node->getChildren() as $name => $child) { - $htm .= showNode($self, $child, $slas, $opened_list, $id_prefix . $id . '_', $level + 1, ! $opened); - } - $htm .= "
'; - if ($node->isInDowntime()) $htm .= ' '; - if ($node->isAcknowledged()) $htm .= ' '; - $htm .= stateName($node->getState()) - . '' - . $node->getHostname() - . '' - . ($node instanceof ServiceNode - ? ' / ' . $node->getServiceDescription() . '' - : '') -/* DEBUG - . ': ' - . $node->getState() - . '/' - . $node->getSortingState()*/ - ; - $htm .= "
'; - $htm .= "\n"; - return $htm; -} - -echo '
'; - -if (! is_array($this->opened)) { $this->opened = array(); } - -?>bp->getRootNodes() as $name => $node): ?> -slas, $this->opened, 'bp_') ?> - -bp->hasWarnings()): ?> -

Warnings

-bp->getWarnings() as $warning): ?> -escape($warning) ?>
- - +
+
bp->renderHtml($this) ?>
+