Module: check_mk
Branch: master
Commit: 6a656b52fffb6db1536250a3017052321e13c2b1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a656b52fffb6d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 10 14:13:51 2016 +0100
Added option to stop the graph update pause timer
---
web/htdocs/js/checkmk.js | 20 +++++++++++++++++++-
web/htdocs/pages.css | 11 ++++++++---
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index d4471ac..e6c914b 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1161,6 +1161,21 @@ function update_reload_pause_timer(seconds_left)
}
}
+
+function stop_reload_pause_timer()
+{
+ if (!g_reload_pause_timer)
+ return;
+
+ clearTimeout(g_reload_pause_timer);
+ g_reload_pause_timer = null;
+
+ var counter = document.getElementById("reload_pause_counter");
+ if (counter)
+ counter.style.display = "none";
+}
+
+
function draw_reload_pause_overlay(seconds)
{
var container = document.getElementById("reload_pause");
@@ -1185,8 +1200,11 @@ function draw_reload_pause_overlay(seconds)
p2.className = "pause_bar p2";
container.appendChild(p2);
- var counter = document.createElement("div");
+ var counter = document.createElement("a");
counter.setAttribute("id", "reload_pause_counter");
+ // FIXME: Localize
+ counter.title = "Click to stop the countdown."
+ counter.href = "javascript:stop_reload_pause_timer()";
container.appendChild(counter);
document.body.appendChild(container);
diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css
index 8eab2ed..7799ccb 100644
--- a/web/htdocs/pages.css
+++ b/web/htdocs/pages.css
@@ -208,6 +208,7 @@ div#foot_refresh, div#foot_refresh_time {
padding: 10px;
text-decoration: none;
z-index: 40;
+ text-align: center;
}
.pause_bar {
@@ -223,21 +224,25 @@ div#foot_refresh, div#foot_refresh_time {
}
.pause_bar.p1 {
- margin-left: 20px;
+ margin-left: 15px;
margin-right: 5px;
}
.pause_bar.p2 {
margin-left: 5px;
- margin-right: 10px;
+ margin-right: 15px;
}
#reload_pause_counter {
font-weight: bold;
color: #fff;
- width: 100%;
text-align: center;
font-size: 120%;
+ text-decoration: none;
+}
+
+#reload_pause_counter:hover {
+ text-decoration: underline;
}