Module: check_mk
Branch: master
Commit: 04477a40268dc519117e999bda4ef4a66444e585
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=04477a40268dc5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Sep 16 11:18:01 2013 +0200
New option for painting timestamp: as Unix Epoch time
---
ChangeLog | 1 +
web/plugins/views/painters.py | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 7139d8d..2178687 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -161,6 +161,7 @@
To make the sidebar check for new messages on a regular base, you need
to configure the interval of sidebar popup notification updates e.g. via
WATO Global Settings.
+ * New option for painting timestamp: as Unix Epoch time
* FIX: better error message in case of exception in SNMP handling
* FIX: Inventory screen: Now shows custom checks
* FIX: Fixed locking problem of multisite pages related to user loading/saving
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 95bb8d0..02614f0 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -90,6 +90,7 @@ multisite_painter_options["ts_format"] = {
("abs", _("Absolute")),
("rel", _("Relative")),
("both", _("Both")),
+ ("epoch", _("Unix Timestamp (Epoch)")),
]
}
@@ -214,6 +215,9 @@ def paint_age(timestamp, has_been_checked, bold_if_younger_than,
mode=None):
if mode == None:
mode = get_painter_option("ts_format")
+ if mode == "epoch":
+ return "", str(int(timestamp))
+
if mode == "both":
css, h1 = paint_age(timestamp, has_been_checked, bold_if_younger_than,
"abs")
css, h2 = paint_age(timestamp, has_been_checked, bold_if_younger_than,
"rel")