Module: check_mk
Branch: master
Commit: f42b86d71f56929d44edb5b39ba7566ca4bf340c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f42b86d71f5692…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 16 02:26:26 2013 +0200
Display site-globals button only for replication slaves
---
web/htdocs/wato.py | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index f718cb8..144c8c0 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6859,14 +6859,15 @@ def mode_sites(phase):
table.row()
# Buttons
edit_url = make_link([("mode", "edit_site"),
("edit", id)])
- globals_url = make_link([("mode", "edit_site_globals"),
("site", id)])
clone_url = make_link([("mode", "edit_site"),
("clone", id)])
delete_url = html.makeactionuri([("_delete", id)])
table.cell(_("Actions"), css="buttons")
html.icon_button(edit_url, _("Properties"), "edit")
- html.icon_button(globals_url, _("Site-specific global configuration"),
"configuration")
html.icon_button(clone_url, _("Clone this connection in order to create a
new one"), "clone")
html.icon_button(delete_url, _("Delete"), "delete")
+ if site.get("replication"):
+ globals_url = make_link([("mode", "edit_site_globals"),
("site", id)])
+ html.icon_button(globals_url, _("Site-specific global
configuration"), "configuration")
# Site-ID
table.cell(_("Site-ID"), id)
@@ -7023,6 +7024,13 @@ def mode_edit_site(phase):
siteid = html.var("edit") # missing -> new site
cloneid = html.var("clone")
new = siteid == None
+ if cloneid:
+ site = sites[cloneid]
+ elif new:
+ site = {}
+ else:
+ site = sites.get(siteid, {})
+
if phase == "title":
if new:
return _("Create new site connection")
@@ -7031,17 +7039,10 @@ def mode_edit_site(phase):
elif phase == "buttons":
html.context_button(_("All Sites"), make_link([("mode",
"sites")]), "back")
- if not new:
+ if not new and site.get("replication"):
html.context_button(_("Site-Globals"),
make_link([("mode", "edit_site_globals"), ("site",
siteid)]), "configuration")
return
- if cloneid:
- site = sites[cloneid]
- elif new:
- site = {}
- else:
- site = sites.get(siteid, {})
-
vs_tcp_port = Tuple(
title = _("TCP Port to connect to"),
orientation = "float",