mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
monitoring/multi: view script cleanup
They now play fine with new filters, tried to improve usability
This commit is contained in:
parent
76219b025b
commit
f4b7075293
@ -1,32 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr class="newsection">
|
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
||||||
<th>
|
|
||||||
<?= count($comments) ?> Comments
|
?><tr class="newsection" data-base-target="_next">
|
||||||
</th>
|
<th><a href=<?= count($comments) ?> <?= $this->translate('Comments') ?></th>
|
||||||
<td>
|
<td>
|
||||||
<a
|
<a href="<?= $this->href('monitoring/command/removecomment', $this->target) ?>"><?=
|
||||||
href="<?= $this->href('monitoring/command/removecomment', $this->target); ?>"
|
$this->icon('remove_petrol.png')
|
||||||
>
|
?> <?= $this->translate('Remove Comments') ?></a><br />
|
||||||
<?= $this->icon('remove_petrol.png') ?> Remove Comments
|
<a href="<?= $this->href('monitoring/command/delaynotifications', $this->target); ?>"><?=
|
||||||
</a> <br >
|
$this->icon('notification_disabled_petrol.png')
|
||||||
<a
|
?> <?= $this->translate('Delay Notifications') ?></a><br />
|
||||||
href="<?= $this->href('monitoring/command/delaynotifications', $this->target); ?>"
|
<a title="<?= $this->translate('Acknowledge all problems on the selected hosts or services') ?>"
|
||||||
>
|
href="<?= $this->href('monitoring/command/acknowledgeproblem') ?>, $this->target); ?>">
|
||||||
<?= $this->icon('notification_disabled_petrol.png') ?> Delay Notifications
|
|
||||||
</a> <br >
|
|
||||||
<a
|
|
||||||
title="Acknowledge all problems on the selected hosts or services"
|
|
||||||
href="<?= $this->href('monitoring/command/acknowledgeproblem', $this->target); ?>"
|
|
||||||
>
|
|
||||||
<?= $this->icon('acknowledgement_petrol.png') ?> Acknowledge
|
<?= $this->icon('acknowledgement_petrol.png') ?> Acknowledge
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>Change <a data-base-target='_next' href=" <?= $this->href(
|
<td><a href=" <?= $this->href(
|
||||||
'monitoring/list/comments',
|
'monitoring/list/comments',
|
||||||
array('comment_internal_id' => implode(',', $this->comments))
|
array('comment_internal_id' => '(' . implode('|', $this->comments) . ')')
|
||||||
);
|
);
|
||||||
?>"> <?= count($comments) ?> comments </a>.
|
?>"> <?= count($comments) ?> comments </a>.
|
||||||
</td>
|
</td>
|
||||||
|
@ -1,25 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
||||||
|
|
||||||
|
?>
|
||||||
<tr class="newsection">
|
<tr class="newsection">
|
||||||
<th>
|
<th><?= count($downtimes) ?> Downtimes</th>
|
||||||
<?= count($downtimes) ?> Downtimes
|
|
||||||
</th>
|
|
||||||
<td>
|
<td>
|
||||||
<a href="<?=$this->href('monitoring/command/removedowntime', $this->target); ?>">
|
<a href="<?=$this->href('monitoring/command/removedowntime', $this->target); ?>"><?=
|
||||||
<?= $this->icon('remove_petrol.png') ?> Remove Downtimes
|
$this->icon('remove_petrol.png') ?>Remove Downtimes</a><br />
|
||||||
</a> <br />
|
<a title="Schedule downtimes for all selected <?= $objectName ?>" href="<?=
|
||||||
<a
|
$this->href('monitoring/command/scheduledowntime', $this->target) ?>"><?=
|
||||||
title="Schedule downtimes for all selected <?= $objectName ?>"
|
$this->icon('in_downtime_petrol.png')
|
||||||
href="<?= $this->href('monitoring/command/scheduledowntime', $this->target); ?>"
|
?> Schedule Downtimes</a>
|
||||||
>
|
|
||||||
<?= $this->icon('in_downtime_petrol.png') ?> Schedule Downtimes
|
|
||||||
</a>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
Change <a data-base-target='_next' href="<?= $this->href('') ?>"
|
Change <a data-base-target='_next' href="<?= $this->href('') ?>"> <?= count($downtimes) ?> downtimes</a>.
|
||||||
> <?= count($downtimes) ?> downtimes
|
|
||||||
</a>.
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -5,27 +5,21 @@
|
|||||||
action="<?= $form->getAction() ?>"
|
action="<?= $form->getAction() ?>"
|
||||||
method="post"
|
method="post"
|
||||||
>
|
>
|
||||||
<table class="avp">
|
<table class="avp newsection">
|
||||||
<tr class="newsection"><th></th><td></td></tr>
|
|
||||||
<?php foreach($this->form->getElements() as $name => $element):
|
<?php foreach($this->form->getElements() as $name => $element):
|
||||||
if ($element instanceof \Icinga\Web\Form\Element\TriStateCheckbox):
|
if ($element instanceof \Icinga\Web\Form\Element\TriStateCheckbox):
|
||||||
$element->setDecorators(array('ViewHelper'));
|
$element->setDecorators(array('ViewHelper'));
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th><label for="<?= $element->getName() ?>"> <?= $element->getLabel() ?> </label></th>
|
||||||
<label for="<?= $element->getName() ?>"> <?= $element->getLabel() ?> </label>
|
<td><?= $element->render() ?></td>
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<?= $element->render() ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th></th>
|
||||||
<td><?= $element->render() ?></td>
|
<td><?= $element->render() ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php endif ?>
|
||||||
endif;
|
<?php endforeach ?>
|
||||||
endforeach;
|
|
||||||
?>
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
@ -1,34 +1,65 @@
|
|||||||
<?php for ($i = 0; $i < count($objects) && $i < 5; $i++) {
|
<?php
|
||||||
$object = $objects[$i]; ?>
|
|
||||||
<a data-base-target='_next' href="<?php
|
$objectCount = count($objects);
|
||||||
|
|
||||||
|
$links = array();
|
||||||
|
for ($i = 0; $i < $objectCount && $i < 5; $i++) {
|
||||||
|
$object = $objects[$i];
|
||||||
|
|
||||||
if ($this->is_service) {
|
if ($this->is_service) {
|
||||||
echo $this->href(
|
$links[] = $this->qlink(
|
||||||
|
$object->host_name . ' ' . $object->service_description,
|
||||||
'monitoring/show/service',
|
'monitoring/show/service',
|
||||||
array('host' => $object->host_name, 'service' => $object->service_description)
|
array(
|
||||||
|
'host' => $object->host_name,
|
||||||
|
'service' => $object->service_description
|
||||||
|
)
|
||||||
);
|
);
|
||||||
echo '">' . $object->host_name . ' ' . $object->service_description . '</a>';
|
|
||||||
} else {
|
} else {
|
||||||
echo $this->href(
|
$links[] = $this->qlink(
|
||||||
|
$object->host_name,
|
||||||
'monitoring/show/host',
|
'monitoring/show/host',
|
||||||
array('host' => $object->host_name)
|
array(
|
||||||
|
'host' => $object->host_name
|
||||||
|
)
|
||||||
);
|
);
|
||||||
echo '">' . $object->host_name . '</a>';
|
}
|
||||||
}?>,
|
|
||||||
<?php } ?> <?php
|
|
||||||
if (count($objects) > 5) {
|
|
||||||
echo '<i> ... ' . (count($objects) - 5) . ' more ... </i>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->is_service) {
|
if ($this->is_service) {
|
||||||
$link = 'monitoring/list/hosts';
|
$objectName = $this->translate('Services');
|
||||||
$target = array(
|
|
||||||
'host' => $this->hostquery
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$link = 'monitoring/list/services';
|
$link = 'monitoring/list/services';
|
||||||
$target = array(
|
$target = array(
|
||||||
'host' => $this->hostquery,
|
'host' => $this->hostquery,
|
||||||
'service' => $this->servicequery
|
'service' => $this->servicequery
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$objectName = $this->translate('Hosts');
|
||||||
|
$link = 'monitoring/list/hosts';
|
||||||
|
$target = array(
|
||||||
|
'host' => $this->hostquery
|
||||||
|
);
|
||||||
}
|
}
|
||||||
?> <a data-base-target='_next' href='<?= $this->href($link, $this->query); ?>'><b> list all </b></a>
|
|
||||||
|
$more = clone $this->url;
|
||||||
|
|
||||||
|
|
||||||
|
?><tr class="newsection" data-base-target="_next">
|
||||||
|
<th><?= $this->qlink(
|
||||||
|
$this->translate('List all'),
|
||||||
|
$more->setPath($link),
|
||||||
|
null,
|
||||||
|
array('title' => $this->translate('List all selected objects'))
|
||||||
|
) ?></th>
|
||||||
|
<td colspan="3">
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo implode(', ', $links);
|
||||||
|
|
||||||
|
if ($objectCount > 5) {
|
||||||
|
echo ' ' . sprintf($this->translate('and %d more'), count($objects) - 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@ -1,72 +1,59 @@
|
|||||||
<?php
|
<?php
|
||||||
/** @var Zend_View_Helper_CommandForm $cf */
|
|
||||||
$cf = $this->getHelper('CommandForm');
|
$cf = $this->getHelper('CommandForm');
|
||||||
$servicequery = isset($this->servicequery) ? $this->servicequery : '';
|
$servicequery = isset($this->servicequery) ? $this->servicequery : '';
|
||||||
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
$objectName = $this->is_service ? $this->translate('Services') : $this->translate('Hosts');
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
$params = array(
|
||||||
<th>
|
|
||||||
<?= count($objects) . ' ' . $objectName ?>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<a
|
|
||||||
href="<?=$this->href(
|
|
||||||
'monitoring/command/reschedulenextcheck',
|
|
||||||
array(
|
|
||||||
'host' => $this->target['host'],
|
'host' => $this->target['host'],
|
||||||
'service' => array_key_exists('service', $this->target) ? $this->target['service'] : null,
|
'service' => null,
|
||||||
'checktime' => time(),
|
'checktime' => time(),
|
||||||
'forcecheck' => '1'
|
'forcecheck' => '1'
|
||||||
)
|
);
|
||||||
); ?>"
|
if (array_key_exists('service', $this->target)) {
|
||||||
>
|
$params['service'] = $this->target['service'];
|
||||||
<?= $this->icon('refresh_petrol.png') ?> Recheck
|
} else {
|
||||||
</a> <br/>
|
unset($params['service']);
|
||||||
<a href="<?= $this->href('monitoring/command/reschedulenextcheck', $this->target) ?>">
|
}
|
||||||
<?= $this->icon('reschedule_petrol.png') ?> Reschedule
|
?>
|
||||||
</a> <br />
|
<tr class="newsection">
|
||||||
|
<th><?= count($objects) . ' ' . $objectName ?></th>
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
Perform actions on <?= count($objects) . ' ' . $objectName ?>.
|
<a href="<?=
|
||||||
|
$this->href('monitoring/command/reschedulenextcheck', $params) ?>"><?=
|
||||||
|
$this->icon('refresh_petrol.png')
|
||||||
|
?> Recheck</a><br />
|
||||||
|
<a href="<?= $this->href('monitoring/command/reschedulenextcheck', $this->target) ?>"><?=
|
||||||
|
$this->icon('reschedule_petrol.png')
|
||||||
|
?> Reschedule</a><br />
|
||||||
</td>
|
</td>
|
||||||
|
<td>Perform actions on <?= count($objects) . ' ' . $objectName ?>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="newsection">
|
<tr class="newsection">
|
||||||
<th>
|
<th><?= $this->problems ?> Problems</th>
|
||||||
<?= $this->problems ?> Problems
|
|
||||||
</th>
|
|
||||||
<td>
|
<td>
|
||||||
<a
|
<a title="Schedule downtimes for all selected hosts" href="<?=
|
||||||
title="Schedule downtimes for all selected hosts"
|
$this->href('monitoring/command/scheduledowntime', $this->target) ?>"><?=
|
||||||
href="<?= $this->href('monitoring/command/scheduledowntime', $this->target); ?>"
|
$this->icon('in_downtime_petrol.png')
|
||||||
>
|
?> Schedule Downtimes</a>
|
||||||
<?= $this->icon('in_downtime_petrol.png') ?> Schedule Downtimes
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Handle <?= $this->problems ?> problems on <span> <?= count($this->objects) ?> </span> <?= $objectName ?>.
|
|
||||||
</td>
|
</td>
|
||||||
|
<td><?= sprintf(
|
||||||
|
'Handle %d problems on %d %s.',
|
||||||
|
$this->problems,
|
||||||
|
count($this->objects),
|
||||||
|
$objectName
|
||||||
|
) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th><?= count($this->unhandled) ?> Unhandled</th>
|
||||||
<?= count($this->unhandled) ?> Unhandled
|
<td colspan="2">
|
||||||
</th>
|
<a title="Acknowledge all problems on the selected hosts or services" href="<?=
|
||||||
<td>
|
$this->href('monitoring/command/acknowledgeproblem', $this->target) ?>"><?=
|
||||||
<a
|
$this->icon('acknowledgement_petrol.png')
|
||||||
title="Acknowledge all problems on the selected hosts or services"
|
?> Acknowledge</a><br />
|
||||||
href="<?= $this->href('monitoring/command/acknowledgeproblem', $this->target);?>"
|
<a title="Remove all acknowledgements from all selected hosts or services" href="<?=
|
||||||
>
|
$this->href('monitoring/command/removeacknowledgement', $target) ?>"><?=
|
||||||
<?= $this->icon('acknowledgement_petrol.png') ?> Acknowledge
|
$this->icon('remove_petrol.png') ?> Remove Acknowledgements</a>
|
||||||
</a> <br />
|
|
||||||
<a
|
|
||||||
title="Remove all acknowledgements from all selected hosts or services"
|
|
||||||
href="<?=$this->href('monitoring/command/removeacknowledgement', $target);?>"
|
|
||||||
>
|
|
||||||
<?= $this->icon('remove_petrol.png') ?> Remove Acknowledgements
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
@ -9,50 +9,36 @@ $this->target = array(
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1> Summary for <?= count($objects) ?> services </h1>
|
<h1> Summary for <?= count($objects) ?> services </h1>
|
||||||
|
|
||||||
<?= $this->render('multi/components/objectlist.phtml'); ?>
|
<table style="width: 100%; font-size: 0.8em;">
|
||||||
<table class="avp">
|
|
||||||
<tr>
|
<tr>
|
||||||
<th align="center">
|
<th colspan="2"><?= array_sum(array_values($service_states)) ?> Services</th>
|
||||||
<h3><?= array_sum(array_values($service_states)) ?> Services</h3>
|
<th colspan="2"><?= array_sum(array_values($host_states)) ?> Hosts</th>
|
||||||
</th>
|
|
||||||
<th></th>
|
|
||||||
<th align="center">
|
|
||||||
<h3><?= array_sum(array_values($host_states)) ?> Hosts</h3>
|
|
||||||
</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center"><?= $this->service_pie->render() ?></td>
|
||||||
<?= $this->service_pie->render(); ?>
|
<td><?php
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
foreach ($service_states as $state => $count) {
|
foreach ($service_states as $state => $count) {
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
echo ucfirst($state) . ': ' . $count . '<br />';
|
echo ucfirst($state) . ': ' . $count . '<br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
</td>
|
?></td>
|
||||||
<td align="center">
|
<td align="center"><?= $this->host_pie->render() ?></td>
|
||||||
<?= $this->host_pie->render(); ?>
|
<td><?php
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
foreach ($host_states as $state => $count) {
|
foreach ($host_states as $state => $count) {
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
echo ucfirst($state) . ': ' . $count . '<br />';
|
echo ucfirst($state) . ': ' . $count . '<br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?></td>
|
||||||
</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -60,20 +46,12 @@ $this->target = array(
|
|||||||
|
|
||||||
<table class="avp newsection">
|
<table class="avp newsection">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?= $this->render('multi/components/summary.phtml'); ?>
|
<?= $this->render('multi/components/objectlist.phtml') ?>
|
||||||
<?= $this->render('multi/components/comments.phtml'); ?>
|
<?= $this->render('multi/components/summary.phtml') ?>
|
||||||
<?= $this->render('multi/components/downtimes.phtml'); ?>
|
<?= $this->render('multi/components/comments.phtml') ?>
|
||||||
|
<?= $this->render('multi/components/downtimes.phtml') ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?= $this->render('multi/components/flags.phtml') ?>
|
<?= $this->render('multi/components/flags.phtml') ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a
|
|
||||||
rel="tooltip"
|
|
||||||
title="Submit passive checkresults"
|
|
||||||
href="<?= $this->href('monitoring/command/submitpassivecheckresult', $this->target); ?>"
|
|
||||||
class="button btn-cta btn-common btn-small"
|
|
||||||
>
|
|
||||||
<i class="icinga-icon-submit"></i>
|
|
||||||
</a>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user