Added chat names to the clients display.

This commit is contained in:
Marat Fayzullin 2024-02-08 19:03:00 -05:00
parent 1d2406d329
commit 55ed6d322b
2 changed files with 6 additions and 1 deletions

View File

@ -136,6 +136,8 @@ class ClientRegistry(object):
if c.sdr is not None:
entry["sdr"] = c.sdr.getName()
entry["band"] = c.sdr.getProfileName()
if c in self.chat:
entry["name"] = self.chat[c]["name"]
result.append(entry)
# Flush out stale bans
self.expireBans()

View File

@ -25,12 +25,14 @@ class ClientController(AuthorizationMixin, WebpageController):
<table class='table'>
<tr>
<th>IP Address</th>
<th>Chat Name</th>
<th>SDR Profile</th>
<th>Local Time</th>
<th>Actions</th>
</tr>
{clients}
<tr>
<td></td>
<td></td>
<td></td>
<td colspan="2" style="text-align:right;">
@ -53,8 +55,9 @@ class ClientController(AuthorizationMixin, WebpageController):
@staticmethod
def renderClient(c):
return "<tr><td>{0}</td><td>{1}</td><td>{2} {3}</td><td>{4}</td></tr>".format(
return "<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3} {4}</td><td>{5}</td></tr>".format(
ClientController.renderIp(c["ip"]),
c["name"] if "name" in c else "",
"banned" if c["ban"] else c["sdr"] + " " + c["band"] if "sdr" in c else "n/a",
"until" if c["ban"] else "since",
c["ts"].strftime('%H:%M:%S'),