aboutsummaryrefslogtreecommitdiff
path: root/admin/panes/home.php
blob: 3bc3429a6846a1c2e7262564c3e328a308313033 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?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;">
    <h2 style="text-align:center;"><?= l("Welcome back", "Vous revoilà") ?> <?= $_DATA["name"] ?><?= l("", " ") ?>!</h2>
    <ul class="list-group" style="margin-top:30px;">
        <li class="list-group-item">
            <span id="temperature"><?= l("Server running at", "Serveur fonctionnant à") ?> <b>--.-°C</b>, n/a</span> <a href="#" onclick="window.parent.activity('activity-version', '/admin/panes/version.php', window.parent.document.getElementById('activity-version'));" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li><li class="list-group-item"><b><?php

                $uca = scandir("/mnt/blogchain/_posts");
                $uct = [];

                foreach ($uca as $art) {
                    if (is_file("/mnt/blogchain/_posts/" . $art) && substr($art, 0, 1) !== "." && substr($art, 0, 1) !== "_") {
                        $uct[] = $art;
                    }
                }

                echo(count($uct));

                ?></b> <?= l("UnchainedTech article·s", "article·s sur UnchainedTech") ?>, <?php

            $uca = scandir("/mnt/blogchain/_posts/_drafts");
            $uct2 = [];

            foreach ($uca as $art) {
                if (is_file("/mnt/blogchain/_posts/_drafts/" . $art) && substr($art, 0, 1) !== "." && substr($art, 0, 1) !== "_") {
                    $uct2[] = $art;
                }
            }

            echo(count($uct2));

            ?> <?= l("draft·s", "brouillon·s") ?> <a onclick="window.parent.activity('activity-unchained', '/admin/panes/unchained.php', window.parent.document.getElementById('activity-unchained'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
        <li class="list-group-item"><b><?php

                $uca = scandir("/mnt/minteckrolt-cloud");
                $uct3 = [];

                foreach ($uca as $art) {
                    if (is_dir("/mnt/minteckrolt-cloud/" . $art) && substr($art, 0, 1) === "~") {
                        $uct3[] = $art;
                    }
                }

                echo(count($uct3));

                ?></b> <?= l("Neutron Cloud website·s", "site·s Neutron Cloud") ?> <a onclick="window.parent.activity('activity-quotas', '/admin/panes/quotas.php', window.parent.document.getElementById('activity-quotas'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
        <li class="list-group-item"><b><?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));

                ?></b> <?= l("Kartik Online player·s", "joueurs·s Kartik Online") ?> <a onclick="window.parent.activity('activity-kartik', '/admin/panes/kartik.php', window.parent.document.getElementById('activity-kartik'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
        <li class="list-group-item"><?= l("Using", "Utilisation de") ?> <b><?php

                exec("df -h -x tmpfs -x squashfs -x devtmpfs --total -P", $outdisk);
                $outn = explode(" ", preg_replace('/\s+/', ' ', $outdisk[count($outdisk) - 1]));
                echo($outn[2] . "/" . $outn[1]);

                ?></b> <?= l("on all disks", "sur tous les disques") ?>, <b><?php

                echo($outn[3]);

                ?></b> <?= l("free", "de libre") ?> <a onclick="window.parent.activity('activity-disk', '/admin/panes/disk.php', window.parent.document.getElementById('activity-disk'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
    </ul>
    <!--suppress JSUnresolvedVariable, JSUnresolvedFunction -->
    <script>
        setInterval(() => {
            $.ajax("/admin/api/serverTemp.php", {
                success: (data) => {
                    document.getElementById("temperature").innerHTML = data;
                }
            });
        }, 500)
    </script>
</div>

<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>