Module: check_mk
Branch: master
Commit: 11e1aeed71e5c3efd678af51f6d79c56bef432c0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11e1aeed71e5c3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 7 17:34:52 2018 +0200
Fixed merge issues and other problems in recent commits
Change-Id: I33baf1dfbd8fb3f2298cc152083f77b54f3c749d
---
cmk/gui/plugins/sidebar/tactical_overview.py | 8 ++++----
cmk/gui/sidebar.py | 12 ++----------
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/cmk/gui/plugins/sidebar/tactical_overview.py
b/cmk/gui/plugins/sidebar/tactical_overview.py
index 729a09b..328cd30 100644
--- a/cmk/gui/plugins/sidebar/tactical_overview.py
+++ b/cmk/gui/plugins/sidebar/tactical_overview.py
@@ -155,14 +155,14 @@ class TacticalOverviewSnapin(CustomizableSidebarSnapin):
def _show_rows(self):
rows = self._get_rows()
- if bool(r for r in rows if r.stats is None):
+ if bool([r for r in rows if r.stats is None]):
html.center(_("No data from any site"))
return
html.open_table(class_=["content_center",
"tacticaloverview"], cellspacing=2, cellpadding=0, border=0)
show_stales = self.parameters()["show_stale"] and
config.user.may("general.see_stales_in_tactical_overview")
- has_stale_objects = bool(r for r in rows if r.what != "events" and
r.stats[-1])
+ has_stale_objects = bool([r for r in rows if r.what != "events" and
r.stats[-1]])
for row in rows:
if row.what == "events":
@@ -423,7 +423,7 @@ class TacticalOverviewSnapin(CustomizableSidebarSnapin):
if not self.parameters()["show_failed_notifications"]:
return
- failed_notifications = self._get_failed_notification_stats()[0]
+ failed_notifications = self._get_failed_notification_stats()
if not failed_notifications:
return
@@ -445,7 +445,7 @@ class TacticalOverviewSnapin(CustomizableSidebarSnapin):
return notifications.load_failed_notifications(
after=notifications.acknowledged_time(),
stat_only=True,
- )
+ )[0]
except livestatus.MKLivestatusNotFoundError:
return None
diff --git a/cmk/gui/sidebar.py b/cmk/gui/sidebar.py
index c075bf1..dd23e93 100644
--- a/cmk/gui/sidebar.py
+++ b/cmk/gui/sidebar.py
@@ -428,7 +428,7 @@ class SidebarRenderer(object):
html.open_div(id_="snapin_container_%s" % name,
class_="snapin")
self._render_snapin_styles(snapin_instance)
# When not permitted to open/close snapins, the snapins are always opened
- if snapin.visibility == SnapinVisibility.OPEN or not
config.user.may("general.configure_sidebar"):
+ if snapin.visible == SnapinVisibility.OPEN or not
config.user.may("general.configure_sidebar"):
style = None
minimaxi = "mini"
else:
@@ -445,15 +445,7 @@ class SidebarRenderer(object):
"onmousedown" :
"snapinStartDrag(event)",
"onmouseup" :
"snapinStopDrag(event)"}
- html.open_div(class_=["head", snapin.visibility.value],
**head_actions)
-
- if config.user.may("general.configure_sidebar"):
- # Icon for mini/maximizing
- html.open_div(class_="minisnapin")
- html.icon_button(url=None, help=_("Toggle this snapin"),
icon="%ssnapin" % minimaxi,
- onclick="toggle_sidebar_snapin(this,
'%s')" % toggle_url)
-
- html.open_div(class_=["head", snapin.visibility.value],
**head_actions)
+ html.open_div(class_=["head", snapin.visible.value], **head_actions)
if config.user.may("general.configure_sidebar"):
# Icon for mini/maximizing