Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit 1c992dd

Browse files
committed
Small updates
1 parent 938f57e commit 1c992dd

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

pages/header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44
<meta charset="UTF-8"/>
55
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6-
<link href="assets/styles.css" rel="stylesheet">
7-
<script src="./assets/js/charts-ram.js" defer></script>
8-
<script src="./assets/js/charts-cpu.js" defer></script>
6+
<link href="../public/assets/styles.css" rel="stylesheet">
7+
<script src="../public/assets/js/charts-ram.js" defer></script>
8+
<script src="../public/assets/js/charts-cpu.js" defer></script>
99
</head>
1010
<body class="dark:bg-gray-900 bg-gray-100">
1111
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>

pages/small-header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44
<meta charset="UTF-8"/>
55
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6-
<link href="assets/styles.css" rel="stylesheet">
7-
<script src="./assets/js/charts-ram.js" defer></script>
8-
<script src="./assets/js/charts-cpu.js" defer></script>
6+
<link href="../public/assets/styles.css" rel="stylesheet">
7+
<script src="../public/assets/js/charts-ram.js" defer></script>
8+
<script src="../public/assets/js/charts-cpu.js" defer></script>
99
</head>
1010
<body class="dark:bg-gray-900 bg-gray-100">
1111
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>

pages/webinterface/index.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
use webinterface\main;
44

5-
$nodes = main::buildRequest("cluster", $_SESSION['cn3-wi-access_token'], "GET");
5+
$nodes = main::buildDefaultRequest("cluster", "GET");
66

77
$services = 0;
8+
$currentVersion = "Unknown";
9+
10+
$connectedNodeCount = 0;
11+
$totalNodeCount = sizeof($nodes);
812

913
$memory_min = 0;
1014
$memory_max = 0;
@@ -17,6 +21,9 @@
1721
continue;
1822
}
1923

24+
$connectedNodeCount++;
25+
26+
$currentVersion = $node['nodeInfoSnapshot']['version'];
2027
$services += $node['nodeInfoSnapshot']['currentServicesCount'];
2128

2229
$memory_max += $node['nodeInfoSnapshot']['maxMemory'];
@@ -35,11 +42,11 @@
3542
<!--Users-->
3643
<div class="flex items-center p-4 dark:bg-gray-800 bg-white rounded-lg shadow-lg">
3744
<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"/>
3946
</div>
4047
<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>
4350
</div>
4451
</div>
4552
<!-- Servers -->
@@ -59,8 +66,7 @@
5966
</div>
6067
<div>
6168
<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>
6470
</div>
6571
</div>
6672
<!-- Ram -->
@@ -148,7 +154,7 @@
148154
<div class="min-w-0 p-4 text-white bg-gradient-to-br from-red-600 to-red-800 rounded-lg shadow-xs">
149155
<h4 class="mb-4 font-bold">Warning!</h4>
150156
<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
152158
date and
153159
to get support, you can activate the auto updater in the launcher.cnl file.
154160
</p>

public/assets/icons/cluster.png

1.23 KB
Loading

0 commit comments

Comments
 (0)