Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ui/app
diff options
context:
space:
mode:
authorGregory Chalenko <gregory.chalenko@zabbix.com>2020-09-04 12:59:42 +0300
committerGregory Chalenko <gregory.chalenko@zabbix.com>2020-09-04 12:59:42 +0300
commit13fed375aca28268fc943d4b6738c9da0f4dba23 (patch)
tree6396230a39bcea709434f645dbbd8c0ff4fac163 /ui/app
parent2f261f6f7d8430cfd93086fa0e1f803b78c886d9 (diff)
..F....... [ZBXNEXT-710] fixed monitoring.hosts kiosk mode; fixed undefined indexes in input; added modified status to tabfilter when selected filter is updated from user input
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/controllers/CControllerHost.php2
-rw-r--r--ui/app/controllers/CControllerProblem.php4
-rw-r--r--ui/app/views/js/monitoring.host.view.js.php25
-rw-r--r--ui/app/views/monitoring.host.view.php3
4 files changed, 21 insertions, 13 deletions
diff --git a/ui/app/controllers/CControllerHost.php b/ui/app/controllers/CControllerHost.php
index 6d6b5f874bd..f07dbe47801 100644
--- a/ui/app/controllers/CControllerHost.php
+++ b/ui/app/controllers/CControllerHost.php
@@ -362,7 +362,7 @@ abstract class CControllerHost extends CController {
* @return array
*/
protected function cleanInput(array $input): array {
- if ($input['tags']) {
+ if (array_key_exists('tags', $input) && $input['tags']) {
$input['tags'] = array_filter($input['tags'], function($tag) {
return $tag['tag'] !== '' && $tag['value'] !== '';
});
diff --git a/ui/app/controllers/CControllerProblem.php b/ui/app/controllers/CControllerProblem.php
index b86ef23eca0..bdb69d39a91 100644
--- a/ui/app/controllers/CControllerProblem.php
+++ b/ui/app/controllers/CControllerProblem.php
@@ -153,13 +153,13 @@ abstract class CControllerProblem extends CController {
* @return array
*/
protected function cleanInput(array $input): array {
- if ($input['tags']) {
+ if (array_key_exists('tags', $input) && $input['tags']) {
$input['tags'] = array_filter($input['tags'], function($tag) {
return $tag['tag'] !== '' && $tag['value'] !== '';
});
}
- if ($input['inventory']) {
+ if (array_key_exists('inventory', $input) && $input['inventory']) {
$input['inventory'] = array_filter($input['inventory'], function($inventory) {
return $inventory['value'] !== '';
});
diff --git a/ui/app/views/js/monitoring.host.view.js.php b/ui/app/views/js/monitoring.host.view.js.php
index ffe2adcbda2..68ee7899fdc 100644
--- a/ui/app/views/js/monitoring.host.view.js.php
+++ b/ui/app/views/js/monitoring.host.view.js.php
@@ -26,20 +26,25 @@
<script type="text/javascript">
jQuery(function($) {
function hostPage() {
+ let filter_options = <?= json_encode($data['filter_options']) ?>;
+
this.refresh_url = '<?= $data['refresh_url'] ?>';
this.refresh_interval = <?= $data['refresh_interval'] ?>;
this.running = false;
this.timeout = null;
- this.refresh_counters = this.createCountersRefresh(1);
- this.filter = new CTabFilter($('#monitoring_hosts_filter')[0], <?= json_encode($data['filter_options']) ?>);
- this.filter.on(TABFILTER_EVENT_URLSET, (ev) => {
- let url = new Curl('', false);
-
- url.setArgument('action', 'host.view.refresh');
- this.refresh_url = url.getUrl();
- this.stop();
- this.start();
- });
+
+ if (filter_options) {
+ this.refresh_counters = this.createCountersRefresh(1);
+ this.filter = new CTabFilter($('#monitoring_hosts_filter')[0], filter_options);
+ this.filter.on(TABFILTER_EVENT_URLSET, (ev) => {
+ let url = new Curl('', false);
+
+ url.setArgument('action', 'host.view.refresh');
+ this.refresh_url = url.getUrl();
+ this.stop();
+ this.start();
+ });
+ }
}
hostPage.prototype = {
diff --git a/ui/app/views/monitoring.host.view.php b/ui/app/views/monitoring.host.view.php
index 18932cd71af..0c13e605124 100644
--- a/ui/app/views/monitoring.host.view.php
+++ b/ui/app/views/monitoring.host.view.php
@@ -60,6 +60,9 @@ if ($web_layout_mode == ZBX_LAYOUT_NORMAL) {
$data['filter_options'] = $filter->options;
$widget->addItem($filter);
}
+else {
+ $data['filter_options'] = null;
+}
$widget->addItem((new CForm())->setName('host_view')->addClass('is-loading'));
$widget->show();