Skip to content

Commit

Permalink
added UI filter option for disabling tile scaling (issue #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbxwallboard committed Oct 16, 2020
1 parent 0e27d7a commit 5af2e83
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions module/zbxwallboard/views/monitoring.wallboard.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
** - replaced action name "problem.view" by "zbxwallboard.view"
**/

/*
** Workaround for reused CControllerProblemView
** no nice way to add a custom filter option from own classes
**/

// default
$tile_scaling = True;
if (array_key_exists('disable_tile_scaling',$_REQUEST)) {
if ($_REQUEST['disable_tile_scaling'] == 1) {
$tile_scaling = False;
}
}

$options = [
'resourcetype' => SCREEN_RESOURCE_PROBLEM,
'mode' => SCREEN_MODE_JS,
Expand Down Expand Up @@ -72,7 +85,9 @@
$this->addJsFile('layout.mode.js');

$this->includeJsFile('monitoring.wallboard.view.zbx.js.php');
$this->includeJsFile('monitoring.wallboard.view.js.php');
if ($tile_scaling === True) {
$this->includeJsFile('monitoring.wallboard.view.scaling.js.php');
}

$this->enableLayoutModes();
$web_layout_mode = $this->getLayoutMode();
Expand Down Expand Up @@ -261,8 +276,12 @@
(new CLabel(_('Show unacknowledged only'), 'filter_unacknowledged'))
->addClass(ZBX_STYLE_SECOND_COLUMN_LABEL),
(new CCheckBox('filter_unacknowledged'))
->setChecked($data['filter']['unacknowledged'] == 1)
->setChecked($data['filter']['unacknowledged'] == 1),
]))->addClass(ZBX_STYLE_TABLE_FORMS_SECOND_COLUMN)
])
->addRow(_('Disable tile scaling'), [
(new CCheckBox('disable_tile_scaling'))
->setChecked($tile_scaling == False)
]);

$filter = (new CFilter((new CUrl('zabbix.php'))->setArgument('action', 'zbxwallboard.view')))
Expand Down

0 comments on commit 5af2e83

Please sign in to comment.