You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
674 B
21 lines
674 B
import { getStats } from "../../common/ajax/Messages";
|
|
|
|
import { Credentials } from "../../common/global/Credentials";
|
|
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();
|
|
});
|
|
log.debug(stats);
|
|
}
|