2 require_once "inc/common.php";
3 require_once "Classes/class-checkup.php";
4 if (!isset($config['unrealircd']))
6 $redirect = get_config("base_url")."settings/rpc-servers.php";
7 header('Location: ' . $redirect);
11 require_once "inc/header.php";
14 <div
class="row ml-0">
15 <h2
>Network Overview
</h2
>
16 <span
class="badge bg-danger text-light ml-4 pl-2 pr-2 rounded-pill" style
="height:fit-content">LIVE
</span
>
17 <?php
checkup_widget(); ?>
21 /* What if someone wants to add their own stats... */
22 Hook
::run(HOOKTYPE_PRE_OVERVIEW_CARD
, $array_of_stats);
24 /* This makes sure that a plugin which called the parameter
25 * by reference can add/update the stats for display here.
27 $stats = (object) $array_of_stats;
29 Hook
::run(HOOKTYPE_GET_USER_LIST
, $userlist);
30 $num_of_panel_admins = count($userlist);
43 background
-image
: url('https://cdn.wallpapersafari.com/34/98/yznZmQ.jpg');
44 background
-size
: cover
;
52 text
-decoration
: none
;
55 @keyframes rotateEffect
{
56 0% { transform
: rotateX(0deg
); }
57 50% { transform
: rotateX(180deg
); }
58 100% { transform
: rotateX(0deg
); }
62 animation
: rotateEffect
0.5s ease
;
65 .frosted
-glass
-success
{
66 /* From https://css.glass */
67 background
: rgba(63, 162, 36, 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
);
73 /* From https://css.glass */
74 background
: rgba(57, 127, 207, 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
-danger
{
80 /* From https://css.glass */
81 background
: rgba(207, 57, 57, 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
);
86 .frosted
-glass
-warning
{
87 /* From https://css.glass */
88 background
: rgba(207, 194, 57, 0.73);
89 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
90 backdrop
-filter
: blur(9.8px
);
91 -webkit
-backdrop
-filter
: blur(9.8px
);
93 .frosted
-glass
-secondary
{
94 /* From https://css.glass */
95 background
: rgba(75, 75, 75, 0.73);
96 box
-shadow
: 0 4px
30px
rgba(0, 0, 0, 0.1);
97 backdrop
-filter
: blur(9.8px
);
98 -webkit
-backdrop
-filter
: blur(9.8px
);
102 <div
class="container card-container ml-1">
104 <div
class="row mt-3">
105 <div
class="col-sm mb-3">
106 <a
class="card frosted-glass-success text-center" href
="<?php echo get_config("base_url
"); ?>users/">
107 <div
class="card-body text-white">
108 <div
class="row text-center">
109 <span id
="userRecord" class="position-absolute badge rounded-pill badge-warning" hidden
>
110 <?php
echo "Record: "; ?>
114 <i aria
-hidden
="true" class="fa fa-users fa-2x"></i
>
117 <h5 id
="stats_user_total" class="display-4 numberDisplay"></h5
>
118 <h5
class="display-5">Users Online
</h5
>
125 <div
class="col-sm mb-3">
126 <a
class="card frosted-glass-info text-center" href
="<?php echo get_config("base_url
"); ?>channels/">
127 <div
class="card-body text-white">
128 <div
class="row text-center">
131 <i aria
-hidden
="true" class="fa fa-hashtag fa-2x"></i
>
134 <h5 id
="stats_channel_total" class="display-4 numberDisplay"></h5
>
135 <h5
class="display-5">Channels
</h5
>
142 <div
class="col-sm mb-3">
143 <a
class="card frosted-glass-warning text-center" href
="<?php echo get_config("base_url
"); ?>users/">
144 <div
class="card-body text-dark">
145 <div
class="row text-center">
148 <i aria
-hidden
="true" class="fa fa-shield-halved fa-2x"></i
>
151 <h5 id
="stats_oper_total" class="display-4 numberDisplay"></h5
>
152 <h5
class="display-5" style
="margin-top: -3px">Operators
</h5
>
153 <h5 style
="font-size: 10px; margin-top:-12px">View in Users
></h5
>
160 <div
class="col-sm mb-3">
161 <a
class="card frosted-glass-secondary text-center" href
="<?php echo get_config("base_url
"); ?>servers/">
162 <div
class="card-body text-white">
163 <div
class="row text-center">
166 <i aria
-hidden
="true" class="fa fa-network-wired fa-2x"></i
>
169 <h5 id
="stats_server_total" class="display-4 numberDisplay"></h5
>
170 <h5
class="display-5">Servers
</h5
>
179 <div
class="container card-container ml-1">
182 <div
class="col-sm mb-3">
183 <a
class="card frosted-glass-danger text-center" href
="<?php echo get_config("base_url
"); ?>server-bans/">
184 <div
class="card-body text-white">
185 <div
class="row text-center">
188 <i aria
-hidden
="true" class="fa fa-ban fa-2x"></i
>
191 <h5 id
="num_server_bans" class="display-4 numberDisplay"></h5
>
192 <h5
class="display-5">Server Bans
</h5
>
199 <div
class="col-sm mb-3">
200 <a
class="card frosted-glass-secondary text-center" href
="<?php echo get_config("base_url
"); ?>spamfilter.php/">
201 <div
class="card-body text-white">
202 <div
class="row text-center">
205 <i aria
-hidden
="true" class="fa fa-filter fa-2x"></i
>
208 <h5 id
="num_spamfilter_entries" class="display-4 numberDisplay"></h5
>
209 <h5
class="display-5">Spamfilter
</h5
>
216 <div
class="col-sm mb-3">
217 <a
class="card frosted-glass-info text-center" href
="<?php echo get_config("base_url
"); ?>server-bans/ban-exceptions.php">
218 <div
class="card-body text-white">
219 <div
class="row text-center">
222 <i aria
-hidden
="true" class="fa fa-door-open fa-2x"></i
>
225 <h5 id
="num_ban_exceptions" class="display-4 numberDisplay"></h5
>
226 <h5
class="display-5">Server Ban Exceptions
</h5
>
233 <div
class="col-sm mb-3">
234 <a
class="card frosted-glass-success text-center" href
="<?php echo get_config("base_url
"); ?>servers">
235 <div
class="card-body text-white">
236 <div
class="row text-center">
239 <i aria
-hidden
="true" class="fa fa-database fa-2x"></i
>
242 <h5 id
="stats_uline_total" class="display-4 numberDisplay"></h5
>
243 <h5
class="display-5" style
="margin-top: -3px">Services Online
</h5
>
244 <h5 style
="font-size: 10px; margin-top:-12px">View in Servers
></h5
>
256 /* Last time stats were updated */
259 function updateStats(e
)
263 data
= JSON
.parse(e
.data
);
267 stats_tick
= Date
.now()
269 document
.getElementById("userRecord").innerHTML
= "Record: "+data
.user
.record
;
270 document
.getElementById("stats_user_total").innerHTML
= data
.user
.total
;
271 document
.getElementById("stats_user_total").classList
.remove('numberDisplay');
272 document
.getElementById("stats_user_total").classList
.add('numberDisplay');
273 document
.getElementById("stats_channel_total").innerHTML
= data
.channel
.total
;
274 document
.getElementById("stats_oper_total").innerHTML
= data
.user
.oper
;
275 document
.getElementById("stats_server_total").innerHTML
= data
.server
.total
;
276 document
.getElementById("num_server_bans").innerHTML
= data
.server_ban
.server_ban
;
277 document
.getElementById("num_spamfilter_entries").innerHTML
= data
.server_ban
.spamfilter
;
278 document
.getElementById("num_ban_exceptions").innerHTML
= data
.server_ban
.server_ban_exception
;
279 document
.getElementById("stats_uline_total").innerHTML
= data
.user
.ulined +
"/" + data
.server
.ulined
;
281 function checkStatsOutdated()
283 setTimeout(checkStatsOutdated
, 2000);
284 if (Date
.now() - stats_tick
> 10000)
285 document
.getElementById("live_stats").style
.visibility
= 'hidden';
287 setTimeout(checkStatsOutdated
, 2000);
291 if (!!window
.EventSource
) {
292 var source
= new EventSource('api/overview.php');
293 source
.addEventListener('message', updateStats
, false);
297 //setInterval(updateStats, 1000); // Update stats every second
298 // ^ commented out but may want to restart initStats() when connection is lost.
301 window
.addEventListener('resize', function() {
302 var containers
= document
.querySelectorAll('.card-container');
303 var width
= window
.innerWidth
;
306 containers
.forEach((container
) => {
307 container
.removeAttribute('style');
312 containers
.forEach((container
) => {
313 container
.style
.marginLeft
= "40px";
314 container
.style
.marginTop
= "30px";
321 <div
class="container card-container card-container ml-1">
324 <div
class="col-sm mb-3">
325 <a
class="card frosted-glass-success text-center" href
="<?php echo get_config("base_url
"); ?>settings">
326 <div
class="card-body text-white">
327 <div
class="row text-center">
330 <i aria
-hidden
="true" class="fa fa-lock-open fa-2x"></i
>
333 <h5
class="display-4 numberDisplay"><?php
echo $num_of_panel_admins; ?></h5
>
334 <h5
class="display-5">Panel Accounts
</h5
>
341 <div
class="col-sm mb-3">
342 <a
class="card frosted-glass-info text-center" href
="<?php echo get_config("base_url
"); ?>settings/plugins.php">
343 <div
class="card-body text-light">
344 <div
class="row text-center">
347 <i aria
-hidden
="true" class="fa fa-plug fa-2x"></i
>
350 <h5
class="display-4 numberDisplay"><?php
echo count(Plugins
::$list); ?></h5
>
351 <h5
class="display-5">Plugins
</h5
>
362 Hook
::run(HOOKTYPE_OVERVIEW_CARD
, $stats);
364 require_once "inc/footer.php";