diff options
Diffstat (limited to 'admin/panes/version.php')
-rw-r--r-- | admin/panes/version.php | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/admin/panes/version.php b/admin/panes/version.php new file mode 100644 index 0000000..04ef136 --- /dev/null +++ b/admin/panes/version.php @@ -0,0 +1,139 @@ +<?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;">This server is running <?= php_uname('s') ?> version</h2> + + <h4 style="text-align:center;"><?= php_uname('r') . " " . php_uname('v') ?></h4> + + <ul class="list-group" style="margin-top:20px;"> + <li class="list-group-item">PHP <?= PHP_VERSION ?></li> + <li class="list-group-item">UnchainedTech <?= trim(file_get_contents("/mnt/blogchain/version.txt")) ?></li> + <li class="list-group-item">Neutron Cloud <?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/version")) ?></li> + <li class="list-group-item">Neutron Copper <?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/cyclic_version")) ?></li> + <li class="list-group-item">Neutron Titanium <?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/jaw_version")) ?></li> + <li class="list-group-item"> + <?php + + $osr = []; + $lines = explode("\n", file_get_contents("/etc/os-release")); + + foreach ($lines as $line) { + if (trim($line) !== "") { + $parts = explode("=", $line); + $osr[$parts[0]] = str_replace("\"", "", $parts[1]); + } + } + + echo($osr["NAME"] . " " . $osr["VERSION"]); + + ?> + </li> + <li class="list-group-item">Git <?php exec("git --version", $res);$p = explode(" ", $res[0]);array_shift($p);array_shift($p);echo(implode(" ", $p)) ?></li> + <li class="list-group-item"><?php + + $soft = $_SERVER['SERVER_SOFTWARE']; + + if (strpos(strtolower($soft), "apache") !== false) { + echo("Apache HTTP Server"); + } else { + echo("nginx"); + } + + ?> <?php + + $soft = $_SERVER['SERVER_SOFTWARE']; + + if (strpos(strtolower($soft), "apache") !== false) { + exec("apache2 -v", $res2);$p = explode(" ", $res2[0]);array_shift($p);array_shift($p);$p2 = explode("/", implode(" ", $p));array_shift($p2);echo(implode(" ", $p2)); + } else { + exec("nginx -v", $res2);$p = explode(" ", $res2[0]);array_shift($p);array_shift($p);$p2 = explode("/", implode(" ", $p));array_shift($p2);echo(implode(" ", $p2)); + } + + ?></li> + </ul> + + <ul class="list-group" style="margin-top:20px;"> + <li id="checking" class="list-group-item">Checking for updates...</li> + <li id="checking2" class="list-group-item" style="display:none;"></li> + <li id="found" class="list-group-item" style="display:none;"> + <b id="updates-count">0</b> package·s have updates available + + <details> + <summary>View details</summary> + <ul class="list-group" id="updates-list"></ul> + </details> + </li> + </ul> + <!--suppress JSUnresolvedVariable, JSUnresolvedFunction, JSUnfilteredForInLoop --> + <script> + $.ajax("/admin/api/refreshUpdates.php", { + success: (data) => { + document.getElementById("checking").innerText = "Checking for Ubuntu upgrades..."; + $.ajax("/admin/api/getUbuntuUpgrades.php", { + success: (data) => { + document.getElementById("checking").innerHTML = data; + document.getElementById("checking2").style.display = ""; + document.getElementById("checking2").innerText = "Reading package lists..."; + $.ajax("/admin/api/getUpdates.php", { + success: (data) => { + document.getElementById("checking2").innerText = "Please wait..."; + document.getElementById("updates-count").innerText = data.count; + + dom = ""; + for (let index in data.packages) { + item = data.packages[index]; + dom += `<li class="list-group-item"><b>${item.name}</b> (<span style="color: orange;">${item.version.local}</span> → <span style="color: green;">${item.version.remote}</span>)<br>Provided by: <code>${item.repos}</code>, target architecture: <code>${item.architecture}</code></li>` + } + + document.getElementById("updates-list").innerHTML = dom; + + document.getElementById("checking2").outerHTML = ""; + document.getElementById("found").style.display = ""; + }, + error: () => { + document.getElementById("checking2").innerText = "An error occurred while loading this content"; + } + }); + }, + error: () => { + document.getElementById("checking").innerText = "An error occurred while loading this content"; + } + }); + }, + error: () => { + document.getElementById("checking").innerText = "An error occurred while loading this content"; + } + }); + </script> +</div> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file |