From: Valerie Pond Date: Sun, 15 Jan 2023 23:49:30 +0000 (+0000) Subject: update overview and add record users X-Git-Tag: 0.9~444 X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/commitdiff_plain/79ed2176e804ca03dd6555cd58f91770c6f0b042?hp=7501444395a3aef2dcb58531db817f356c721ed6 update overview and add record users this converts things from a bunch of queries to the easier to use "stats.get" (thanks @syzop). this also adds in a 'Record' label in the users card, showing the record user amount. --- diff --git a/index.php b/index.php index 21a5fe2..632580c 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ require_once "common.php"; require_once "header.php"; -rpc_pop_lists(); +$stats = $rpc->query("stats.get", []); ?>

Network Overview

@@ -15,10 +15,12 @@ rpc_pop_lists();
- + + user->record; ?> +
-

+

user->total - $stats->user->ulined; ?>

@@ -31,6 +33,8 @@ rpc_pop_lists(); + +
@@ -40,7 +44,7 @@ rpc_pop_lists();
-

+

channel->total; ?>

@@ -62,7 +66,7 @@ rpc_pop_lists();
-

+

user->oper - $stats->user->ulined; ?>

@@ -86,7 +90,7 @@ rpc_pop_lists();
-

+

server->total; ?>

@@ -113,7 +117,7 @@ rpc_pop_lists();
-

+

server_ban->server_ban; ?>

@@ -135,7 +139,7 @@ rpc_pop_lists();
-

+

server_ban->spamfilter; ?>

@@ -157,7 +161,7 @@ rpc_pop_lists();
-

+

server_ban->server_ban_exception; ?>

@@ -173,9 +177,18 @@ rpc_pop_lists(); server->ulined) { $bg = "bg-success"; - } ?> + + /* honestly can't think of a case where there would actually be only one uline... but... well here we are, worrying over the small stuff =] */ + $user_noun = ($stats->user->ulined == 1) ? "user" : "users"; // use "users" even if 0, sounds better. + $is_are = ($stats->user->ulined == 1) ? "is" : "are"; + $server_noun = ($stats->server->ulined == 1) ? "server" : "servers"; + $tooltip = "There $is_are " . $stats->user->ulined . " U-Lined $user_noun over " . $stats->server->ulined . " U-Lined $server_noun"; + } + else + $bg = "bg-warning"; + ?>
@@ -184,7 +197,7 @@ rpc_pop_lists();
-

+

user->ulined; ?>/server->ulined; ?>