Skip to content

Commit

Permalink
チャンネルの接続一覧表示がおかしかったのを修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
plonk committed Feb 23, 2022
1 parent 1f63c2b commit 463ed03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions core/common/servhs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,19 @@ void Servent::handshakeLocalFile(const char *fn, HTTP& http)

auto ch = chanMgr->findChannelByID(GnuID(id.c_str()));
locals.vars["channel"] = ch ? ch->getState() : nullptr;
}else if (str::contains(fn, "connections.html"))
{
auto vec = str::split(fn, "?");
if (vec.size() == 2)
{
String id = cgi::Query(vec[1]).get("id").c_str();

if (!id.isEmpty())
{
auto ch = chanMgr->findChannelByID(GnuID(id.c_str()));
locals.vars["channel"] = ch ? ch->getState() : nullptr;
}
}
}

char *args = strstr(fileName.cstr(), "?");
Expand Down
10 changes: 5 additions & 5 deletions ui/html-master/connections.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
</TR>
{^end}

{@if page.id}
{@if channel}
<h3>
{$page.channel.name}
{$page.channel.bitrate}Kbps
({$page.channel.totalListeners}/{$page.channel.totalRelays})
[{$page.channel.localListeners}/{$page.channel.localRelays}]
{$channel.name}
{$channel.bitrate}Kbps
({$channel.totalListeners}/{$channel.totalRelays})
[{$channel.localListeners}/{$channel.localRelays}]
</h3>
{@end}
<DIV class="reloader hscroll" data-url="connections.html?fragment=content&amp;id={$page.id}" data-interval="{$servMgr.refreshHTML}">
Expand Down

0 comments on commit 463ed03

Please sign in to comment.