mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
* src/web/ejabberd_web_admin.erl: Bugfix
SVN Revision: 369
This commit is contained in:
parent
9304d91834
commit
cb90075327
@ -1,3 +1,7 @@
|
||||
2005-05-28 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/web/ejabberd_web_admin.erl: Bugfix
|
||||
|
||||
2005-05-25 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/msgs/pt-br.msg: New Brazilian Portuguese translation (thanks
|
||||
|
@ -1556,7 +1556,7 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
|
||||
nothing.
|
||||
|
||||
|
||||
list_last_activity(_Lang, Integral, Period) ->
|
||||
list_last_activity(Lang, Integral, Period) ->
|
||||
{MegaSecs, Secs, _MicroSecs} = now(),
|
||||
TimeStamp = MegaSecs * 1000000 + Secs,
|
||||
case Period of
|
||||
@ -1580,26 +1580,32 @@ list_last_activity(_Lang, Integral, Period) ->
|
||||
[];
|
||||
Vals ->
|
||||
Hist = histogram(Vals, Integral),
|
||||
Left = case Days of
|
||||
infinity ->
|
||||
0;
|
||||
_ ->
|
||||
Days - length(Hist)
|
||||
end,
|
||||
Tail = case Integral andalso Hist /= [] of
|
||||
true ->
|
||||
lists:duplicate(Left, lists:last(Hist));
|
||||
_ ->
|
||||
lists:duplicate(Left, 0)
|
||||
end,
|
||||
Max = lists:max(Hist),
|
||||
[?XAE("ol",
|
||||
[{"id", "lastactivity"}, {"start", "0"}],
|
||||
[?XAE("li",
|
||||
[{"style", "width:" ++ integer_to_list(
|
||||
trunc(90 * V / Max)) ++ "%;"}],
|
||||
[{xmlcdata, integer_to_list(V)}])
|
||||
|| V <- Hist ++ Tail])]
|
||||
if
|
||||
Hist == [] ->
|
||||
[?CT("No data")];
|
||||
true ->
|
||||
Left = if
|
||||
Days == infinity ->
|
||||
0;
|
||||
true ->
|
||||
Days - length(Hist)
|
||||
end,
|
||||
Tail = if
|
||||
Integral ->
|
||||
lists:duplicate(Left, lists:last(Hist));
|
||||
true ->
|
||||
lists:duplicate(Left, 0)
|
||||
end,
|
||||
Max = lists:max(Hist),
|
||||
[?XAE("ol",
|
||||
[{"id", "lastactivity"}, {"start", "0"}],
|
||||
[?XAE("li",
|
||||
[{"style",
|
||||
"width:" ++ integer_to_list(
|
||||
trunc(90 * V / Max)) ++ "%;"}],
|
||||
[{xmlcdata, integer_to_list(V)}])
|
||||
|| V <- Hist ++ Tail])]
|
||||
end
|
||||
end.
|
||||
|
||||
histogram(Values, Integral) ->
|
||||
|
Loading…
Reference in New Issue
Block a user