Software /
code /
prosody-modules
Diff
mod_statistics/top.lua @ 1083:6685ebe6f8cf
mod_statistics: top: Make sessions temporarily bold when they are updated
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 15 Jun 2013 22:26:48 +0100 |
parent | 1082:6c555e7dc942 |
child | 1084:9612cea92503 |
line wrap: on
line diff
--- a/mod_statistics/top.lua Sat Jun 15 22:11:30 2013 +0100 +++ b/mod_statistics/top.lua Sat Jun 15 22:26:48 2013 +0100 @@ -137,7 +137,14 @@ end table.insert(row, v); end + if session.updated then + self.listwin:attron(curses.A_BOLD); + end self.listwin:mvaddstr(index, 0, " "..table.concat(row)); + if session.updated then + session.updated = false; + self.listwin:attroff(curses.A_BOLD); + end end else -- FIXME: How to clear a line? It's 5am and I don't feel like reading docs. @@ -162,6 +169,7 @@ stats.total_stanzas_in = stats.message_in + stats.presence_in + stats.iq_in; stats.total_stanzas_out = stats.message_out + stats.presence_out + stats.iq_out; stats.last_update = time(); + stats.updated = true; end function new(base)