|
2 | 2 |
|
3 | 3 | use webinterface\main;
|
4 | 4 |
|
5 |
| -$nodes = main::buildRequest("cluster", $_SESSION['cn3-wi-access_token'], "GET"); |
| 5 | +$nodes = main::buildDefaultRequest("cluster", "GET"); |
6 | 6 |
|
7 | 7 | $services = 0;
|
| 8 | +$currentVersion = "Unknown"; |
| 9 | + |
| 10 | +$connectedNodeCount = 0; |
| 11 | +$totalNodeCount = sizeof($nodes); |
8 | 12 |
|
9 | 13 | $memory_min = 0;
|
10 | 14 | $memory_max = 0;
|
|
17 | 21 | continue;
|
18 | 22 | }
|
19 | 23 |
|
| 24 | + $connectedNodeCount++; |
| 25 | + |
| 26 | + $currentVersion = $node['nodeInfoSnapshot']['version']; |
20 | 27 | $services += $node['nodeInfoSnapshot']['currentServicesCount'];
|
21 | 28 |
|
22 | 29 | $memory_max += $node['nodeInfoSnapshot']['maxMemory'];
|
|
35 | 42 | <!--Users-->
|
36 | 43 | <div class="flex items-center p-4 dark:bg-gray-800 bg-white rounded-lg shadow-lg">
|
37 | 44 | <div class="p-3 mr-4 text-blue-500 bg-blue-100 rounded-full">
|
38 |
| - <img src="assets/icons/user.svg"/> |
| 45 | + <img src="assets/icons/cluster.png"/> |
39 | 46 | </div>
|
40 | 47 | <div>
|
41 |
| - <p class="mb-2 text-base font-medium text-gray-400">Users</p> |
42 |
| - <p class="text-xl font-semibold dark:text-white text-gray-900">35/100</p> |
| 48 | + <p class="mb-2 text-base font-medium text-gray-400">Connected nodes</p> |
| 49 | + <p class="text-xl font-semibold dark:text-white text-gray-900"><?= $connectedNodeCount ?>/<?= $totalNodeCount ?></p> |
43 | 50 | </div>
|
44 | 51 | </div>
|
45 | 52 | <!-- Servers -->
|
|
59 | 66 | </div>
|
60 | 67 | <div>
|
61 | 68 | <p class="mb-2 text-base font-medium text-gray-400">CPU</p>
|
62 |
| - <p class="text-xl font-semibold dark:text-white text-gray-900"><?= $cpu_used ?> |
63 |
| - %/<?= $cpu_max; ?>%</p> |
| 69 | + <p class="text-xl font-semibold dark:text-white text-gray-900"><?= $cpu_used ?>%/<?= $cpu_max; ?>%</p> |
64 | 70 | </div>
|
65 | 71 | </div>
|
66 | 72 | <!-- Ram -->
|
|
148 | 154 | <div class="min-w-0 p-4 text-white bg-gradient-to-br from-red-600 to-red-800 rounded-lg shadow-xs">
|
149 | 155 | <h4 class="mb-4 font-bold">Warning!</h4>
|
150 | 156 | <p>
|
151 |
| - Currently you are using an outdated CloudNet version (${version}), to keep the Cloud up to |
| 157 | + Currently you are using an outdated CloudNet version (<?= $currentVersion ?>), to keep the Cloud up to |
152 | 158 | date and
|
153 | 159 | to get support, you can activate the auto updater in the launcher.cnl file.
|
154 | 160 | </p>
|
|
0 commit comments