simplified jqeury code
This commit is contained in:
parent
05ba6fbacc
commit
85a8f41da0
@ -5,17 +5,9 @@ import log from "loglevel";
|
||||
|
||||
export async function stats(): Promise<void> {
|
||||
const stats = await getStats(Credentials.authToken);
|
||||
$("#totalMessages").each((i, el) => {
|
||||
el.textContent = stats.totalMessages.toString();
|
||||
});
|
||||
$("#totalUsers").each((i, el) => {
|
||||
el.textContent = stats.totalUsers.toString();
|
||||
});
|
||||
$("#totalOnlineUsers").each((i, el) => {
|
||||
el.textContent = stats.totalOnlineUsers.toString();
|
||||
});
|
||||
$("#numMessagesToday").each((i, el) => {
|
||||
el.textContent = stats.numMessagesToday.toString();
|
||||
});
|
||||
$("#totalMessages").text(stats.totalMessages);
|
||||
$("#totalUsers").text(stats.totalUsers);
|
||||
$("#totalOnlineUsers").text(stats.totalOnlineUsers);
|
||||
$("#numMessagesToday").text(stats.numMessagesToday);
|
||||
log.debug(stats);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user