mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-14 22:00:16 +02:00
* src/web/ejabberd_web_admin.erl: Added "Virtual Hosts" page
SVN Revision: 382
This commit is contained in:
parent
9da4594fd0
commit
8f90927d83
|
@ -1,3 +1,7 @@
|
||||||
|
2005-07-29 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/web/ejabberd_web_admin.erl: Added "Virtual Hosts" page
|
||||||
|
|
||||||
2005-07-27 Alexey Shchepin <alexey@sevcom.net>
|
2005-07-27 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
* src/ejabberd_router.erl: Added filter_packet hook
|
* src/ejabberd_router.erl: Added filter_packet hook
|
||||||
|
|
|
@ -76,6 +76,7 @@ make_xhtml(Els, global, Lang) ->
|
||||||
[?XE("ul",
|
[?XE("ul",
|
||||||
[?LI([?ACT("/admin/acls/", "Access Control Lists")]),
|
[?LI([?ACT("/admin/acls/", "Access Control Lists")]),
|
||||||
?LI([?ACT("/admin/access/", "Access Rules")]),
|
?LI([?ACT("/admin/access/", "Access Rules")]),
|
||||||
|
?LI([?ACT("/admin/vhosts/", "Virtual Hosts")]),
|
||||||
?LI([?ACT("/admin/nodes/", "Nodes")]),
|
?LI([?ACT("/admin/nodes/", "Nodes")]),
|
||||||
?LI([?ACT("/admin/stats/", "Statistics")])
|
?LI([?ACT("/admin/stats/", "Statistics")])
|
||||||
]
|
]
|
||||||
|
@ -528,6 +529,7 @@ process_admin(global,
|
||||||
?ACT("/admin/acls-raw/", "(raw)")]),
|
?ACT("/admin/acls-raw/", "(raw)")]),
|
||||||
?LI([?ACT("/admin/access/", "Access Rules"), ?C(" "),
|
?LI([?ACT("/admin/access/", "Access Rules"), ?C(" "),
|
||||||
?ACT("/admin/access-raw/", "(raw)")]),
|
?ACT("/admin/access-raw/", "(raw)")]),
|
||||||
|
?LI([?ACT("/admin/vhosts/", "Virtual Hosts")]),
|
||||||
?LI([?ACT("/admin/nodes/", "Nodes")]),
|
?LI([?ACT("/admin/nodes/", "Nodes")]),
|
||||||
?LI([?ACT("/admin/stats/", "Statistics")])
|
?LI([?ACT("/admin/stats/", "Statistics")])
|
||||||
]
|
]
|
||||||
|
@ -821,6 +823,14 @@ process_admin(Host,
|
||||||
])
|
])
|
||||||
], Host, Lang);
|
], Host, Lang);
|
||||||
|
|
||||||
|
process_admin(global,
|
||||||
|
#request{us = US,
|
||||||
|
path = ["vhosts"],
|
||||||
|
q = Query,
|
||||||
|
lang = Lang} = Request) ->
|
||||||
|
Res = list_vhosts(Lang),
|
||||||
|
make_xhtml([?XCT("h1", "ejabberd virtual hosts")] ++ Res, global, Lang);
|
||||||
|
|
||||||
process_admin(Host,
|
process_admin(Host,
|
||||||
#request{us = US,
|
#request{us = US,
|
||||||
path = ["users"],
|
path = ["users"],
|
||||||
|
@ -1188,6 +1198,30 @@ parse_access_rule(Text) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
list_vhosts(Lang) ->
|
||||||
|
Hosts = ?MYHOSTS,
|
||||||
|
SHosts = lists:sort(Hosts),
|
||||||
|
[?XE("table",
|
||||||
|
[?XE("thead",
|
||||||
|
[?XE("tr",
|
||||||
|
[?XCT("td", "Host"),
|
||||||
|
?XCT("td", "Registered users"),
|
||||||
|
?XCT("td", "Online users")
|
||||||
|
])]),
|
||||||
|
?XE("tbody",
|
||||||
|
lists:map(
|
||||||
|
fun(Host) ->
|
||||||
|
OnlineUsers =
|
||||||
|
length(ejabberd_sm:get_vh_session_list(Host)),
|
||||||
|
RegisteredUsers =
|
||||||
|
length(ejabberd_auth:get_vh_registered_users(Host)),
|
||||||
|
?XE("tr",
|
||||||
|
[?XE("td", [?AC("../server/" ++ Host ++ "/", Host)]),
|
||||||
|
?XC("td", integer_to_list(RegisteredUsers)),
|
||||||
|
?XC("td", integer_to_list(OnlineUsers))
|
||||||
|
])
|
||||||
|
end, SHosts)
|
||||||
|
)])].
|
||||||
|
|
||||||
|
|
||||||
list_users(Host, Query, Lang) ->
|
list_users(Host, Query, Lang) ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user