mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
parent
cb630d45ad
commit
081b5072a6
@ -44,20 +44,19 @@ class Zend_View_Helper_FormTriStateCheckbox extends Zend_View_Helper_FormElement
|
|||||||
* @param array $attribs Attributes for the element tag
|
* @param array $attribs Attributes for the element tag
|
||||||
*
|
*
|
||||||
* @return string The element XHTML
|
* @return string The element XHTML
|
||||||
*/
|
*/
|
||||||
public function formTriStateCheckbox($name, $value = null, $attribs = null)
|
public function formTriStateCheckbox($name, $value = null, $attribs = null)
|
||||||
{
|
{
|
||||||
$class = "";
|
$class = "";
|
||||||
$xhtml = '<div data-icinga-component="app/triStateCheckbox" class="form-group">'
|
$xhtml = '<div>'
|
||||||
. '<div>' . ($value == 1 ? '{{ICON_ENABLED}}' : ($value === 'unchanged' ? '{{ICON_MIXED}}' : '{{ICON_DISABLED}}' )) . '</div>'
|
. '<div>' . ($value == 1 ? ' ' : ($value === 'unchanged' ? ' ' : ' ' )) . '</div>'
|
||||||
. '<input class="' . $class . '" type="radio" value=1 name="'
|
. '<input class="' . $class . '" type="radio" value=1 name="'
|
||||||
. $name . '" ' . ($value == 1 ? 'checked' : '') . ' ">On</input> '
|
. $name . '" ' . ($value == 1 ? 'checked' : '') . ' ">On</input> '
|
||||||
. '<input class="' . $class . '" type="radio" value=0 name="'
|
. '<input class="' . $class . '" type="radio" value=0 name="'
|
||||||
. $name . '" ' . ($value == 0 ? 'checked' : '') . ' ">Off</input> ';
|
. $name . '" ' . ($value == 0 ? 'checked' : '') . ' ">Off</input> ';
|
||||||
|
|
||||||
if ($value === 'unchanged') {
|
if ($value === 'unchanged') {
|
||||||
$xhtml = $xhtml . '<input class="' . $class . '" type="radio" value="unchanged" name="'
|
$xhtml = $xhtml . '<input class="' . $class . '" type="radio" value="unchanged" name="'
|
||||||
. $name . '" ' . 'checked "> Mixed </input>';
|
. $name . '" ' . 'checked "> Undefined </input>';
|
||||||
};
|
};
|
||||||
return $xhtml . '</div>';
|
return $xhtml . '</div>';
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,9 @@ class TriStateCheckbox extends Zend_Form_Element_Xhtml
|
|||||||
*/
|
*/
|
||||||
public $helper = 'formTriStateCheckbox';
|
public $helper = 'formTriStateCheckbox';
|
||||||
|
|
||||||
public function __construct($spec, $options = null)
|
public function __construct($name, $options = null)
|
||||||
{
|
{
|
||||||
parent::__construct($spec, $options);
|
parent::__construct($name, $options);
|
||||||
|
|
||||||
$this->triStateValidator = new TriStateValidator($this->patterns);
|
$this->triStateValidator = new TriStateValidator($this->patterns);
|
||||||
$this->addValidator($this->triStateValidator);
|
$this->addValidator($this->triStateValidator);
|
||||||
|
@ -19,6 +19,7 @@ class StyleSheet
|
|||||||
'css/icinga/widgets.less',
|
'css/icinga/widgets.less',
|
||||||
'css/icinga/pagination.less',
|
'css/icinga/pagination.less',
|
||||||
'css/icinga/monitoring-colors.less',
|
'css/icinga/monitoring-colors.less',
|
||||||
|
'css/icinga/selection-toolbar.less',
|
||||||
'css/icinga/login.less',
|
'css/icinga/login.less',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -278,6 +278,7 @@ class Monitoring_MultiController extends ActionController
|
|||||||
private function handleConfigurationForm(array $flags)
|
private function handleConfigurationForm(array $flags)
|
||||||
{
|
{
|
||||||
$this->view->form = $form = new MultiCommandFlagForm($flags);
|
$this->view->form = $form = new MultiCommandFlagForm($flags);
|
||||||
|
$this->view->formElements = $form->buildCheckboxes();
|
||||||
$form->setRequest($this->_request);
|
$form->setRequest($this->_request);
|
||||||
if ($form->isSubmittedAndValid()) {
|
if ($form->isSubmittedAndValid()) {
|
||||||
// TODO: Handle commands
|
// TODO: Handle commands
|
||||||
|
@ -103,11 +103,6 @@ class MultiCommandFlagForm extends Form {
|
|||||||
return $changed;
|
return $changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Extract the values from a set of items.
|
|
||||||
*
|
|
||||||
* @param array $items The items
|
|
||||||
*/
|
|
||||||
private function valuesFromObjects($items)
|
private function valuesFromObjects($items)
|
||||||
{
|
{
|
||||||
$values = array();
|
$values = array();
|
||||||
@ -142,6 +137,21 @@ class MultiCommandFlagForm extends Form {
|
|||||||
return array_merge($values, $old);
|
return array_merge($values, $old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function buildCheckboxes()
|
||||||
|
{
|
||||||
|
$checkboxes = array();
|
||||||
|
foreach ($this->flags as $flag => $description) {
|
||||||
|
$checkboxes[] = new TriStateCheckbox(
|
||||||
|
$flag,
|
||||||
|
array(
|
||||||
|
'label' => $description,
|
||||||
|
'required' => true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $checkboxes;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the multi flag form
|
* Create the multi flag form
|
||||||
*
|
*
|
||||||
@ -150,16 +160,9 @@ class MultiCommandFlagForm extends Form {
|
|||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$this->setName('form_flag_configuration');
|
$this->setName('form_flag_configuration');
|
||||||
foreach ($this->flags as $flag => $description) {
|
foreach ($this->buildCheckboxes() as $checkbox) {
|
||||||
$this->addElement(new TriStateCheckbox(
|
$this->addElement($checkbox);
|
||||||
$flag,
|
$old = new Zend_Form_Element_Hidden($checkbox->getName() . self::OLD_VALUE_MARKER);
|
||||||
array(
|
|
||||||
'label' => $description,
|
|
||||||
'required' => true
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
$old = new Zend_Form_Element_Hidden($flag . self::OLD_VALUE_MARKER);
|
|
||||||
$this->addElement($old);
|
$this->addElement($old);
|
||||||
}
|
}
|
||||||
$this->setSubmitLabel('Save Configuration');
|
$this->setSubmitLabel('Save Configuration');
|
||||||
|
@ -13,11 +13,8 @@ class Zend_View_Helper_SelectionToolbar extends Zend_View_Helper_Abstract
|
|||||||
public function selectionToolbar($type, $target = null)
|
public function selectionToolbar($type, $target = null)
|
||||||
{
|
{
|
||||||
if ($type == 'multi') {
|
if ($type == 'multi') {
|
||||||
return '<div class="selection-toolbar"> Select '
|
return '<div class="selection-toolbar">'
|
||||||
. '<a href="' . $target . '"> All </a>'
|
. '<a href="' . $target . '" data-base-target="_next"> Select All </a> </div>';
|
||||||
. '<a href="#"> None </a> </div>';
|
|
||||||
} else if ($type == 'single') {
|
|
||||||
return '<div class="selection-toolbar"> Select <a href="#"> None </a> </div>';
|
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,9 @@ $helper = $this->getHelper('MonitoringState');
|
|||||||
<div style="margin: 1em;" class="dontprint">
|
<div style="margin: 1em;" class="dontprint">
|
||||||
<!--<?= $this->filterBox ?>-->Sort by <?= $this->sortControl->render($this); ?>
|
<!--<?= $this->filterBox ?>-->Sort by <?= $this->sortControl->render($this); ?>
|
||||||
</div>
|
</div>
|
||||||
<!--<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/host',array( 'host' => '*' ))); ?>-->
|
|
||||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
|
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
|
||||||
|
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/host',array( 'host' => '*' ))); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@ -8,6 +8,7 @@ if (!$this->compact): ?>
|
|||||||
<!-- <?= $this->filterBox ?>-->
|
<!-- <?= $this->filterBox ?>-->
|
||||||
Sort by <?= $this->sortControl ?>
|
Sort by <?= $this->sortControl ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)); ?>
|
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,61 +1,35 @@
|
|||||||
<div>
|
<?php
|
||||||
<div class="panel-heading">
|
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
||||||
<span> <b> Comments </b> </span>
|
?>
|
||||||
<div class="pull-right">
|
|
||||||
<a rel="tooltip" title="Create new comments for all selected hosts or services" href="<?=
|
<tr class="newsection">
|
||||||
$this->href(
|
<th>
|
||||||
'monitoring/command/addcomment',
|
Comments
|
||||||
$this->target
|
</th>
|
||||||
);
|
<td>
|
||||||
?>" class="btn-common btn-small button">
|
There are <a href=" <?= $this->href(
|
||||||
<?= $this->icon('comment.png') ?>
|
'monitoring/list/comments',
|
||||||
|
array('comment_id' => implode(',', $this->comments))
|
||||||
|
);
|
||||||
|
?>"> <?= count($comments) ?> </a>
|
||||||
|
comments for the selected <?= $objectName ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a
|
||||||
|
href="<?= $this->href('monitoring/command/removecomment', $this->target); ?>"
|
||||||
|
>
|
||||||
|
<?= $this->icon('remove_petrol.png') ?> Remove Comments
|
||||||
|
</a> <br >
|
||||||
|
<a
|
||||||
|
href="<?= $this->href('monitoring/command/delaynotifications', $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
|
||||||
</a>
|
</a>
|
||||||
|
</td>
|
||||||
<a rel="tooltip" title="Send custom notifications for all selected hosts or services" href="<?=
|
</tr>
|
||||||
$this->href(
|
|
||||||
'monitoring/command/sendcustomnotification',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="btn-common btn-small button">
|
|
||||||
<?= $this->icon('notification.png') ?>"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<hr class="separator">
|
|
||||||
<div class="panel-body">
|
|
||||||
|
|
||||||
<div class="panel-row">
|
|
||||||
<?php if (count($comments) > 0) { ?>
|
|
||||||
<a href=" <?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/list/comments',
|
|
||||||
array(
|
|
||||||
'comment_id' => implode(',', $this->comments)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
?>">
|
|
||||||
There are <?= count($comments);?> comments assigned to the selected items.
|
|
||||||
</a>
|
|
||||||
<a href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/removecomment',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="button btn-common btn-small input-sm pull-right">
|
|
||||||
<?= $this->icon('remove.png') ?>"></i>
|
|
||||||
</a>
|
|
||||||
<?php } else { ?>
|
|
||||||
There are 0 comments assigned to the selected items.
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
<a rel="tooltip" title="Delay the noficiations on all selected hosts or services" href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/delaynotification',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="button btn-cta btn-common btn-half-wide">
|
|
||||||
Delay Notifications
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@ -1,10 +1,26 @@
|
|||||||
<div>
|
|
||||||
<div class="panel-heading">
|
<!--<?php echo $this->form->render($this); ?>-->
|
||||||
<span><b>Configuration</b></span>
|
|
||||||
</div>
|
<form>
|
||||||
<hr class="separator">
|
<?php foreach($this->form->getElements() as $name => $element):
|
||||||
<div class="panel-body">
|
if ($element instanceof \Icinga\Web\Form\Element\TriStateCheckbox):
|
||||||
Change configuration for <?= count($this->objects) ?> objects.
|
$element->setDecorators(array('ViewHelper'));
|
||||||
<?php echo $this->form->render($this); ?>
|
?>
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<th>
|
||||||
|
<?= $element->getLabel() ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<?= $element->render() ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<tr>
|
||||||
|
<td> <?= $element->render() ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
<form>
|
||||||
|
@ -1,49 +1,33 @@
|
|||||||
<div>
|
<?php
|
||||||
<div class="panel-heading">
|
$objectName = $this->is_service ? 'Services' : 'Hosts';
|
||||||
<b>Downtimes</b>
|
?>
|
||||||
|
|
||||||
<a rel="tooltip" title="Schedule downtimes for all selected hosts or services" href="<?=
|
<tr class="newsection">
|
||||||
$this->href(
|
<th>
|
||||||
'monitoring/command/scheduledowntime',
|
Downtimes
|
||||||
$this->target
|
</th>
|
||||||
);
|
<td>
|
||||||
?>" class="button btn-common btn-small input-sm pull-right">
|
<span> <?= count($downtimes) ?> </span> <?= $objectName ?> Selected items are currently in downtime.
|
||||||
<?= $this->icon('in_downtime.png') ?>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a
|
||||||
|
title="Schedule downtimes for all selected <?= $objectName ?>"
|
||||||
|
href="<?= $this->href('monitoring/command/scheduledowntime', $this->target); ?>"
|
||||||
|
>
|
||||||
|
<?= $this->icon('in_downtime_petrol.png') ?> Schedule Downtimes
|
||||||
|
</a> <br />
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="<?=$this->href('monitoring/command/removedowntime', $this->target); ?>"
|
||||||
|
>
|
||||||
|
<?= $this->icon('remove_petrol.png') ?> Remove Downtimes
|
||||||
|
</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>
|
</a>
|
||||||
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<hr class="separator" >
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="panel-row">
|
|
||||||
<?php if (count($downtimes) > 0) { ?>
|
|
||||||
<a href="
|
|
||||||
<?= $this->href(
|
|
||||||
'monitoring/list/downtimes',
|
|
||||||
array()
|
|
||||||
);?>
|
|
||||||
">
|
|
||||||
<?= count($downtimes); ?> Selected items are currently in downtime.
|
|
||||||
</a>
|
|
||||||
<a href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/removedowntime',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="button btn-common btn-small input-sm pull-right">
|
|
||||||
<?= $this->icon('remove.png') ?>
|
|
||||||
</a>
|
|
||||||
<?php } else { ?>
|
|
||||||
0 Selected items are currently in downtime.
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a rel="tooltip" title="Remove all acknowledgements from all selected hosts or services" href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/removeacknowledgement',
|
|
||||||
$target
|
|
||||||
);
|
|
||||||
?>" class="button btn-cta btn-common btn-wide">
|
|
||||||
Remove Acknowledgements
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@ -1,7 +1,35 @@
|
|||||||
<?php
|
<?php for ($i = 0; $i < count($objects) && $i < 5; $i++) {
|
||||||
/**
|
$object = $objects[$i]; ?>
|
||||||
* Created by PhpStorm.
|
<a href="<?php
|
||||||
* User: mjentsch
|
if ($this->is_service) {
|
||||||
* Date: 09.04.14
|
echo $this->href(
|
||||||
* Time: 15:29
|
'monitoring/show/service',
|
||||||
*/
|
array('host' => $object->host_name, 'service' => $object->service_description)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
echo $this->href(
|
||||||
|
'monitoring/show/host',
|
||||||
|
array('host' => $object->host_name)
|
||||||
|
);
|
||||||
|
}?>" >
|
||||||
|
<!-- <?= $object->host_name; ?> <?= isset($object->service_description) ? $object->service_description : '' ?> -->
|
||||||
|
<?php } ?> <?php
|
||||||
|
if (count($objects) > 5) {
|
||||||
|
$text = ' ' . (count($objects) - 5) . ' more ...';
|
||||||
|
} else {
|
||||||
|
$text = ' show all ... ';
|
||||||
|
}
|
||||||
|
if ($this->is_service) {
|
||||||
|
$link = 'monitoring/list/hosts';
|
||||||
|
$target = array(
|
||||||
|
'host' => $this->hostquery // implode(',', $hostnames)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$link = 'monitoring/list/services';
|
||||||
|
// TODO: Show multiple targets for services
|
||||||
|
$target = array(
|
||||||
|
'host' => $this->hostquery,
|
||||||
|
'service' => $this->servicequery
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?> <a href="<?= $this->href($link, $target); ?>"> <?= $text ?></a>
|
@ -1,93 +1,68 @@
|
|||||||
<?php
|
<?php
|
||||||
/** @var Zend_View_Helper_CommandForm $cf */
|
/** @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';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<tr>
|
||||||
<ul class="list-inline">
|
<th>
|
||||||
<?php
|
<?= $objectName ?>
|
||||||
for ($i = 0; $i < count($objects) && $i < 10; $i++) {
|
</th>
|
||||||
$object = $objects[$i];
|
<td>
|
||||||
?>
|
You have selected <?= count($objects) . ' ' . $objectName ?> .
|
||||||
<li>
|
</td>
|
||||||
<a href="<?php
|
<td>
|
||||||
if ($this->is_service) {
|
<a
|
||||||
echo $this->href(
|
href="<?=$this->href(
|
||||||
'monitoring/show/service',
|
'monitoring/command/reschedulenextcheck',
|
||||||
array(
|
array(
|
||||||
'host' => $object->host_name,
|
'host' => $this->target['host'],
|
||||||
'service' => $object->service_description
|
'service' => $this->target['service'],
|
||||||
)
|
'checktime' => time(),
|
||||||
);
|
'forcecheck' => '1'
|
||||||
} else {
|
)
|
||||||
echo $this->href(
|
); ?>"
|
||||||
'monitoring/show/host', array('host' => $object->host_name)
|
>
|
||||||
);
|
<?= $this->icon('refresh_petrol.png') ?> Recheck
|
||||||
}?>" >
|
</a> <br/>
|
||||||
<?= $object->host_name; ?>
|
<a href="<?= $this->href('monitoring/command/reschedulenextcheck', $this->target) ?>">
|
||||||
<?= isset($object->service_description) ? $object->service_description : '' ?>
|
<?= $this->icon('reschedule_petrol.png') ?> Reschedule
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</td>
|
||||||
<?php } ?>
|
</tr>
|
||||||
</ul>
|
|
||||||
<?php
|
|
||||||
if (count($objects) > 10) {
|
|
||||||
$text = ' and ' . (count($objects) - 10) . ' more ...';
|
|
||||||
} else {
|
|
||||||
$text = ' show all ...';
|
|
||||||
}
|
|
||||||
if ($this->is_service) {
|
|
||||||
$link = 'monitoring/list/hosts';
|
|
||||||
$target = array(
|
|
||||||
'host' => implode(',', $hostnames)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$link = 'monitoring/list/services';
|
|
||||||
// TODO: Show multiple targets for services
|
|
||||||
$target = array();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<a class="pull-right" href="<?= $this->href($link, $target); ?>"> <?= $text ?></a>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<div class="panel-row">
|
|
||||||
<a href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/reschedulenextcheck',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="button btn-cta btn-half-left">
|
|
||||||
Recheck
|
|
||||||
</a>
|
|
||||||
<a href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/reschedulenextcheck',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="button btn-cta btn-half-right">
|
|
||||||
Reschedule
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<tr>
|
||||||
The selected objects have <span class="badge"> <?= $this->problems ?> </span> service problems. <br /><br />
|
<th>
|
||||||
|
Problems
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
The <?= $objectName ?> have <span> <?= $this->problems ?> </span> problems.
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a
|
||||||
|
title="Schedule downtimes for all selected hosts"
|
||||||
|
href="<?= $this->href('monitoring/command/scheduledowntime', $this->target); ?>"
|
||||||
|
>
|
||||||
|
<?= $this->icon('in_downtime_petrol.png') ?> Schedule Downtimes
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<a rel="tooltip" title="Acknowledge all problems on the selected hosts or services" href="<?=
|
|
||||||
$this->href(
|
|
||||||
'monitoring/command/acknowledgeproblem',
|
|
||||||
$this->target
|
|
||||||
);
|
|
||||||
?>" class="button btn-cta btn-half-left">
|
|
||||||
Acknowledge Problems
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a rel="tooltip" title="Schedule downtimes for all selected hosts" href="<?=
|
<tr>
|
||||||
$this->href(
|
<th>
|
||||||
'monitoring/command/scheduledowntime',
|
Unhandled
|
||||||
$this->target
|
</th>
|
||||||
);
|
<td>
|
||||||
?>" class="button btn-cta btn-half-right">
|
<span> <?= count($this->unhandled) ?> </span> <?= $objectName ?> are unhandled.
|
||||||
Schedule Downtimes
|
</td>
|
||||||
</a>
|
<td>
|
||||||
</div>
|
<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
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
@ -8,30 +8,38 @@ $this->target = array(
|
|||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?= $this->tabs->render($this); ?>
|
<?= $this->tabs; ?>
|
||||||
<div>
|
|
||||||
|
|
||||||
<div class="panel-heading">
|
|
||||||
<b> Services </b> (<?= count($objects) ?> objects )
|
|
||||||
<div class="pull-right">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr class="separator" />
|
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<?= $this->render('multi/components/summary.phtml'); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="controls">
|
||||||
|
<h1> Summary for <?= count($objects) ?> services </h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->render('multi/components/comments.phtml'); ?>
|
<div class="content">
|
||||||
<?= $this->render('multi/components/downtimes.phtml'); ?>
|
<?= $this->render('multi/components/objectlist.phtml'); ?>
|
||||||
<?= $this->render('multi/components/configuration.phtml'); ?>
|
<h3> <?=$this->icon('servicegroup.png')?> Service State </h3>
|
||||||
|
|
||||||
|
<table class="avp newsection">
|
||||||
|
<tbody>
|
||||||
|
<?= $this->render('multi/components/summary.phtml'); ?>
|
||||||
|
<?= $this->render('multi/components/comments.phtml'); ?>
|
||||||
|
<?= $this->render('multi/components/downtimes.phtml'); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3> <?=$this->icon('configuration.png')?> Options </h3>
|
||||||
|
<table class="avp newsection">
|
||||||
|
<tbody>
|
||||||
|
<?= $this->render('multi/components/configuration.phtml') ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</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>
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
div.selection-toolbar {
|
||||||
|
float: right;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.selection-toolbar a {
|
||||||
|
color: #049baf
|
||||||
|
}
|
@ -26,7 +26,7 @@
|
|||||||
this.applyGlobalDefaults();
|
this.applyGlobalDefaults();
|
||||||
this.applyHandlers($('#layout'));
|
this.applyHandlers($('#layout'));
|
||||||
this.icinga.ui.prepareContainers();
|
this.icinga.ui.prepareContainers();
|
||||||
this.icinga.ui.prepareMultiselectTables();
|
this.icinga.ui.prepareMultiselectTables($(document));
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: What's this?
|
// TODO: What's this?
|
||||||
@ -306,10 +306,9 @@
|
|||||||
var icinga = self.icinga;
|
var icinga = self.icinga;
|
||||||
var $tr = $(this);
|
var $tr = $(this);
|
||||||
var $table = $tr.closest('table.multiselect');
|
var $table = $tr.closest('table.multiselect');
|
||||||
var data = $table.data('icinga-multiselect-data').split(',');
|
var data = $table.data('icinga-multiselect-data') && $table.data('icinga-multiselect-data').split(',');
|
||||||
var multisel = $table.hasClass('multiselect');
|
var multisel = $table.hasClass('multiselect');
|
||||||
var url = $table.data('icinga-multiselect-url');
|
var url = $table.data('icinga-multiselect-url');
|
||||||
var $trs, $target;
|
|
||||||
|
|
||||||
// When the selection points to a link, select the closest row
|
// When the selection points to a link, select the closest row
|
||||||
if ($tr.prop('tagName').toLowerCase() === 'a') {
|
if ($tr.prop('tagName').toLowerCase() === 'a') {
|
||||||
@ -323,11 +322,11 @@
|
|||||||
// link handled externally
|
// link handled externally
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!data) {
|
if (multisel && !data) {
|
||||||
icinga.logger.error('A table with multiselection must define the attribute "data-icinga-multiselect-data"');
|
icinga.logger.error('A table with multiselection must define the attribute "data-icinga-multiselect-data"');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!url) {
|
if (multisel && !url) {
|
||||||
icinga.logger.error('A table with multiselection must define the attribute "data-icinga-multiselect-url"');
|
icinga.logger.error('A table with multiselection must define the attribute "data-icinga-multiselect-url"');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -347,18 +346,22 @@
|
|||||||
icinga.ui.focusTable($table[0]);
|
icinga.ui.focusTable($table[0]);
|
||||||
|
|
||||||
// Update url
|
// Update url
|
||||||
$trs = $table.find('tr[href].active');
|
var $target = self.getLinkTargetFor($tr);
|
||||||
$target = self.getLinkTargetFor($tr);
|
if (multisel) {
|
||||||
if ($trs.length > 1) {
|
var $trs = $table.find('tr[href].active');
|
||||||
// display multiple rows
|
if ($trs.length > 1) {
|
||||||
var query = icinga.events.selectionToQuery($trs, data, icinga);
|
// display multiple rows
|
||||||
icinga.loader.loadUrl(url + '?' + query, $target);
|
var query = icinga.events.selectionToQuery($trs, data, icinga);
|
||||||
} else if ($trs.length === 1) {
|
icinga.loader.loadUrl(url + '?' + query, $target);
|
||||||
// display a single row
|
} else if ($trs.length === 1) {
|
||||||
icinga.loader.loadUrl($tr.attr('href'), $target);
|
// display a single row
|
||||||
|
icinga.loader.loadUrl($tr.attr('href'), $target);
|
||||||
|
} else {
|
||||||
|
// display nothing
|
||||||
|
icinga.loader.loadUrl('#');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// display nothing
|
icinga.loader.loadUrl($tr.attr('href'), $target);
|
||||||
icinga.loader.loadUrl('#');
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
@ -393,13 +393,17 @@
|
|||||||
* Replace SVG piecharts with jQuery-Sparkline
|
* Replace SVG piecharts with jQuery-Sparkline
|
||||||
*/
|
*/
|
||||||
$('.inlinepie', $resp).each(function(){
|
$('.inlinepie', $resp).each(function(){
|
||||||
var title = $(this).attr('title'),
|
var title = $(this).attr('title'),
|
||||||
style = $(this).attr('style'),
|
style = $(this).attr('style'),
|
||||||
values = $(this).data('icinga-values');
|
values = $(this).data('icinga-values'),
|
||||||
var html = '<div class="inlinepie" style="' + style + '" title="' + title + '">' + values + '</div>';
|
html = '<div class="inlinepie" style="' + style + '" title="' + title + '">' + values + '</div>';
|
||||||
$(this).replaceWith(html);
|
$(this).replaceWith(html);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make multiselection-tables not selectable.
|
||||||
|
*/
|
||||||
|
this.icinga.ui.prepareMultiselectTables($resp);
|
||||||
|
|
||||||
/* Should we try to fiddle with responses containing full HTML? */
|
/* Should we try to fiddle with responses containing full HTML? */
|
||||||
/*
|
/*
|
||||||
|
@ -198,12 +198,10 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.icinga.logger.error(
|
this.icinga.logger.error(
|
||||||
'Someone messed up our responsiveness hacks, html font-family is',
|
'Someone messed up our responsiveness hacks, html font-family is',
|
||||||
layout
|
layout
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user