Module: check_mk
Branch: master
Commit: 4939b67be0e75e310c3a01564a8adf484eebf90d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4939b67be0e75e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 6 09:38:20 2018 +0100
Host renaming: Add context links from/to background job detail pages
Change-Id: Ie11fedfe8e6e79569f12b04d40540f4be26a9963
---
web/htdocs/images/icon_background_job_details.png | Bin 0 -> 3141 bytes
web/htdocs/wato.py | 28 ++++++++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/images/icon_background_job_details.png
b/web/htdocs/images/icon_background_job_details.png
new file mode 100644
index 0000000..ccbaf13
Binary files /dev/null and b/web/htdocs/images/icon_background_job_details.png differ
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 0efece1..9a5c0a5 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1589,6 +1589,13 @@ def mode_bulk_rename_host(phase):
elif phase == "buttons":
html.context_button(_("Folder"),
watolib.folder_preserving_link([("mode", "folder")]),
"back")
+ host_renaming_job = RenameHostsBackgroundJob()
+ if host_renaming_job.is_available():
+ html.context_button(_("Previous results"), html.makeuri([
+ ("mode", "background_job_details"),
+ ("job_id", host_renaming_job.get_job_id()),
+ ("back_url", html.makeuri([])),
+ ], filename="wato.py"), "background_job_details")
return
elif phase == "action":
@@ -1618,7 +1625,11 @@ def mode_bulk_rename_host(phase):
host_renaming_job.start()
job_id = host_renaming_job.get_job_id()
- job_details_url = html.makeuri_contextless([("mode",
"background_job_details"), ("job_id", job_id)],
filename="wato.py")
+ job_details_url = html.makeuri_contextless([
+ ("mode", "background_job_details"),
+ ("job_id", job_id),
+ ("back_url", html.makeuri([])),
+ ], filename="wato.py")
html.http_redirect(job_details_url)
elif c == False: # not yet confirmed
return ""
@@ -1844,6 +1855,15 @@ def mode_rename_host(phase):
elif phase == "buttons":
global_buttons()
html.context_button(_("Host Properties"), host.edit_url(),
"back")
+
+ host_renaming_job = RenameHostsBackgroundJob()
+ if host_renaming_job.is_available():
+ html.context_button(_("Previous results"), html.makeuri([
+ ("mode", "background_job_details"),
+ ("job_id", host_renaming_job.get_job_id()),
+ ("back_url", html.makeuri([])),
+ ], filename="wato.py"), "background_job_details")
+
return
elif phase == "action":
@@ -1865,7 +1885,11 @@ def mode_rename_host(phase):
host_renaming_job.start()
job_id = host_renaming_job.get_job_id()
- job_details_url = html.makeuri_contextless([("mode",
"background_job_details"), ("job_id", job_id)],
filename="wato.py")
+ job_details_url = html.makeuri_contextless([
+ ("mode", "background_job_details"),
+ ("job_id", job_id),
+ ("back_url", host.folder().url()),
+ ], filename="wato.py")
html.http_redirect(job_details_url)
elif c == False: # not yet confirmed