1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-05 10:39:29 +02:00

* src/web/ejabberd_web.erl: Minor update

SVN Revision: 217
This commit is contained in:
Alexey Shchepin 2004-03-15 20:46:42 +00:00
parent 60cb9fc959
commit f9f33a9117
2 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,7 @@
2004-03-15 Alexey Shchepin <alexey@sevcom.net>
* src/web/ejabberd_web.erl: Minor update
2004-03-14 Alexey Shchepin <alexey@sevcom.net> 2004-03-14 Alexey Shchepin <alexey@sevcom.net>
* src/web/ejabberd_web.erl: Added interface for users listsing and * src/web/ejabberd_web.erl: Added interface for users listsing and

View file

@ -350,7 +350,7 @@ list_users() ->
N when N =< 100 -> N when N =< 100 ->
lists:flatmap( lists:flatmap(
fun(U) -> fun(U) ->
[?AC("../user/" ++ U, U), ?BR] [?AC("../user/" ++ U ++ "/", U), ?BR]
end, SUsers); end, SUsers);
N -> N ->
NParts = trunc(math:sqrt(N * 0.618)) + 1, NParts = trunc(math:sqrt(N * 0.618)) + 1,
@ -363,7 +363,7 @@ list_users() ->
true -> lists:last(SUsers) true -> lists:last(SUsers)
end, end,
Name = Name =
lists:nth(K, SUsers) ++ " -- " ++ lists:nth(K, SUsers) ++ [$\s, 226, 128, 148, $\s] ++
Last, Last,
[?AC(Node ++ "/", Name), ?BR] [?AC(Node ++ "/", Name), ?BR]
end, lists:seq(1, N, M)) end, lists:seq(1, N, M))
@ -378,7 +378,7 @@ list_users_in_diapason(Diap) ->
Sub = lists:sublist(SUsers, N1, N2 - N1 + 1), Sub = lists:sublist(SUsers, N1, N2 - N1 + 1),
lists:flatmap( lists:flatmap(
fun(U) -> fun(U) ->
[?AC("../../user/" ++ U, U), ?BR] [?AC("../../user/" ++ U ++ "/", U), ?BR]
end, Sub). end, Sub).
@ -387,6 +387,9 @@ get_stats() ->
OnlineUsers = mnesia:table_info(presence, size), OnlineUsers = mnesia:table_info(presence, size),
AuthUsers = mnesia:table_info(session, size), AuthUsers = mnesia:table_info(session, size),
RegisteredUsers = mnesia:table_info(passwd, size), RegisteredUsers = mnesia:table_info(passwd, size),
S2SConns = ejabberd_s2s:dirty_get_connections(),
S2SConnections = length(S2SConns),
S2SServers = length(lists:usort([element(2, C) || C <- S2SConns])),
[?XAE("table", [], [?XAE("table", [],
[?XE("tbody", [?XE("tbody",
@ -395,7 +398,10 @@ get_stats() ->
?XE("tr", [?XC("td", "Authentificated users"), ?XE("tr", [?XC("td", "Authentificated users"),
?XC("td", integer_to_list(AuthUsers))]), ?XC("td", integer_to_list(AuthUsers))]),
?XE("tr", [?XC("td", "Online users"), ?XE("tr", [?XC("td", "Online users"),
?XC("td", integer_to_list(OnlineUsers))]) ?XC("td", integer_to_list(OnlineUsers))]),
?XE("tr", [?XC("td", "Outgoing S2S connections"),
?XC("td", integer_to_list(S2SConnections))]),
?XE("tr", [?XC("td", "Outgoing S2S servers"),
?XC("td", integer_to_list(S2SServers))])
]) ])
])]. ])].