Module: check_mk
Branch: master
Commit: dfea1c33b8172194a4866d49e4e835baf9f838e0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dfea1c33b81721…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 11 21:16:34 2013 +0200
Multisite connection: new button for cloning a connection
---
ChangeLog | 1 +
web/htdocs/wato.py | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 694b7fd..9a16f9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
WATO:
* Bulk inventory: speed up by use of cache files and doing stuff in
groups of e.g. 10 hosts at once
+ * Multisite connection: new button for cloning a connection
Checks & Agents:
* Linux agent RPM: remove dependency to package "time". That package
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 7507765..6f795ec 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6825,9 +6825,11 @@ def mode_sites(phase):
table.row()
# Buttons
edit_url = make_link([("mode", "edit_site"),
("edit", 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(clone_url, _("Clone this connection in order to create a
new one"), "clone")
html.icon_button(delete_url, _("Delete"), "delete")
# Site-ID
@@ -6898,7 +6900,8 @@ def mode_sites(phase):
def mode_edit_site(phase):
sites = load_sites()
- siteid = html.var("edit", None) # missing -> new site
+ siteid = html.var("edit") # missing -> new site
+ cloneid = html.var("clone")
new = siteid == None
if phase == "title":
if new:
@@ -6910,7 +6913,9 @@ def mode_edit_site(phase):
html.context_button(_("All Sites"), make_link([("mode",
"sites")]), "back")
return
- if new:
+ if cloneid:
+ site = sites[cloneid]
+ elif new:
site = {}
else:
site = sites.get(siteid, {})
@@ -7135,7 +7140,7 @@ def mode_edit_site(phase):
forms.header(_("Basic settings"))
forms.section(_("Site ID"), simple = not new)
if new:
- html.text_input("id", siteid)
+ html.text_input("id", siteid or cloneid)
html.set_focus("id")
else:
html.write(siteid)