aboutsummaryrefslogtreecommitdiff
path: root/admin/panes/quotas.php
blob: 91b68990422c032def33caf85218452fedb39b58 (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
<?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;">Neutron Cloud Quotas</h2>

    <h4 style="text-align:center;">Websites that reached their limit can be locked down</h4>

    <ul class="list-group" style="margin-top:20px;">
        <?php $index=1;foreach (scandir("/mnt/minteckrolt-cloud") as $site): if (substr($site, 0, 1) === "~"): ?>
        <li class="list-group-item"><i><?= strip_tags(file_get_contents("/mnt/minteckrolt-cloud/" . $site . "/data/webcontent/sitename")) ?></i> (<a href="https://cloud.minteck.ro.lt/<?= $site ?>" target="_blank"><code><?= $site ?></code></a>, X<?= file_get_contents("/mnt/minteckrolt-cloud/" . $site . "/Tier") ?> Tier)<br><span class="text-muted" id="quota-<?= $index ?>">Calculating...</span><span style="float:right;"><a href="/admin/NeutronManage/?_=<?= $site ?>" target="_blank">Admin Panel</a></span><!--suppress JSUnresolvedVariable, JSUnresolvedFunction, JSUnfilteredForInLoop -->
            <script>
                setTimeout(() => {
                    $.ajax("/admin/api/getQuota.php?_=<?= $site ?>", {
                        async: false,
                        success: (data) => {
                            document.getElementById("quota-<?= $index ?>").innerHTML = data;
                        },
                        error: () => {
                            document.getElementById("quota-<?= $index ?>").innerText = "Unable to calculate data usage";
                        }
                    });
                }, 1000 * <?= $index ?>)
            </script></li>
        <?php $index++;endif;endforeach; ?>
</div>

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