aboutsummaryrefslogtreecommitdiff
path: root/admin/panes/home.php
blob: fade996fb85cf19ae03d3d4b659a3c00ac90981e (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?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;">Welcome back <?= $_DATA["name"] ?>!</h2>
    <ul class="list-group" style="margin-top:30px;">
        <li class="list-group-item">
            <span id="temperature">Server running at <b><?php

                exec("sensors -j", $out);
                $outp = implode("\n", $out);
                $outd = json_decode($outp, true);

                echo(round($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"], 1));

                ?>°C</b>, <?php

            if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 90) {
                echo("completely overheating!");
            } else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) {
                echo("starting to throttle!");
            } else {
                echo("under normal temperatures");
            }

            ?></span> <a href="#" onclick="window.parent.activity('activity-version', '/admin/panes/version.php', window.parent.document.getElementById('activity-version'));" style="float:right;">Manage...</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> UnchainedTech article·s, <?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));

            ?> draft·s <a onclick="window.parent.activity('activity-unchained', '/admin/panes/unchained.php', window.parent.document.getElementById('activity-unchained'));" href="#" style="float:right;">Manage...</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> Neutron Cloud website·s <a onclick="window.parent.activity('activity-quotas', '/admin/panes/quotas.php', window.parent.document.getElementById('activity-quotas'));" href="#" style="float:right;">Manage...</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> Kartik Online player·s <a onclick="window.parent.activity('activity-kartik', '/admin/panes/kartik.php', window.parent.document.getElementById('activity-kartik'));" href="#" style="float:right;">Manage...</a></li>
        <li class="list-group-item">Using <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> on all disks, <b><?php

                echo($outn[3]);

                ?></b> free <a onclick="window.parent.activity('activity-disk', '/admin/panes/disk.php', window.parent.document.getElementById('activity-disk'));" href="#" style="float:right;">Manage...</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"; ?>