mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
modules/console: Improve formatting for client list output.
This commit is contained in:
parent
756840b42c
commit
ee5c1f27f2
1 changed files with 15 additions and 10 deletions
|
@ -1155,12 +1155,16 @@ console_cmd__net__host__cache(opt &out, const string_view &line)
|
||||||
bool
|
bool
|
||||||
console_cmd__client(opt &out, const string_view &line)
|
console_cmd__client(opt &out, const string_view &line)
|
||||||
{
|
{
|
||||||
|
using std::setw;
|
||||||
|
using std::left;
|
||||||
|
using std::right;
|
||||||
|
|
||||||
for(const auto *const &client : ircd::client::list)
|
for(const auto *const &client : ircd::client::list)
|
||||||
{
|
{
|
||||||
out << "client(" << (const void *)client << ")"
|
out << setw(8) << left << client->id
|
||||||
<< " socket(" << client->sock.get() << ")"
|
<< " " << right << setw(22) << local(*client)
|
||||||
<< " " << local(*client)
|
<< " " << left << setw(22) << remote(*client)
|
||||||
<< " " << remote(*client);
|
;
|
||||||
|
|
||||||
if(bool(client->sock))
|
if(bool(client->sock))
|
||||||
{
|
{
|
||||||
|
@ -1169,15 +1173,16 @@ console_cmd__client(opt &out, const string_view &line)
|
||||||
net::bytes(*client->sock)
|
net::bytes(*client->sock)
|
||||||
};
|
};
|
||||||
|
|
||||||
out << " OUT: " << stat.second
|
out << " | UP " << setw(8) << right << stat.second
|
||||||
<< " IN: " << stat.first;
|
<< " | DN " << setw(8) << right << stat.first
|
||||||
|
<< " |";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(client->longpoll)
|
|
||||||
out << " LONGPOLL";
|
|
||||||
|
|
||||||
if(client->reqctx)
|
if(client->reqctx)
|
||||||
out << " CTX " << id(*client->reqctx);
|
out << " CTX " << setw(4) << id(*client->reqctx);
|
||||||
|
|
||||||
|
if(client->longpoll)
|
||||||
|
out << " POLL";
|
||||||
|
|
||||||
if(client->request.user_id)
|
if(client->request.user_id)
|
||||||
out << " USER " << client->request.user_id;
|
out << " USER " << client->request.user_id;
|
||||||
|
|
Loading…
Reference in a new issue