Module: check_mk
Branch: master
Commit: 3b49a6b796c27b60f9743ee327e67d537da606c5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3b49a6b796c27b…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Dec 14 10:30:12 2018 +0100
6983 FIX lnx_thermal: Fix GUI warning about wrong parameter data type
This was a purely cosmetical error and did not affect the check logic
in any way.
CMK-1428
Change-Id: Idc6f7fa9c80b98a786520fc82655f5e0ed21b3b3
---
.werks/6983 | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/.werks/6983 b/.werks/6983
new file mode 100644
index 0000000..ae939a5
--- /dev/null
+++ b/.werks/6983
@@ -0,0 +1,14 @@
+Title: lnx_thermal: Fix GUI warning about wrong parameter data type
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1544779738
+
+This was a purely cosmetical error and did not affect the check logic
+in any way.
+
+CMK-1428
Module: check_mk
Branch: master
Commit: c681900629c9c6d10e9b10b9d376c1119edde0bc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c681900629c9c6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 6 18:07:44 2018 +0100
DCD: Connection executions can be triggered manually
There is an action button shown on the DCD connection WATO
page for each connection to trigger it's next execution as
soon as possible.
In addition:
* Moved DCD GUI tests to tests/unit/cmk/gui where they belong to
prevent issues with missing GUI specific fixtures
* Moved DCD specific fixtures to testlib.cee.dcd_tests to
make them available for the DCD and DCD GUI tests
Change-Id: I7663855b5ee6f491a9236d0fcbc01f10e9ad72bc
---
cmk/gui/plugins/wato/utils/simple_modes.py | 33 +++++++++++++++++----
web/htdocs/images/icon_dcd_execute.png | Bin 0 -> 4083 bytes
.../themes/facelift/images/icon_dcd_execute.png | Bin 0 -> 1338 bytes
3 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/cmk/gui/plugins/wato/utils/simple_modes.py b/cmk/gui/plugins/wato/utils/simple_modes.py
index ac595de..685c5fb 100644
--- a/cmk/gui/plugins/wato/utils/simple_modes.py
+++ b/cmk/gui/plugins/wato/utils/simple_modes.py
@@ -33,7 +33,7 @@ b) A edit mode which can be used to create and edit an object.
"""
import abc
-from typing import Optional, List, Type # pylint: disable=unused-import
+from typing import Optional, List, Type, Union, Text, Tuple # pylint: disable=unused-import
import cmk.gui.table as table
import cmk.gui.watolib as watolib
@@ -164,6 +164,19 @@ class SimpleListMode(SimpleWatoModeBase):
"""Shows the HTML code for the cells of an object row"""
raise NotImplementedError()
+ def _handle_custom_action(self, action):
+ # type: (str) -> Optional[Union[bool, Tuple[Optional[str], Text]]]
+ """Gives the mode the option to implement custom actions
+
+ This function is called when the action phase is triggered. The action name is given
+ with the _action HTTP variable. It is handed over as first argument to this function.
+
+ NOTE: The implementation needs to invalidate the transaction ID on it's own.
+
+ The "delete" action is automatically handled by the SimpleListMode implementation.
+ """
+ raise MKUserError("_action", _("The action '%s' is not implemented") % action)
+
def buttons(self):
global_buttons()
html.context_button(
@@ -174,9 +187,12 @@ class SimpleListMode(SimpleWatoModeBase):
if not html.transaction_valid():
return
- if not html.has_var("_delete"):
+ if not html.has_var("_action"):
return
+ if html.var("_action") != "delete":
+ return self._handle_custom_action(html.var("_action"))
+
confirm = wato_confirm(_("Confirm deletion"), self._delete_confirm_message())
if confirm is False:
return False
@@ -223,12 +239,17 @@ class SimpleListMode(SimpleWatoModeBase):
def _show_action_cell(self, ident):
table.cell(_("Actions"), css="buttons")
- edit_url = html.makeuri_contextless([("mode", self._mode_type.edit_mode_name()),
- ("ident", ident)])
+ edit_url = html.makeuri_contextless([
+ ("mode", self._mode_type.edit_mode_name()),
+ ("ident", ident),
+ ])
html.icon_button(edit_url, _("Edit this %s") % self._mode_type.name_singular(), "edit")
- delete_url = watolib.make_action_link([("mode", self._mode_type.list_mode_name()),
- ("_delete", ident)])
+ delete_url = watolib.make_action_link([
+ ("mode", self._mode_type.list_mode_name()),
+ ("_action", "delete"),
+ ("_delete", ident),
+ ])
html.icon_button(delete_url,
_("Delete this %s") % self._mode_type.name_singular(), "delete")
diff --git a/web/htdocs/images/icon_dcd_execute.png b/web/htdocs/images/icon_dcd_execute.png
new file mode 100644
index 0000000..5d4b3b5
Binary files /dev/null and b/web/htdocs/images/icon_dcd_execute.png differ
diff --git a/web/htdocs/themes/facelift/images/icon_dcd_execute.png b/web/htdocs/themes/facelift/images/icon_dcd_execute.png
new file mode 100644
index 0000000..358c3fd
Binary files /dev/null and b/web/htdocs/themes/facelift/images/icon_dcd_execute.png differ