]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - index.php
Make a start on filtering for later
[irc/unrealircd/unrealircd-webpanel.git] / index.php
index db5474bc3d88e69b68d84adf1e3e5fc0e5a1edc5..4db5cb075c2e0790bf44d6d7decdad51a5aef433 100644 (file)
--- a/index.php
+++ b/index.php
@@ -7,6 +7,20 @@ $stats = $rpc->query("stats.get", []);
 
 <h2>Network Overview</h2>
 
+<?php
+$array_of_stats = (array)$stats;
+
+/* What if someone wants to add their own stats... */
+Hook::run(HOOKTYPE_PRE_OVERVIEW_CARD, $array_of_stats);
+
+/* This makes sure that a plugin which called the parameter
+ * by reference can add/update the stats for display here.
+*/
+$stats = (object) $array_of_stats;
+
+
+?>
+
 <div class="container mt-5">
 
        <div class="row">
@@ -20,7 +34,7 @@ $stats = $rpc->query("stats.get", []);
                                                </span>
                                                </div>
                                                <div class="col">
-                                                       <h3 class="display-4"><?php echo $stats->user->total - $stats->user->ulined; ?></h3>
+                                                       <h3 class="display-4"><?php echo $stats->user->total; ?></h3>
                                                </div>
                                        </div>
                                </div>
@@ -66,7 +80,7 @@ $stats = $rpc->query("stats.get", []);
                                                        <i class="fa fa-shield-halved fa-3x"></i>
                                                </div>
                                                <div class="col">
-                                                       <h3 class="display-4"><?php echo $stats->user->oper - $stats->user->ulined; ?></h3>
+                                                       <h3 class="display-4"><?php echo $stats->user->oper; ?></h3>
                                                </div>
                                        </div>
                                </div>
@@ -75,7 +89,6 @@ $stats = $rpc->query("stats.get", []);
                                                <div class="col">
                                                        <h6>Opers</h6>
                                                </div>
-                                               <!-- TODO: Filter opers in user list and make this do that -->
                                                <div class="col"><a class="btn btn-primary" href="<?php echo BASE_URL."users/?operonly"; ?>">View</a></div>
                                        </div>
                                </div>
@@ -206,7 +219,7 @@ $stats = $rpc->query("stats.get", []);
                                                <div class="col">
                                                        <h6>Services Online</h6>
                                                </div>
-                                               <div class="col"> <a class="btn btn-secondary disabled" href="#">View</a></div>
+                                               <div class="col"> <a class="btn btn-primary" href="<?php echo BASE_URL."users/?servicesonly"; ?>">View</a></div>
                                        </div>
                                </div>
                                
@@ -217,4 +230,6 @@ $stats = $rpc->query("stats.get", []);
 
 <?php
 
+Hook::run(HOOKTYPE_OVERVIEW_CARD, $stats);
+
 require_once "footer.php";