From 95112b1eb06a4be531ded59563d53a63a8d614e8 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 8 Aug 2021 12:04:30 +0200 Subject: Opening! --- admin/api/_demo.php | 8 ++--- admin/api/autosave.php | 31 +++++++++++++++++ admin/api/draftvslive.php | 41 +++++++++++++++++++++++ admin/api/getQuota.php | 54 ++++++++++++++++++++++++++++++ admin/api/getUbuntuUpgrades.php | 18 +++++----- admin/api/getUpdates.php | 50 ++++++++++++++-------------- admin/api/refreshUpdates.php | 6 ++-- admin/api/serverLogSummary.php | 14 ++++---- admin/api/serverTemp.php | 38 ++++++++++----------- admin/api/serverTime.php | 22 ++++++------- admin/api/setlive.php | 33 +++++++++++++++++++ admin/api/terminateAllSessions.php | 66 ++++++++++++++++++------------------- admin/api/terminateGameSessions.php | 46 +++++++++++++------------- admin/api/terminateWebSessions.php | 44 ++++++++++++------------- 14 files changed, 315 insertions(+), 156 deletions(-) create mode 100644 admin/api/autosave.php create mode 100644 admin/api/draftvslive.php create mode 100644 admin/api/getQuota.php create mode 100644 admin/api/setlive.php (limited to 'admin/api') diff --git a/admin/api/_demo.php b/admin/api/_demo.php index e4651f1..68b5ad6 100644 --- a/admin/api/_demo.php +++ b/admin/api/_demo.php @@ -1,5 +1,5 @@ - 75) { + die("Using " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); + } else if ($perc > 50) { + die("Using " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); + } else { + die("Using " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); + } + } else if ($tier === "5") { + $perc = ($parts2[0] / 250000) * 100; + if ($perc > 75) { + die("Using " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); + } else if ($perc > 50) { + die("Using " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); + } else { + die("Using " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); + } + } else if ($tier === "7") { + $perc = ($parts2[0] / 500000) * 100; + if ($perc > 75) { + die("Using " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); + } else if ($perc > 50) { + die("Using " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); + } else { + die("Using " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); + } + } else { + die("Using " . $parts[0] . ""); + } +} + +die("Unable to calculate data usage"); \ No newline at end of file diff --git a/admin/api/getUbuntuUpgrades.php b/admin/api/getUbuntuUpgrades.php index dcf06ce..7da6259 100644 --- a/admin/api/getUbuntuUpgrades.php +++ b/admin/api/getUbuntuUpgrades.php @@ -1,10 +1,10 @@ -Ubuntu " . explode("'", $ret[0])[1] . " is available, use do-release-upgrade to upgrade"); -} else { - echo("This server is running the latest version of Ubuntu"); +Ubuntu " . explode("'", $ret[0])[1] . " is available, use do-release-upgrade to upgrade"); +} else { + echo("This server is running the latest version of Ubuntu"); } \ No newline at end of file diff --git a/admin/api/getUpdates.php b/admin/api/getUpdates.php index 57ce275..099dd67 100644 --- a/admin/api/getUpdates.php +++ b/admin/api/getUpdates.php @@ -1,26 +1,26 @@ - trim($parts[1]), - "version" => [ - "local" => trim(explode("]", explode("[", $parts[2])[1])[0]), - "remote" => trim(explode("(", $parts[3])[1]), - ], - "repos" => trim(explode(":", explode("(", explode("[", trim($package))[1])[1])[1]), - "architecture" => trim(explode("]", explode("[", trim($package))[2])[0]) - ]; - - $data["packages"][] = $pkg; -} - + trim($parts[1]), + "version" => [ + "local" => trim(explode("]", explode("[", $parts[2])[1])[0]), + "remote" => trim(explode("(", $parts[3])[1]), + ], + "repos" => trim(explode(":", explode("(", explode("[", trim($package))[1])[1])[1]), + "architecture" => trim(explode("]", explode("[", trim($package))[2])[0]) + ]; + + $data["packages"][] = $pkg; +} + echo(json_encode($data, JSON_PRETTY_PRINT)); \ No newline at end of file diff --git a/admin/api/refreshUpdates.php b/admin/api/refreshUpdates.php index ea6f991..39ac9ed 100644 --- a/admin/api/refreshUpdates.php +++ b/admin/api/refreshUpdates.php @@ -1,4 +1,4 @@ -" . $cnt . " system log messages since last system startup"); \ No newline at end of file diff --git a/admin/api/serverTemp.php b/admin/api/serverTemp.php index 19e383a..55cf34b 100644 --- a/admin/api/serverTemp.php +++ b/admin/api/serverTemp.php @@ -1,20 +1,20 @@ -"); -exec("sensors -j", $out); -$outp = implode("\n", $out); -$outd = json_decode($outp, true); - -echo(round($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"], 1)); - -?>°C, 90) { - echo("completely overheating!"); -} else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) { - echo("starting to throttle!"); -} else { - echo("under normal temperatures"); +"); +exec("sensors -j", $out); +$outp = implode("\n", $out); +$outd = json_decode($outp, true); + +echo(round($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"], 1)); + +?>°C, 90) { + echo("completely overheating!"); +} else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) { + echo("starting to throttle!"); +} else { + echo("under normal temperatures"); } \ No newline at end of file diff --git a/admin/api/serverTime.php b/admin/api/serverTime.php index d0db5e3..77ba321 100644 --- a/admin/api/serverTime.php +++ b/admin/api/serverTime.php @@ -1,12 +1,12 @@ -