2 require_once "inc/common.php";
3 if (!isset($config['unrealircd']))
5 $redirect = get_config("base_url")."settings/rpc-servers.php";
6 header('Location: ' . $redirect);
10 require_once "inc/header.php";
13 <div
class="row ml-0">
14 <h2
>Network Overview
</h2
>
15 <div id
="live_stats" data
-toggle
="tooltip" data
-placement
="top" title
="The stats on this page are updated in real-time"
16 class="card text-center row font-weight-bold"
17 style
="margin-left:5%;height:26px;width:60px;background-color:red;color:white;visibility:hidden">
18 <small style
="margin-left:-40px;padding-top:3px;margin-right:-45px">⚪
</small
>LIVE
24 /* What if someone wants to add their own stats... */
25 Hook
::run(HOOKTYPE_PRE_OVERVIEW_CARD
, $array_of_stats);
27 /* This makes sure that a plugin which called the parameter
28 * by reference can add/update the stats for display here.
30 $stats = (object) $array_of_stats;
32 Hook
::run(HOOKTYPE_GET_USER_LIST
, $userlist);
33 $num_of_panel_admins = count($userlist);
47 text
-decoration
: none
;
51 .frosted
-glass
-success
{
52 /* From https://css.glass */
53 background
: rgba(63, 162, 36, 0.73);
54 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
55 backdrop
-filter
: blur(9.8px
);
56 -webkit
-backdrop
-filter
: blur(9.8px
);
59 /* From https://css.glass */
60 background
: rgba(57, 127, 207, 0.73);
61 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
62 backdrop
-filter
: blur(9.8px
);
63 -webkit
-backdrop
-filter
: blur(9.8px
);
65 .frosted
-glass
-danger
{
66 /* From https://css.glass */
67 background
: rgba(207, 57, 57, 0.73);
68 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
69 backdrop
-filter
: blur(9.8px
);
70 -webkit
-backdrop
-filter
: blur(9.8px
);
72 .frosted
-glass
-warning
{
73 /* From https://css.glass */
74 background
: rgba(207, 194, 57, 0.73);
75 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
76 backdrop
-filter
: blur(9.8px
);
77 -webkit
-backdrop
-filter
: blur(9.8px
);
79 .frosted
-glass
-secondary
{
80 /* From https://css.glass */
81 background
: rgba(75, 75, 75, 0.73);
82 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
83 backdrop
-filter
: blur(9.8px
);
84 -webkit
-backdrop
-filter
: blur(9.8px
);
88 <div
class="container card-container ml-1">
90 <div
class="row mt-3">
91 <div
class="col-sm mb-3">
92 <a
class="card frosted-glass-success text-center" href
="<?php echo get_config("base_url
"); ?>users/">
93 <div
class="card-body text-white">
94 <div
class="row text-center">
95 <span id
="userRecord" class="position-absolute badge rounded-pill badge-warning" hidden
>
96 <?php
echo "Record: "; ?>
100 <i aria
-hidden
="true" class="fa fa-users fa-2x"></i
>
103 <h5 id
="stats_user_total" class="display-4"></h5
>
104 <h5
class="display-5">Users Online
</h5
>
111 <div
class="col-sm mb-3">
112 <a
class="card frosted-glass-info text-center" href
="<?php echo get_config("base_url
"); ?>channels/">
113 <div
class="card-body text-white">
114 <div
class="row text-center">
117 <i aria
-hidden
="true" class="fa fa-hashtag fa-2x"></i
>
120 <h5 id
="stats_channel_total" class="display-4"></h5
>
121 <h5
class="display-5">Channels
</h5
>
128 <div
class="col-sm mb-3">
129 <a
class="card frosted-glass-warning text-center" href
="<?php echo get_config("base_url
"); ?>users/">
130 <div
class="card-body text-dark">
131 <div
class="row text-center">
134 <i aria
-hidden
="true" class="fa fa-shield-halved fa-2x"></i
>
137 <h5 id
="stats_oper_total" class="display-4"></h5
>
138 <h5
class="display-5" style
="margin-top: -3px">Operators
</h5
>
139 <h5 style
="font-size: 10px; margin-top:-12px">View in Users
></h5
>
146 <div
class="col-sm mb-3">
147 <a
class="card frosted-glass-secondary text-center" href
="<?php echo get_config("base_url
"); ?>servers/">
148 <div
class="card-body text-white">
149 <div
class="row text-center">
152 <i aria
-hidden
="true" class="fa fa-network-wired fa-2x"></i
>
155 <h5 id
="stats_server_total" class="display-4"></h5
>
156 <h5
class="display-5">Servers
</h5
>
165 <div
class="container card-container ml-1">
168 <div
class="col-sm mb-3">
169 <a
class="card frosted-glass-danger text-center" href
="<?php echo get_config("base_url
"); ?>server-bans/">
170 <div
class="card-body text-white">
171 <div
class="row text-center">
174 <i aria
-hidden
="true" class="fa fa-ban fa-2x"></i
>
177 <h5 id
="num_server_bans" class="display-4"></h5
>
178 <h5
class="display-5">Server Bans
</h5
>
185 <div
class="col-sm mb-3">
186 <a
class="card frosted-glass-secondary text-center" href
="<?php echo get_config("base_url
"); ?>spamfilter.php/">
187 <div
class="card-body text-white">
188 <div
class="row text-center">
191 <i aria
-hidden
="true" class="fa fa-filter fa-2x"></i
>
194 <h5 id
="num_spamfilter_entries" class="display-4"></h5
>
195 <h5
class="display-5">Spamfilter
</h5
>
202 <div
class="col-sm mb-3">
203 <a
class="card frosted-glass-info text-center" href
="<?php echo get_config("base_url
"); ?>server-bans/ban-exceptions.php">
204 <div
class="card-body text-white">
205 <div
class="row text-center">
208 <i aria
-hidden
="true" class="fa fa-door-open fa-2x"></i
>
211 <h5 id
="num_ban_exceptions" class="display-4"></h5
>
212 <h5
class="display-5">Server Ban Exceptions
</h5
>
219 <div
class="col-sm mb-3">
220 <a
class="card frosted-glass-success text-center" href
="<?php echo get_config("base_url
"); ?>servers">
221 <div
class="card-body text-white">
222 <div
class="row text-center">
225 <i aria
-hidden
="true" class="fa fa-database fa-2x"></i
>
228 <h5 id
="stats_uline_total" class="display-4"></h5
>
229 <h5
class="display-5" style
="margin-top: -3px">Services Online
</h5
>
230 <h5 style
="font-size: 10px; margin-top:-12px">View in Servers
></h5
>
242 /* Last time stats were updated */
245 function updateStats(e
)
249 data
= JSON
.parse(e
.data
);
253 stats_tick
= Date
.now()
255 document
.getElementById("userRecord").innerHTML
= "Record: "+data
.user
.record
;
256 document
.getElementById("live_stats").style
.visibility
= '';
257 document
.getElementById("stats_user_total").innerHTML
= data
.user
.total
;
258 document
.getElementById("stats_channel_total").innerHTML
= data
.channel
.total
;
259 document
.getElementById("stats_oper_total").innerHTML
= data
.user
.oper
;
260 document
.getElementById("stats_server_total").innerHTML
= data
.server
.total
;
261 document
.getElementById("num_server_bans").innerHTML
= data
.server_ban
.server_ban
;
262 document
.getElementById("num_spamfilter_entries").innerHTML
= data
.server_ban
.spamfilter
;
263 document
.getElementById("num_ban_exceptions").innerHTML
= data
.server_ban
.server_ban_exception
;
264 document
.getElementById("stats_uline_total").innerHTML
= data
.user
.ulined +
"/" + data
.server
.ulined
;
266 function checkStatsOutdated()
268 setTimeout(checkStatsOutdated
, 2000);
269 if (Date
.now() - stats_tick
> 10000)
270 document
.getElementById("live_stats").style
.visibility
= 'hidden';
272 setTimeout(checkStatsOutdated
, 2000);
276 if (!!window
.EventSource
) {
277 var source
= new EventSource('api/overview.php');
278 source
.addEventListener('message', updateStats
, false);
282 //setInterval(updateStats, 1000); // Update stats every second
283 // ^ commented out but may want to restart initStats() when connection is lost.
286 window
.addEventListener('resize', function() {
287 var containers
= document
.querySelectorAll('.card-container');
288 var width
= window
.innerWidth
;
291 containers
.forEach((container
) => {
292 container
.removeAttribute('style');
297 containers
.forEach((container
) => {
298 container
.style
.marginLeft
= "40px";
299 container
.style
.marginTop
= "30px";
306 <div
class="container card-container card-container ml-1">
309 <div
class="col-sm mb-3">
310 <a
class="card frosted-glass-success text-center" href
="<?php echo get_config("base_url
"); ?>settings">
311 <div
class="card-body text-white">
312 <div
class="row text-center">
315 <i aria
-hidden
="true" class="fa fa-lock-open fa-2x"></i
>
318 <h5
class="display-4"><?php
echo $num_of_panel_admins; ?></h5
>
319 <h5
class="display-5">Panel Accounts
</h5
>
326 <div
class="col-sm mb-3">
327 <a
class="card frosted-glass-info text-center" href
="<?php echo get_config("base_url
"); ?>settings/plugins.php">
328 <div
class="card-body text-light">
329 <div
class="row text-center">
332 <i aria
-hidden
="true" class="fa fa-plug fa-2x"></i
>
335 <h5
class="display-4"><?php
echo count(Plugins
::$list); ?></h5
>
336 <h5
class="display-5">Plugins
</h5
>
347 Hook
::run(HOOKTYPE_OVERVIEW_CARD
, $stats);
349 require_once "inc/footer.php";