Module: check_mk
Branch: master
Commit: 1161be348dac2bd7f6114f662bc41cf60eedbb84
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1161be348dac2b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 30 11:15:10 2016 +0200
3915 User access times: New icon when never logged in; New column "last seen"
---
.werks/3915 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 19 +++++++++++++++----
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/.werks/3915 b/.werks/3915
new file mode 100644
index 0000000..008c58c
--- /dev/null
+++ b/.werks/3915
@@ -0,0 +1,9 @@
+Title: User access times: New icon when never logged in; New column "last
seen"
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i2
+Date: 1475226861
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 003d92a..3e4c8d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* 3894 FIX: mkeventd_status: Fixed bug in case Event Console is not running
WATO:
+ * 3915 User access times: New icon when never logged in; New column "last
seen"
* 3914 FIX: Roles: Aliases are now unique during cloning
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 62a2371..4149bfa 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9997,12 +9997,23 @@ def mode_users(phase):
last_seen = user.get('last_seen', 0)
if last_seen >= online_threshold:
title = _('Online')
- img_txt = 'on'
- else:
+ img_txt = 'online'
+ elif last_seen != 0:
title = _('Offline')
- img_txt = 'off'
+ img_txt = 'offline'
+ elif last_seen == 0:
+ title = _('Never logged in')
+ img_txt = 'inactive'
+
title += ' (%s %s)' % (fmt_date(last_seen), fmt_time(last_seen))
- table.cell(_("Act."), '<img class=icon title="%s"
src="images/icon_%sline.png" />' % (title, img_txt))
+ table.cell(_("Act."))
+ html.icon(title, img_txt)
+
+ table.cell(_("Last seen"))
+ if last_seen != 0:
+ html.write("%s %s" % (fmt_date(last_seen),
fmt_time(last_seen)))
+ else:
+ html.write(_("Never logged in"))
# Connection
if connection: