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> {
|
export async function stats(): Promise<void> {
|
||||||
const stats = await getStats(Credentials.authToken);
|
const stats = await getStats(Credentials.authToken);
|
||||||
$("#totalMessages").each((i, el) => {
|
$("#totalMessages").text(stats.totalMessages);
|
||||||
el.textContent = stats.totalMessages.toString();
|
$("#totalUsers").text(stats.totalUsers);
|
||||||
});
|
$("#totalOnlineUsers").text(stats.totalOnlineUsers);
|
||||||
$("#totalUsers").each((i, el) => {
|
$("#numMessagesToday").text(stats.numMessagesToday);
|
||||||
el.textContent = stats.totalUsers.toString();
|
|
||||||
});
|
|
||||||
$("#totalOnlineUsers").each((i, el) => {
|
|
||||||
el.textContent = stats.totalOnlineUsers.toString();
|
|
||||||
});
|
|
||||||
$("#numMessagesToday").each((i, el) => {
|
|
||||||
el.textContent = stats.numMessagesToday.toString();
|
|
||||||
});
|
|
||||||
log.debug(stats);
|
log.debug(stats);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user