mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Merge 1873 from trunk.
* src/web/ejabberd_web_admin.erl: Show big integers with comma separators for easy reading SVN Revision: 1939
This commit is contained in:
parent
77ff657351
commit
79463d7f7d
@ -1,5 +1,8 @@
|
|||||||
2009-03-03 Badlop <badlop@process-one.net>
|
2009-03-03 Badlop <badlop@process-one.net>
|
||||||
|
|
||||||
|
* src/web/ejabberd_web_admin.erl: Show big integers with comma
|
||||||
|
separators for easy reading
|
||||||
|
|
||||||
* src/web/ejabberd_web_admin.erl: Calls to the hook
|
* src/web/ejabberd_web_admin.erl: Calls to the hook
|
||||||
webadmin_menu_node provide the node as first argument, and calls
|
webadmin_menu_node provide the node as first argument, and calls
|
||||||
to webadmin_menu_hostnode provide both the host and the node. Fix
|
to webadmin_menu_hostnode provide both the host and the node. Fix
|
||||||
|
@ -1297,8 +1297,8 @@ list_vhosts(Lang) ->
|
|||||||
ejabberd_auth:get_vh_registered_users_number(Host),
|
ejabberd_auth:get_vh_registered_users_number(Host),
|
||||||
?XE('tr',
|
?XE('tr',
|
||||||
[?XE('td', [?AC("../server/" ++ Host ++ "/", Host)]),
|
[?XE('td', [?AC("../server/" ++ Host ++ "/", Host)]),
|
||||||
?XC('td', integer_to_list(RegisteredUsers)),
|
?XC('td', pretty_string_int(RegisteredUsers)),
|
||||||
?XC('td', integer_to_list(OnlineUsers))
|
?XC('td', pretty_string_int(OnlineUsers))
|
||||||
])
|
])
|
||||||
end, SHosts)
|
end, SHosts)
|
||||||
)])].
|
)])].
|
||||||
@ -1408,11 +1408,10 @@ list_given_users(Users, Prefix, Lang, URLFunc) ->
|
|||||||
QueueLen = length(mnesia:dirty_read({offline_msg, US})),
|
QueueLen = length(mnesia:dirty_read({offline_msg, US})),
|
||||||
[?AC(URLFunc({users_queue, Prefix,
|
[?AC(URLFunc({users_queue, Prefix,
|
||||||
User, Server}),
|
User, Server}),
|
||||||
integer_to_list(QueueLen))]
|
pretty_string_int(QueueLen))]
|
||||||
catch
|
catch
|
||||||
_:_ -> [#xmlcdata{cdata = <<"Can't access the offline messages storage.">>}]
|
_:_ -> [#xmlcdata{cdata = <<"Can't access the offline messages storage.">>}]
|
||||||
end,
|
end,
|
||||||
|
|
||||||
FLast =
|
FLast =
|
||||||
case ejabberd_sm:get_user_resources(UserB, ServerB) of
|
case ejabberd_sm:get_user_resources(UserB, ServerB) of
|
||||||
[] ->
|
[] ->
|
||||||
@ -1461,13 +1460,13 @@ get_stats(global, Lang) ->
|
|||||||
[?XAE('table', [],
|
[?XAE('table', [],
|
||||||
[?XE('tbody',
|
[?XE('tbody',
|
||||||
[?XE('tr', [?XCT('td', "Registered Users:"),
|
[?XE('tr', [?XCT('td', "Registered Users:"),
|
||||||
?XC('td', integer_to_list(RegisteredUsers))]),
|
?XC('td', pretty_string_int(RegisteredUsers))]),
|
||||||
?XE('tr', [?XCT('td', "Online Users:"),
|
?XE('tr', [?XCT('td', "Online Users:"),
|
||||||
?XC('td', integer_to_list(OnlineUsers))]),
|
?XC('td', pretty_string_int(OnlineUsers))]),
|
||||||
?XE('tr', [?XCT('td', "Outgoing s2s Connections:"),
|
?XE('tr', [?XCT('td', "Outgoing s2s Connections:"),
|
||||||
?XC('td', integer_to_list(S2SConnections))]),
|
?XC('td', pretty_string_int(S2SConnections))]),
|
||||||
?XE('tr', [?XCT('td', "Outgoing s2s Servers:"),
|
?XE('tr', [?XCT('td', "Outgoing s2s Servers:"),
|
||||||
?XC('td', integer_to_list(S2SServers))])
|
?XC('td', pretty_string_int(S2SServers))])
|
||||||
])
|
])
|
||||||
])];
|
])];
|
||||||
|
|
||||||
@ -1477,9 +1476,9 @@ get_stats(Host, Lang) ->
|
|||||||
[?XAE('table', [],
|
[?XAE('table', [],
|
||||||
[?XE('tbody',
|
[?XE('tbody',
|
||||||
[?XE('tr', [?XCT('td', "Registered Users:"),
|
[?XE('tr', [?XCT('td', "Registered Users:"),
|
||||||
?XC('td', integer_to_list(RegisteredUsers))]),
|
?XC('td', pretty_string_int(RegisteredUsers))]),
|
||||||
?XE('tr', [?XCT('td', "Online Users:"),
|
?XE('tr', [?XCT('td', "Online Users:"),
|
||||||
?XC('td', integer_to_list(OnlineUsers))])
|
?XC('td', pretty_string_int(OnlineUsers))])
|
||||||
])
|
])
|
||||||
])].
|
])].
|
||||||
|
|
||||||
@ -1626,7 +1625,7 @@ list_last_activity(Host, Lang, Integral, Period) ->
|
|||||||
[?XMLATTR('style',
|
[?XMLATTR('style',
|
||||||
"width:" ++ integer_to_list(
|
"width:" ++ integer_to_list(
|
||||||
trunc(90 * V / Max)) ++ "%;")],
|
trunc(90 * V / Max)) ++ "%;")],
|
||||||
[#xmlcdata{cdata = list_to_binary(integer_to_list(V))}])
|
[#xmlcdata{cdata = list_to_binary(pretty_string_int(V))}])
|
||||||
|| V <- Hist ++ Tail])]
|
|| V <- Hist ++ Tail])]
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
@ -1770,9 +1769,9 @@ get_node(global, Node, ["db"], Query, Lang) ->
|
|||||||
?XE('td', [db_storage_select(
|
?XE('td', [db_storage_select(
|
||||||
STable, Type, Lang)]),
|
STable, Type, Lang)]),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(Size)),
|
pretty_string_int(Size)),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(Memory))
|
pretty_string_int(Memory))
|
||||||
])
|
])
|
||||||
end, STables),
|
end, STables),
|
||||||
[?XC('h1', ?T("Database Tables at ") ++ atom_to_list(Node))] ++
|
[?XC('h1', ?T("Database Tables at ") ++ atom_to_list(Node))] ++
|
||||||
@ -1927,19 +1926,19 @@ get_node(global, Node, ["stats"], _Query, Lang) ->
|
|||||||
CPUTimeS)]),
|
CPUTimeS)]),
|
||||||
?XE('tr', [?XCT('td', "Online Users:"),
|
?XE('tr', [?XCT('td', "Online Users:"),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(OnlineUsers))]),
|
pretty_string_int(OnlineUsers))]),
|
||||||
?XE('tr', [?XCT('td', "Transactions Committed:"),
|
?XE('tr', [?XCT('td', "Transactions Committed:"),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(TransactionsCommitted))]),
|
pretty_string_int(TransactionsCommitted))]),
|
||||||
?XE('tr', [?XCT('td', "Transactions Aborted:"),
|
?XE('tr', [?XCT('td', "Transactions Aborted:"),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(TransactionsAborted))]),
|
pretty_string_int(TransactionsAborted))]),
|
||||||
?XE('tr', [?XCT('td', "Transactions Restarted:"),
|
?XE('tr', [?XCT('td', "Transactions Restarted:"),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(TransactionsRestarted))]),
|
pretty_string_int(TransactionsRestarted))]),
|
||||||
?XE('tr', [?XCT('td', "Transactions Logged:"),
|
?XE('tr', [?XCT('td', "Transactions Logged:"),
|
||||||
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
?XAC('td', [?XMLATTR('class', <<"alignright">>)],
|
||||||
integer_to_list(TransactionsLogged))])
|
pretty_string_int(TransactionsLogged))])
|
||||||
])
|
])
|
||||||
])];
|
])];
|
||||||
|
|
||||||
@ -2328,6 +2327,20 @@ last_modified() ->
|
|||||||
cache_control_public() ->
|
cache_control_public() ->
|
||||||
{"Cache-Control", "public"}.
|
{"Cache-Control", "public"}.
|
||||||
|
|
||||||
|
%% Transform 1234567890 into "1,234,567,890"
|
||||||
|
pretty_string_int(Integer) when is_integer(Integer) ->
|
||||||
|
pretty_string_int(integer_to_list(Integer));
|
||||||
|
pretty_string_int(String) when is_list(String) ->
|
||||||
|
{_, Result} = lists:foldl(
|
||||||
|
fun(NewNumber, {3, Result}) ->
|
||||||
|
{1, [NewNumber, $, | Result]};
|
||||||
|
(NewNumber, {CountAcc, Result}) ->
|
||||||
|
{CountAcc+1, [NewNumber | Result]}
|
||||||
|
end,
|
||||||
|
{0, ""},
|
||||||
|
lists:reverse(String)),
|
||||||
|
Result.
|
||||||
|
|
||||||
|
|
||||||
%%%
|
%%%
|
||||||
%%% Navigation Menu
|
%%% Navigation Menu
|
||||||
|
Loading…
Reference in New Issue
Block a user