Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Mon 3570 filter status #7345

Merged
merged 6 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion www/include/core/header/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ function microtime_float()
if ($a) {
$args .= '&';
}
$args .= "$key=$value";
if (is_string($value)) {
$args .= "{$key}={$value}";
}
$a++;
}
$args .= "'";
Expand Down
30 changes: 17 additions & 13 deletions www/include/monitoring/status/Services/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ function setO(_i) {
$form->setDefaults(array('statusFilter' => $_SESSION['monitoring_service_status_filter']));
$sDefaultOrder = "1";
}
$defaultStatusFilter = $_GET['statusFilter'] ?? '';
$defaultStatusService = $_GET['statusService'] ?? '';

$form->addElement(
'select',
Expand Down Expand Up @@ -524,36 +526,38 @@ function updateSelect() {
});

function preInit() {
_keyPrefix = '<?php echo $keyPrefix; ?>';
_sid = '<?php echo $sid ?>';
_tm = <?php echo $tM ?>;
_o = '<?php echo $o; ?>';
_sDefaultOrder = '<?php echo $sDefaultOrder; ?>';
sSetOrderInMemory = '<?php echo $sSetOrderInMemory; ?>';
_keyPrefix = '<?= $keyPrefix; ?>';
_sid = '<?= $sid ?>';
_tm = <?= $tM ?>;
_o = '<?= $o; ?>';
_defaultStatusFilter = '<?= $defaultStatusFilter; ?>';
_defaultStatusService = '<?= $defaultStatusService; ?>';
_sDefaultOrder = '<?= $sDefaultOrder; ?>';
sSetOrderInMemory = '<?= $sSetOrderInMemory; ?>';

if (_defaultStatusService !== '') {
jQuery("#statusService option[value='" + _defaultStatusService + "']").prop('selected', true);
}

if (_sDefaultOrder == "0") {
if (_o == 'svc') {
jQuery("#statusService option[value='svc']").prop('selected', true);
jQuery("#statusFilter option[value='']").prop('selected', true);
} else if (_o == 'svc_ok') {
jQuery("#statusService option[value='svc']").prop('selected', true);
jQuery("#statusFilter option[value='ok']").prop('selected', true);
} else if (_o == 'svc_warning') {
jQuery("#statusService option[value='svc']").prop('selected', true);
jQuery("#statusFilter option[value='warning']").prop('selected', true);
} else if (_o == 'svc_critical') {
jQuery("#statusService option[value='svc']").prop('selected', true);
jQuery("#statusFilter option[value='critical']").prop('selected', true);
} else if (_o == 'svc_unknown') {
jQuery("#statusService option[value='svc']").prop('selected', true);
jQuery("#statusFilter option[value='unknown']").prop('selected', true);
} else if (_o == 'svc_pending') {
jQuery("#statusService option[value='svc']").prop('selected', true);
jQuery("#statusFilter option[value='pending']").prop('selected', true);
} else {
jQuery("#statusService option[value='svc_unhandled']").prop('selected', true);
jQuery("#statusFilter option[value='']").prop('selected', true);
}
if (_defaultStatusFilter != '') {
jQuery("#statusFilter option[value='" + _defaultStatusFilter + "']").prop('selected', true);
}
}
filterStatus(document.getElementById('statusFilter').value, 1);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
<form name='form'>
<input name="p" value="{$p}" type="hidden">
<input name="o" value="svc" type="hidden">
<table class="ajaxOption table">
<tr>
<th colspan="6"><h5>{$filters}</h5></th>
Expand Down Expand Up @@ -45,7 +44,6 @@
<tr class="ToolbarTR">
<td>
<span class="consol_button">{$form.o1.html}</span>
<input name="p" value="{$p}" type="hidden">

<div class="Toolbar_TDSelectAction_Top">
<span class="consol_button">
Expand Down