diff options
author | Mārtiņš Tālbergs <martins.talbergs@zabbix.com> | 2020-07-17 13:39:34 +0300 |
---|---|---|
committer | Mārtiņš Tālbergs <martins.talbergs@zabbix.com> | 2020-07-17 14:04:05 +0300 |
commit | 6414ad8597ba33fe6d0fbb017eccf913a1bba08c (patch) | |
tree | 41000528438ff8cacb3621e6e138e6194e9569a8 /ui/graphs.php | |
parent | ab01d3c0ece150f5f37cbe914cb5413c976a5aea (diff) |
..F....... [ZBX-15117] fixed graph configuration with large amount of items
* commit '6080a51939c6ef256c382b4aaa1c77f68e7f0ab9':
..F....... [ZBX-15117] fixed default values
..F....... [ZBX-15117] fixed short item names in pie chart
..F....... [ZBX-15117] removed unused template evaluation
..F....... [ZBX-15117] removed unused variable
..F....... [ZBX-15117] removed duplicate ids
..F....... [ZBX-15117] shortened chart3 request URI
.D........ [ZBX-15117] updated change log entry
.D........ [ZBX-15117] added change log entry
..F....... [ZBX-15117] modifying request format on form submit
..F....... [ZBX-15117] split dynamic template into variants
..F....... [ZBX-15117] removed unused form parameter
..F....... [ZBX-15117] removed php-js mixed code
..F....... [ZBX-15117] removed dead code
(cherry picked from commit a3270835ae9a266d46424366e45a8e8b287c1645)
Conflicts:
ui/graphs.php
ui/include/views/configuration.graph.edit.php
ui/include/views/js/configuration.graph.edit.js.php
(cherry picked from commit dbe70ff4ed13b6999f10f45d80b54fc2f6a7267f)
Diffstat (limited to 'ui/graphs.php')
-rw-r--r-- | ui/graphs.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ui/graphs.php b/ui/graphs.php index 76bde4585eb..e0abd6c286c 100644 --- a/ui/graphs.php +++ b/ui/graphs.php @@ -95,7 +95,12 @@ if (isset($_REQUEST['yaxismax']) && zbx_empty($_REQUEST['yaxismax'])) { } check_fields($fields); -$_REQUEST['items'] = getRequest('items', []); +$gitems = []; +foreach (getRequest('items', []) as $gitem) { + $gitems[] = json_decode($gitem, true); +} + +$_REQUEST['items'] = $gitems; $_REQUEST['show_3d'] = getRequest('show_3d', 0); $_REQUEST['show_legend'] = getRequest('show_legend', 0); @@ -177,11 +182,9 @@ if (isset($_REQUEST['clone']) && isset($_REQUEST['graphid'])) { $_REQUEST['form'] = 'clone'; } elseif (hasRequest('add') || hasRequest('update')) { - $items = getRequest('items', []); - // remove passing "gitemid" to API if new items added via pop-up - foreach ($items as &$item) { - if (!$item['gitemid']) { + foreach ($gitems as &$item) { + if (array_key_exists('gitemid', $item) && !$item['gitemid']) { unset($item['gitemid']); } } @@ -204,7 +207,7 @@ elseif (hasRequest('add') || hasRequest('update')) { 'show_3d' => getRequest('show_3d', 0), 'percent_left' => getRequest('percent_left', 0), 'percent_right' => getRequest('percent_right', 0), - 'gitems' => $items + 'gitems' => $gitems ]; DBstart(); @@ -585,7 +588,7 @@ elseif (isset($_REQUEST['form'])) { $data['percent_left'] = 0; $data['percent_right'] = 0; $data['visible'] = getRequest('visible'); - $data['items'] = getRequest('items', []); + $data['items'] = $gitems; $data['discover'] = getRequest('discover', DB::getDefault('graphs', 'discover')); $data['templates'] = []; |