Show the server online count along with the server chat
Signed-off-by: WolverinDEV <git@teaspeak.de>canary
parent
53a4cf8490
commit
587bb93eaa
|
@ -1,4 +1,7 @@
|
|||
# Changelog:
|
||||
* **10.12.19**
|
||||
- Show the server online count along the server chat
|
||||
|
||||
* **24.11.19**
|
||||
- Fixed several bugs within the permission editor
|
||||
- Hide senseless permissions (disableable via options)
|
||||
|
|
|
@ -152,6 +152,8 @@ namespace chat {
|
|||
this.handle.handle.fileManager.icons.generateTag(server.properties.virtualserver_icon_id).appendTo(html_tag);
|
||||
$.spawn("div").text(server.properties.virtualserver_name).appendTo(html_tag);
|
||||
html_tag_title.text(tr("You're chatting in Server"));
|
||||
|
||||
this.update_server_limit(server, html_limit_tag);
|
||||
} else if(this.handle.handle.connected) {
|
||||
$.spawn("div").text("No channel selected").appendTo(html_tag);
|
||||
} else {
|
||||
|
@ -177,6 +179,18 @@ namespace chat {
|
|||
tag.text(channel.clients(false).length + " / " + channel_limit);
|
||||
}
|
||||
|
||||
private update_server_limit(server: ServerEntry, tag: JQuery) {
|
||||
const fn = () => {
|
||||
let text = server.properties.virtualserver_clientsonline + " / " + server.properties.virtualserver_maxclients;
|
||||
if(server.properties.virtualserver_reserved_slots)
|
||||
text += " (" + server.properties.virtualserver_reserved_slots + " " + tr("Reserved") + ")";
|
||||
tag.text(text);
|
||||
};
|
||||
|
||||
server.updateProperties().then(fn).catch(error => tag.text(tr("Failed to update info")));
|
||||
fn();
|
||||
}
|
||||
|
||||
update_chat_counter() {
|
||||
const conversations = this.handle.private_conversations().conversations();
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue