summaryrefslogtreecommitdiff
path: root/pages/computers.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-12-26 10:55:42 +0100
committerMinteck <contact@minteck.org>2022-12-26 10:55:42 +0100
commitc9de96328e59816ff4867abf5feab9fb9bf29511 (patch)
treee3c5ba398e885742e631aab5b3317ea5ffad87db /pages/computers.inc
parentae766d28c07628e71629a72452261898ea72057a (diff)
downloadpluralconnect-c9de96328e59816ff4867abf5feab9fb9bf29511.tar.gz
pluralconnect-c9de96328e59816ff4867abf5feab9fb9bf29511.tar.bz2
pluralconnect-c9de96328e59816ff4867abf5feab9fb9bf29511.zip
Update - This is an automated commit
Diffstat (limited to 'pages/computers.inc')
-rw-r--r--pages/computers.inc21
1 files changed, 13 insertions, 8 deletions
diff --git a/pages/computers.inc b/pages/computers.inc
index 6880d48..1541fa6 100644
--- a/pages/computers.inc
+++ b/pages/computers.inc
@@ -136,7 +136,7 @@ if (count($parts) === 2 || count($parts) === 3) {
<td style="padding-right: 10px; text-align: right;"><b>Graphics processor<?= count($computer["gpu"]["controllers"]) > 1 ? "s" : "" ?>:</b></td>
<td>
<?php $index = 0; foreach ($computer["gpu"]["controllers"] as $controller): ?>
- <?= $controller["bus"] ?> <?= $controller["model"] ?> (<?= $controller["cores"] ?> cores, <?= $controller["vramDynamic"] ? "dynamic graphics memory" : $controller["vram"] . " MiB" ?>)
+ <?= $controller["bus"] ?> <?= $controller["model"] ?> (<?php if (isset($controller["cores"])): ?><?= $controller["cores"] ?> cores, <?php endif; ?><?= $controller["vramDynamic"] ? "dynamic graphics memory" : $controller["vram"] . " MiB" ?>)
<?= $index < count($computer["gpu"]["controllers"]) - 1 ? "<br>" : "" ?>
<?php $index++; endforeach; ?>
</td>
@@ -170,7 +170,7 @@ if (count($parts) === 2 || count($parts) === 3) {
<td style="padding-right: 10px; text-align: right;"><b>RAM chips:</b></td>
<td>
<?php $index = 0; foreach ($computer["ram_chips"] as $chip): ?>
- <?= $chip["manufacturer"] ?> <?= round($chip["size"] / 1024**2, 2) ?> MiB <?= $chip["type"] ?>
+ <?php if (isset($chip["manufacturer"])): ?><?= $chip["manufacturer"] ?> <?php endif; ?><?= round($chip["size"] / 1024**2, 2) ?> MiB <?= $chip["type"] ?>
<?= $index < count($computer["ram_chips"]) - 1 ? "<br>" : "" ?>
<?php $index++; endforeach; ?>
</td>
@@ -194,7 +194,7 @@ if (count($parts) === 2 || count($parts) === 3) {
</tr>
<tr>
<td style="padding-right: 10px; text-align: right;"><b>Remaining capacity:</b></td>
- <td><?= $computer["battery"]["currentCapacity"] ?>/<?= $computer["battery"]["maxCapacity"] ?> <?= $computer["battery"]["capacityUnit"] ?> (designed for <?= $computer["battery"]["designedCapacity"] ?> <?= $computer["battery"]["capacityUnit"] ?>, <?= round(($computer["battery"]["maxCapacity"] / $computer["battery"]["designedCapacity"]) * 100, 2) ?>% left)</td>
+ <td><?= $computer["battery"]["currentCapacity"] ?>/<?= $computer["battery"]["maxCapacity"] ?> <?= $computer["battery"]["capacityUnit"] ?> (designed for <?= $computer["battery"]["designedCapacity"] ?> <?= $computer["battery"]["capacityUnit"] ?><?php if ($computer["battery"]["designedCapacity"] > 0): ?>, <?= round(($computer["battery"]["maxCapacity"] / $computer["battery"]["designedCapacity"]) * 100, 2) ?>% left<?php endif; ?>)</td>
</tr>
<?php else: ?><tr><td colspan="2">This computer does not contain a battery.</td></tr><?php endif; ?>
@@ -321,7 +321,7 @@ if (count($parts) === 2 || count($parts) === 3) {
<td><?= str_replace("�", "", $user["command"]) ?></td>
<td><?= $user["user"] ?></td>
<td><?= $user["date"] . " " . $user["time"] ?></td>
- <td><?= trim($user["ip"]) === "" ? "Local" : "Remote (" . $user["ip"] . ")" ?></td>
+ <td><?= trim($user["ip"]) === "" || trim($user["ip"]) === ":1" || trim($user["ip"]) === "::1" ? "Local" : "Remote (" . $user["ip"] . ")" ?></td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -438,7 +438,7 @@ if (count($parts) === 2 || count($parts) === 3) {
<td><?= trim($iface["ip4"] !== "") ? $iface["ip4"] : "" ?><?= trim($iface["ip6"] !== "") ? (trim($iface["ip4"] !== "") ? ", " : "") . $iface["ip6"] : "" ?></td>
<td><?= trim($iface["mac"] !== "") ? $iface["mac"] : "" ?></td>
<td><?= $iface["type"] === "wireless" ? "Wireless" : "Wired" ?></td>
- <td><?= $iface["internal"] ? "Yes" : "" ?></td>
+ <td><?= isset($iface["internal"]) && $iface["internal"] ? "Yes" : "" ?></td>
<td><?= $iface["virtual"] ? "Yes" : "" ?></td>
<td><?= $iface["dhcp"] ? "Yes" : "" ?></td>
</tr>
@@ -526,8 +526,8 @@ if (count($parts) === 2 || count($parts) === 3) {
<tr>
<th scope="row"><?= $process["pid"] ?></th>
<td><?= $process["name"] ?></td>
- <td><?= $process["cpu"] ?>%</td>
- <td><?= $process["ram"] ?>%</td>
+ <td><?= round($process["cpu"], 2) ?>%</td>
+ <td><?= round($process["ram"], 2) ?>%</td>
<td><?= $process["user"] ?></td>
<td><?= timeAgo($process["date"]) ?></td>
</tr>
@@ -781,6 +781,11 @@ if (count($parts) === 2 || count($parts) === 3) {
<h2>Computers</h2>
<p>Click on a computer to view information about it (open windows, installed apps, ...).</p>
+ <div class="alert alert-danger">
+ <b>Luna is not for production.</b> The Luna program version 1.0.0 is considered malware and must not be used on any computer other than a development machine.
+ </div>
+
+ <!--
<ul class="list-group">
<?php foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata"), function ($i) {
return !str_starts_with($i, ".");
@@ -798,7 +803,7 @@ if (count($parts) === 2 || count($parts) === 3) {
</div>
</a>
<?php endforeach; ?>
- </ul>
+ </ul>-->
</div>
<?php endif; ?>
</div>