diff options
author | Alexander Shubin <aleksandrs.subins@zabbix.com> | 2022-11-07 12:14:03 +0300 |
---|---|---|
committer | Alexander Shubin <aleksandrs.subins@zabbix.com> | 2022-11-07 12:14:03 +0300 |
commit | 41881dfdfdccd2c52684741af17371eb7788ba0c (patch) | |
tree | 7ea2b9d02e6fd421f5dd6e9dbfb5c88530be60a3 /ui | |
parent | c469a52281a144968e7d7c26391d6308d7043fac (diff) |
..F....... [ZBXNEXT-7469] fixed default widget view controller
Diffstat (limited to 'ui')
27 files changed, 129 insertions, 7 deletions
diff --git a/ui/app/controllers/CControllerDashboardWidgetView.php b/ui/app/controllers/CControllerDashboardWidgetView.php index f589e96f726..5e19b86295c 100644 --- a/ui/app/controllers/CControllerDashboardWidgetView.php +++ b/ui/app/controllers/CControllerDashboardWidgetView.php @@ -26,7 +26,7 @@ use Zabbix\Widgets\CWidgetForm; /** * Class containing methods for operations with widgets. */ -abstract class CControllerDashboardWidgetView extends CController { +class CControllerDashboardWidgetView extends CController { protected ?CWidget $widget; protected CWidgetForm $form; @@ -104,4 +104,13 @@ abstract class CControllerDashboardWidgetView extends CController { protected function getForm(): CWidgetForm { return $this->form; } + + protected function doAction(): void { + $this->setResponse(new CControllerResponseData([ + 'name' => $this->getInput('name', $this->widget->getName()), + 'user' => [ + 'debug_mode' => $this->getDebugMode() + ] + ])); + } } diff --git a/ui/include/classes/core/CWidget.php b/ui/include/classes/core/CWidget.php index 9824972d19c..f0e2b136680 100644 --- a/ui/include/classes/core/CWidget.php +++ b/ui/include/classes/core/CWidget.php @@ -21,7 +21,8 @@ namespace Zabbix\Core; -use CControllerDashboardWidgetEdit; +use CControllerDashboardWidgetEdit, + CControllerDashboardWidgetView; use Zabbix\Widgets\CWidgetForm; @@ -74,7 +75,7 @@ class CWidget extends CModule { ]; $actions['widget.'.$this->getId().'.view'] += [ - 'class' => 'WidgetView', + 'class' => CControllerDashboardWidgetView::class, 'view' => 'widget.view', 'layout' => 'layout.widget' ]; diff --git a/ui/widgets/actionlog/manifest.json b/ui/widgets/actionlog/manifest.json index d7c59e5f60a..c9c9c77e791 100644 --- a/ui/widgets/actionlog/manifest.json +++ b/ui/widgets/actionlog/manifest.json @@ -5,5 +5,10 @@ "name": "Action log", "namespace": "ActionLog", "version": "1.0", - "author": "Zabbix SIA" + "author": "Zabbix SIA", + "actions": { + "widget.actionlog.view": { + "class": "WidgetView" + } + } } diff --git a/ui/widgets/clock/manifest.json b/ui/widgets/clock/manifest.json index 9bd304f5c83..98ed4984247 100644 --- a/ui/widgets/clock/manifest.json +++ b/ui/widgets/clock/manifest.json @@ -15,6 +15,11 @@ "js_class": "CWidgetClock", "refresh_rate": 900 }, + "actions": { + "widget.clock.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/dataover/manifest.json b/ui/widgets/dataover/manifest.json index 2d52fda7364..4336519af84 100644 --- a/ui/widgets/dataover/manifest.json +++ b/ui/widgets/dataover/manifest.json @@ -5,5 +5,10 @@ "name": "Data overview", "namespace": "DataOver", "version": "1.0", - "author": "Zabbix SIA" + "author": "Zabbix SIA", + "actions": { + "widget.dataover.view": { + "class": "WidgetView" + } + } } diff --git a/ui/widgets/discovery/manifest.json b/ui/widgets/discovery/manifest.json index ccd3eef7e4c..c38f24500d1 100644 --- a/ui/widgets/discovery/manifest.json +++ b/ui/widgets/discovery/manifest.json @@ -11,5 +11,10 @@ "width": 6, "height": 3 } + }, + "actions": { + "widget.discovery.view": { + "class": "WidgetView" + } } } diff --git a/ui/widgets/favgraphs/manifest.json b/ui/widgets/favgraphs/manifest.json index 18e13ed26d3..4e2d82cbc1d 100644 --- a/ui/widgets/favgraphs/manifest.json +++ b/ui/widgets/favgraphs/manifest.json @@ -12,5 +12,10 @@ "height": 3 }, "refresh_rate": 900 + }, + "actions": { + "widget.favgraphs.view": { + "class": "WidgetView" + } } } diff --git a/ui/widgets/favmaps/manifest.json b/ui/widgets/favmaps/manifest.json index 3ea016df3de..ed5a7b5a358 100644 --- a/ui/widgets/favmaps/manifest.json +++ b/ui/widgets/favmaps/manifest.json @@ -12,5 +12,10 @@ "height": 3 }, "refresh_rate": 900 + }, + "actions": { + "widget.favmaps.view": { + "class": "WidgetView" + } } } diff --git a/ui/widgets/geomap/manifest.json b/ui/widgets/geomap/manifest.json index 0de69c9350a..779a57b3b94 100644 --- a/ui/widgets/geomap/manifest.json +++ b/ui/widgets/geomap/manifest.json @@ -9,6 +9,11 @@ "widget": { "js_class": "CWidgetGeoMap" }, + "actions": { + "widget.geomap.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/graph/manifest.json b/ui/widgets/graph/manifest.json index 678aa28c550..269ccf23bab 100644 --- a/ui/widgets/graph/manifest.json +++ b/ui/widgets/graph/manifest.json @@ -11,6 +11,11 @@ "js_class": "CWidgetGraph", "use_time_selector": true }, + "actions": { + "widget.graph.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/graphprototype/manifest.json b/ui/widgets/graphprototype/manifest.json index ae1feb40df3..407b773ac6d 100644 --- a/ui/widgets/graphprototype/manifest.json +++ b/ui/widgets/graphprototype/manifest.json @@ -17,6 +17,7 @@ }, "actions": { "widget.graphprototype.view": { + "class": "WidgetView", "layout": "layout.json", "view": null } diff --git a/ui/widgets/hostavail/manifest.json b/ui/widgets/hostavail/manifest.json index c900192643e..5a0e18197cc 100644 --- a/ui/widgets/hostavail/manifest.json +++ b/ui/widgets/hostavail/manifest.json @@ -14,6 +14,11 @@ }, "refresh_rate": 900 }, + "actions": { + "widget.hostavail.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/item/manifest.json b/ui/widgets/item/manifest.json index 1d3ec5853d7..76e019819b4 100644 --- a/ui/widgets/item/manifest.json +++ b/ui/widgets/item/manifest.json @@ -14,6 +14,11 @@ }, "js_class": "CWidgetItem" }, + "actions": { + "widget.item.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/map/manifest.json b/ui/widgets/map/manifest.json index 78f6cd2d973..14254a92e2d 100644 --- a/ui/widgets/map/manifest.json +++ b/ui/widgets/map/manifest.json @@ -14,6 +14,11 @@ "js_class": "CWidgetMap", "refresh_rate": 900 }, + "actions": { + "widget.map.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/navtree/Widget.php b/ui/widgets/navtree/Widget.php index 80bb2f455cc..179902bcc61 100644 --- a/ui/widgets/navtree/Widget.php +++ b/ui/widgets/navtree/Widget.php @@ -36,7 +36,7 @@ class Widget extends CWidget { return [ 'class.widget.js' => [ 'Add' => _s('Add'), - 'Add child element' => _s('Add child elementsssss'), + 'Add child element' => _s('Add child elements'), 'Add multiple maps' => _s('Add multiple maps'), 'Apply' => _s('Apply'), 'Cancel' => _s('Cancel'), diff --git a/ui/widgets/navtree/manifest.json b/ui/widgets/navtree/manifest.json index c61b253e2d7..59bdf4d0e30 100644 --- a/ui/widgets/navtree/manifest.json +++ b/ui/widgets/navtree/manifest.json @@ -7,6 +7,9 @@ "version": "1.0", "author": "Zabbix SIA", "actions": { + "widget.navtree.view": { + "class": "WidgetView" + }, "widget.navtree.item.edit": { "class": "NavTreeItemEdit", "view": "navtreeitem.edit", diff --git a/ui/widgets/plaintext/manifest.json b/ui/widgets/plaintext/manifest.json index 0a67be5aea9..35344bbdc8c 100644 --- a/ui/widgets/plaintext/manifest.json +++ b/ui/widgets/plaintext/manifest.json @@ -12,5 +12,10 @@ "width": 6, "height": 3 } + }, + "actions": { + "widget.plaintext.view": { + "class": "WidgetView" + } } } diff --git a/ui/widgets/problemhosts/manifest.json b/ui/widgets/problemhosts/manifest.json index 64e49e8a263..3ec6c895b77 100644 --- a/ui/widgets/problemhosts/manifest.json +++ b/ui/widgets/problemhosts/manifest.json @@ -5,5 +5,10 @@ "name": "Problem hosts", "namespace": "ProblemHosts", "version": "1.0", - "author": "Zabbix SIA" + "author": "Zabbix SIA", + "actions": { + "widget.problemhosts.view": { + "class": "WidgetView" + } + } } diff --git a/ui/widgets/problems/manifest.json b/ui/widgets/problems/manifest.json index 163736d87a9..cf2b53558e7 100644 --- a/ui/widgets/problems/manifest.json +++ b/ui/widgets/problems/manifest.json @@ -9,6 +9,11 @@ "widget": { "js_class": "CWidgetProblems" }, + "actions": { + "widget.problems.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/problemsbysv/manifest.json b/ui/widgets/problemsbysv/manifest.json index 7ece0b1b02d..a9f29a70faf 100644 --- a/ui/widgets/problemsbysv/manifest.json +++ b/ui/widgets/problemsbysv/manifest.json @@ -9,6 +9,11 @@ "widget": { "js_class": "CWidgetProblemsBySv" }, + "actions": { + "widget.problemsbysv.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/slareport/manifest.json b/ui/widgets/slareport/manifest.json index 978ee685497..88099d3b193 100644 --- a/ui/widgets/slareport/manifest.json +++ b/ui/widgets/slareport/manifest.json @@ -8,5 +8,10 @@ "author": "Zabbix SIA", "widget": { "refresh_rate": 0 + }, + "actions": { + "widget.slareport.view": { + "class": "WidgetView" + } } } diff --git a/ui/widgets/svggraph/manifest.json b/ui/widgets/svggraph/manifest.json index db64bfc347d..fb57b270647 100644 --- a/ui/widgets/svggraph/manifest.json +++ b/ui/widgets/svggraph/manifest.json @@ -9,6 +9,11 @@ "widget": { "js_class": "CWidgetSvgGraph" }, + "actions": { + "widget.svggraph.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/systeminfo/manifest.json b/ui/widgets/systeminfo/manifest.json index ec77d9e7503..6d295a82d4b 100644 --- a/ui/widgets/systeminfo/manifest.json +++ b/ui/widgets/systeminfo/manifest.json @@ -8,5 +8,10 @@ "author": "Zabbix SIA", "widget": { "refresh_rate": 900 + }, + "actions": { + "widget.systeminfo.view": { + "class": "WidgetView" + } } } diff --git a/ui/widgets/tophosts/manifest.json b/ui/widgets/tophosts/manifest.json index 6ccb8b33cd2..6c5a3588431 100644 --- a/ui/widgets/tophosts/manifest.json +++ b/ui/widgets/tophosts/manifest.json @@ -7,6 +7,9 @@ "version": "1.0", "author": "Zabbix SIA", "actions": { + "widget.tophosts.view": { + "class": "WidgetView" + }, "widget.tophosts.column.edit": { "class": "ColumnEdit", "view": "column.edit", diff --git a/ui/widgets/trigover/manifest.json b/ui/widgets/trigover/manifest.json index 7579d58cb4f..2d5d8790dfc 100644 --- a/ui/widgets/trigover/manifest.json +++ b/ui/widgets/trigover/manifest.json @@ -9,6 +9,11 @@ "widget": { "js_class": "CWidgetTrigerOver" }, + "actions": { + "widget.trigover.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/url/manifest.json b/ui/widgets/url/manifest.json index 89fae2d5c34..59136ce0320 100644 --- a/ui/widgets/url/manifest.json +++ b/ui/widgets/url/manifest.json @@ -11,6 +11,11 @@ "template_support": true, "refresh_rate": 0 }, + "actions": { + "widget.url.view": { + "class": "WidgetView" + } + }, "assets": { "js": ["class.widget.js"] } diff --git a/ui/widgets/web/manifest.json b/ui/widgets/web/manifest.json index b25bf093139..590188825a3 100644 --- a/ui/widgets/web/manifest.json +++ b/ui/widgets/web/manifest.json @@ -11,5 +11,10 @@ "width": 6, "height": 3 } + }, + "actions": { + "widget.web.view": { + "class": "WidgetView" + } } } |