diff options
Diffstat (limited to 'admin/panes/kartik.php')
-rw-r--r-- | admin/panes/kartik.php | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/admin/panes/kartik.php b/admin/panes/kartik.php new file mode 100644 index 0000000..87a975f --- /dev/null +++ b/admin/panes/kartik.php @@ -0,0 +1,111 @@ +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.php";/** @var array $_DATA */ ?> + +<style> + ::-webkit-scrollbar { + width: 5px; + } + + ::-webkit-scrollbar-track { + border-radius: 9999px; + background: transparent; + } + + ::-webkit-scrollbar-thumb { + border-radius: 9999px; + background-color: rgba(136, 136, 136, 0.5); + transition: background 200ms; + } + + ::-webkit-scrollbar-thumb:hover { + background-color: rgba(85, 85, 85, 0.75); + } + + ::-webkit-scrollbar-thumb:active { + background-color: #222; + } + + .list-group-item { + background: #34373c; + } +</style> + +<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;"> + <div> + <h2 style="text-align:center;">Kartik Online</h2> + <h4 style="text-align:center;"><?php + + $uca = scandir("/mnt/kartik/online/private/stats"); + $uct4 = []; + + foreach ($uca as $art) { + if (is_file("/mnt/kartik/online/private/stats/" . $art)) { + $uct4[] = $art; + } + } + + echo(count($uct4)); + + ?> player·s</h4> + + <ul class="list-group"> + <?php + + $uca = scandir("/mnt/kartik/online/private/stats"); + $uct4 = []; + + foreach ($uca as $art) { + if (is_file("/mnt/kartik/online/private/stats/" . $art)): ?> + + <li class="list-group-item"><?= $art ?> <?php + + $osession = 0; + $gsession = 0; + $tsession = 0; + + $webs = scandir("/mnt/kartik/online/private/tokens"); + $ings = scandir("/mnt/kartik/online/private/gametokens"); + + foreach ($webs as $webt) { + if (!is_dir("/mnt/kartik/online/private/tokens/" . $webt)) { + $d = json_decode(file_get_contents("/mnt/kartik/online/private/tokens/" . $webt), true); + if ($d["id"] === $art) { + $osession++; + } + } + } + + foreach ($ings as $webt) { + if (!is_dir("/mnt/kartik/online/private/gametokens/" . $webt)) { + $d = json_decode(file_get_contents("/mnt/kartik/online/private/gametokens/" . $webt), true); + if ($d["id"] === $art) { + $gsession++; + } + } + } + + $tsession = $osession + $gsession; + if ($tsession > 1) { + $tsessions = "s"; + } else { + $tsessions = ""; + } + + if ($osession > 0) { + echo("<span class='badge text-warning border-warning' style='border:1px solid;vertical-align: middle;'>{$tsession} session{$tsessions} ({$gsession}:{$osession})</span>"); + } else if ($gsession > 0) { + echo("<span class='badge text-success border-success' style='border:1px solid;vertical-align: middle;'>{$tsession} session{$tsessions} ({$gsession}:0)</span>"); + } else { + echo("<span class='badge text-light border-light' style='border:1px solid;vertical-align: middle;'>Offline (0:0)</span>"); + } + + ?> <span style="float:right;"><a href="/admin/api/terminateWebSessions.php?_=<?= $art ?>">Terminate Web</a> · <a href="/admin/api/terminateGameSessions.php?_=<?= $art ?>">Terminate Game</a> · <a href="/admin/api/terminateAllSessions.php?_=<?= $art ?>">Terminate All</a></span></li> + + <?php endif; + } + + ?> + </ul> + </div> +</div> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file |