From 209356b8ade1920b50d1d3a1a5e121c6623d167b Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 11 Nov 2022 23:47:49 +0100 Subject: Update --- pages/about.inc | 2 +- pages/byfront.inc | 188 ++++++----- pages/computers.inc | 856 +++++++++++++++++++++++++++++++++++++++++++++++++++ pages/debug.inc | 4 +- pages/docs.inc | 6 +- pages/edit.inc | 2 +- pages/parser.inc | 4 + pages/prefix.inc | 4 + pages/rules-old.inc | 253 +++++++++++++++ pages/rules.inc | 243 +++++---------- pages/stats.inc | 172 ----------- pages/together.inc | 1 + pages/travelling.inc | 9 +- 13 files changed, 1291 insertions(+), 453 deletions(-) create mode 100644 pages/computers.inc create mode 100644 pages/rules-old.inc (limited to 'pages') diff --git a/pages/about.inc b/pages/about.inc index d6b0eeb..3e89cf5 100644 --- a/pages/about.inc +++ b/pages/about.inc @@ -48,7 +48,7 @@ function prettySize($bytes) { if ($bytes > 1024) { if ($bytes > 1024**2) { if ($bytes > 1024**3) { - return round($bytes / 1024**3, 1) . " MB"; + return round($bytes / 1024**3, 1) . " GB"; } else { return round($bytes / 1024**2, 1) . " MB"; } diff --git a/pages/byfront.inc b/pages/byfront.inc index 280d981..77556a2 100644 --- a/pages/byfront.inc +++ b/pages/byfront.inc @@ -11,52 +11,100 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ

Members by last fronted

-

Cloudburst System

- 0) { - $thisIndex = array_search($thisMember[0], $switches); - - $frontingStart = $thisMember[0]; - $frontingEnd = $switches[$thisIndex - 1]; + 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + } } - if ($frontingEnd !== null && isset($frontingStart)) { - $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + return $i; + }, array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "ynmuc"; + }))), + ...array_map(function ($i) { + $system = "gdapd"; + $i["_lastFronted"] = -1; + $id = $i["id"]; + $memberData = $i; + + $fronters = array_map(function ($item) { + return $item["id"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); + + if (in_array($id, $fronters)) { + $i["_lastFronted"] = time(); + } else { + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); + + $thisMember = array_filter($switches, function ($item) use ($memberData) { + return in_array($memberData["id"], $item["members"]); + }); + + $thisMember = array_values($thisMember); + $frontingEnd = null; + + if (count($thisMember) > 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + } } - } - return $i; - }, array_values(array_filter(scoreOrderGlobal(), function ($i) { - return $i["_system"] === "ynmuc"; - }))); uasort($members, function ($a, $b) { + return $i; + }, array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "gdapd"; + }))) + ]; uasort($members, function ($a, $b) { return $b["_lastFronted"] - $a["_lastFronted"]; - }); foreach ($members as $member): ?> -
+ }); $members = array_reverse($members); foreach ($members as $member): if ($member["_lastFronted"] !== -1 && $member["_lastFronted"] !== time()): ?> +
time() - (86400 * 14)): ?>rgba(255, 255, 255, .1) time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)rgba(255,55,55,0.17);;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;opacity: 0.75;"> "> " style="width:24px;">  - -  Not sharing memory - + + + Memory + + + Travelling + + + Must front + +
@@ -67,67 +115,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
- - -
-

Raindrops System

- 0) { - $thisIndex = array_search($thisMember[0], $switches); - - $frontingStart = $thisMember[0]; - $frontingEnd = $switches[$thisIndex - 1]; - } - - if ($frontingEnd !== null && isset($frontingStart)) { - $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); - } - } - - return $i; - }, array_values(array_filter(scoreOrderGlobal(), function ($i) { - return $i["_system"] === "gdapd"; - }))); uasort($members, function ($a, $b) { - return $b["_lastFronted"] - $a["_lastFronted"]; - }); foreach ($members as $member): ?> -
- "> - " style="width:24px;">  - -  Not sharing memory - - - -
- - Never fronted - - Last fronted () - -
-
- -
+ +
+
+ .jpg"> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Owner:
Luna version:
System:
OS kernel:
Serial: ()
Last seen:,
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $version): if (trim($version) !== "" && $software !== "systemOpensslLib" && $software !== "openssl" && $software !== "node" && $software !== "v8"): ?> + + + + + + +

Processors and graphics

Main processor: ( GHz)
Processor threading: + processor 1 ? "s" : "" ?>, + core 1 ? "s" : "" ?>, + thread 1 ? "s" : "" ?>
Hardware virtualization:
Level 1 cache: KiB (instruction), KiB (data)
Level 2 cache:
Level 3 cache:
Graphics processor 1 ? "s" : "" ?>: + + ( cores, ) + " : "" ?> + +
Display 1 ? "s" : "" ?>: + + (x, Hz) + " : "" ?> + +

System memory

Physical memory: GiB ( MiB used, MiB free)
Memory usage: MiB active, MiB available, MiB cache
Swap memory: GiB ( MiB used, MiB free)
RAM chips: + + MiB + " : "" ?> + +

Battery

Battery model:
Charge level:% ( V)
Cycles:
Remaining capacity:/ (designed for , % left)
This computer does not contain a battery.

Operating system

System:
CPU architecture:
Kernel version:
Code page:
Build number:
Serial number:
Startup interface:

Software versions

"OS kernel", + "systemOpenssl" => $computer["versions"]["systemOpensslLib"], + "npm" => "NPM", + "yarn" => "Yarn", + "gulp" => "Gulp", + "grunt" => "Grunt", + "git" => "Git", + "tsc" => "TypeScript", + "mysql" => "MySQL", + "redis" => "Redis", + "mongodb" => "MongoDB", + "apache" => "Apache HTTPD", + "php" => "PHP", + "docker" => "Docker", + "postfix" => "Postfix SMTP Server", + "postgresql" => "PostgreSQL", + "perl" => "Perl", + "python" => "Python (legacy)", + "python3" => "Python", + "pip" => "PIP (legacy)", + "pip3" => "PIP", + "java" => "Java", + "gcc" => "C compiler", + "virtualbox" => "VirtualBox", + "bash" => "Bash", + "zsh" => "zsh", + "fish" => "Fish", + "powershell" => "PowerShell", + "dotnet" => ".NET", + default => $software, + } + ?>:
+ +

Screens

+

+ You can remotely control this computer. Open remote control. +

+
+ +
+
+ .jpg"> +
+
+ +
+ +

Windows

+
+ +
+
+
+ .jpg"> +
+
+
+
+ +
+ +

Sessions

+ + + + + + + + + + + + + + + + + + + + + +
TTYCommandUserOpenType
+ +

Filesystems

+ + + + + + + + + + + + + 1024) { + if ($bytes > 1024**2) { + if ($bytes > 1024**3) { + return round($bytes / 1024**3, 1) . " GB"; + } else { + return round($bytes / 1024**2, 1) . " MB"; + } + } else { + return round($bytes / 1024, 1) . " KB"; + } + } else { + return $bytes . " B"; + } + } + + uasort($computer["filesystems"], function ($a, $b) { + return $b["use"] - $a["use"]; + }); + + foreach ($computer["filesystems"] as $fs): ?> + + + + + + + + + + +
DeviceMount pointTypeUsedFreeTotal
(%)
+ +

Audio devices

+ + + + + + + + + + + + + + + + + + + + + +
TypeManufacturerNameDefaultConnection
+ +

Network cards

+ + + + + + + + + + + + + + + 300, + "down" => 200, + default => 100 + }; + $statB = match ($b["operstate"]) { + "up" => 300, + "down" => 200, + default => 100 + }; + + return $statB - $statA; + }); + + foreach ($computer["network"] as $iface): ?> + > + + + + + + + + + + + +
InterfaceStateIP addressesMAC addressTypeInternalVirtualDHCP
+ +

Network connections

+ + + + + + + + + + + + + + + + + + + + + +
StateProtocolSourceDestinationProcess
"Connected", + "LISTEN" => "Listening", + "CLOSING" => "Terminating", + "UNKNOWN" => "?", + "LAST_ACK", "FIN_WAIT2" => "Waiting", + "TIME_WAIT" => "Waiting", + "FIN_WAIT1" => "Closing", + "SYN_RECV" => "Received", + "SYN_SENT" => "Attempting", + default => $connection["state"], + } ?> "TCP over IPv4", + "tcp6" => "TCP over IPv6", + "tcp46" => "TCP over IPv4 and IPv6", + "udp4" => "UDP over IPv4", + "udp6" => "UDP over IPv6", + "udp46" => "UDP over IPv4 and IPv6", + default => $connection["protocol"], + } ?> "<local IPv4>", + "::1" => "<local IPv6>", + default => $connection["localAddress"], + } ?> (port ) "<local IPv4>", + "::1" => "<local IPv6>", + default => $connection["localAddress"], + } ?> () 0) { + echo($f[0]["name"] . " [" . $connection["pid"] . "]"); + } else { + echo($connection["pid"]); + } + + ?>
+ +

Processes

+ + + + + + + + + + + + + + + + + + + + + + + +
PIDNameCPURAMUserStarted
%%
+
+ +
+

+ Remote controlling + Back +

+ +
+ .jpg"> +
+ +
+
+

+                
+            
+
+ +
+
+ + + +
+

Computers

+

Click on a computer to view information about it (open windows, installed apps, ...).

+ + +
+ +
+ + + + diff --git a/pages/debug.inc b/pages/debug.inc index 77001d0..e316a6f 100644 --- a/pages/debug.inc +++ b/pages/debug.inc @@ -76,7 +76,7 @@ function itemToName(string $item): string {
  • Longest operation: ( ms, %)
  • -

    Processing times

    +

    Processing times

    $time): ?>%">
    @@ -86,7 +86,7 @@ function itemToName(string $item): string { -

    Reported failures

    +

    Reported failures

    The data updater has not reported any update failure in the last run.

    diff --git a/pages/docs.inc b/pages/docs.inc index 0322f32..6d01489 100644 --- a/pages/docs.inc +++ b/pages/docs.inc @@ -22,7 +22,7 @@ if ($select === "add") { die(); } elseif (isset($select)) { if (ctype_alnum($select) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json")) { - $id = $select; + $id = $_documentId = $select; $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json"), true); $titleBase = " · " . $title . " · Cold Haze"; $title = $data["name"] . " · " . $title; @@ -141,7 +141,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; saving = true; try { - await window.fetch("/api/docs?id=", { + await window.fetch("/api/docs?id=", { method: "POST", body: JSON.stringify({ content: data, name: document.getElementById("document-name").innerText, category: document.getElementById("category").innerText }) }); @@ -289,7 +289,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
    -

    Marked for deletion

    +

    Marked for deletion

    " id="document-" class="list-group-item list-group-item-action document-listing opacity-75">   diff --git a/pages/edit.inc b/pages/edit.inc index 8be6730..4333044 100644 --- a/pages/edit.inc +++ b/pages/edit.inc @@ -21,7 +21,7 @@ $parts = explode("/", $_GET['_']); array_shift($parts); array_shift($parts); $system = $parts[0]; -$member = ($parts[1] ?? null) === "" ? null : $parts[1]; +$member = !isset($parts[1]) || $parts[1] === "" ? null : $parts[1]; if ($system !== "cloudburst" && $system !== "raindrops") header("Location: /?error=Invalid system name: " . $system) and die(); $systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; diff --git a/pages/parser.inc b/pages/parser.inc index dc07744..283006b 100644 --- a/pages/parser.inc +++ b/pages/parser.inc @@ -11,6 +11,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';

    Message parser

    Enter a message here, and we will tell you which system member this message came from.

    +
    + Notice: The prefix generator and message parser pages will be removed from Cold Haze starting November 1st, due to being unused, difficult to maintain and containing outdated information. Feel free to ask a system member if you need help figuring out who sent a specific message. +
    +
    diff --git a/pages/rules-old.inc b/pages/rules-old.inc new file mode 100644 index 0000000..21ae7e6 --- /dev/null +++ b/pages/rules-old.inc @@ -0,0 +1,253 @@ + $rule) { + if (!isset($rule["name"]) || !isset($rule["content"]) && !is_numeric($index)) { + header("Location: /-/rules"); + die(); + } + + if (trim($rule["name"]) === "") { + unset($_POST["payload"][$index]); + continue; + } + + if (!isset($rule["approved"])) $rule["approved"] = []; + if (isset($rule["approved"][0])) $rule["approved"][0] = true; else $rule["approved"][0] = false; + if (isset($rule["approved"][1])) $rule["approved"][1] = true; else $rule["approved"][1] = false; + + $_POST["payload"][$index] = $rule; + } + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", utf8_encode(json_encode($_POST["payload"]))); + + header("Location: /-/rules"); + die(); +} + +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; + +?> + +
    +
    +
    +

    Systems rules

    +

    Click on a rule to view additional details. Edit rules

    + + + +
      + +
    • +
      + + . + + Unapproved + + + +
      + This rule has not yet been approved. All rules need to be approved by the leaders from both systems. This rule is still missing approval from . +
      + +
      class="list-group-item"> + +
      +
      +
    • + +
    +
    +
    + + + + + + + + diff --git a/pages/rules.inc b/pages/rules.inc index 21ae7e6..eee3508 100644 --- a/pages/rules.inc +++ b/pages/rules.inc @@ -1,39 +1,6 @@ $rule) { - if (!isset($rule["name"]) || !isset($rule["content"]) && !is_numeric($index)) { - header("Location: /-/rules"); - die(); - } - - if (trim($rule["name"]) === "") { - unset($_POST["payload"][$index]); - continue; - } - - if (!isset($rule["approved"])) $rule["approved"] = []; - if (isset($rule["approved"][0])) $rule["approved"][0] = true; else $rule["approved"][0] = false; - if (isset($rule["approved"][1])) $rule["approved"][1] = true; else $rule["approved"][1] = false; - - $_POST["payload"][$index] = $rule; - } - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", utf8_encode(json_encode($_POST["payload"]))); - - header("Location: /-/rules"); - die(); -} - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -41,164 +8,95 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
    -

    Systems rules

    -

    Click on a rule to view additional details. Edit rules

    +

    General rules

    +

    Click on a rule in the list to view the history of that rule, including all amendments. Note that older versions of a rule cannot be enforced anymore and are provided only for informational purposes.

    - $pcName = getMiniName($protectorCloudburst["display_name"] ?? $protectorCloudburst["name"]); - $prName = getMiniName($protectorRaindrops["display_name"] ?? $protectorRaindrops["name"]); - - ?> +
      -
    • - . - - Unapproved + 0): ?>-: : + + +
        + 0): ?> + + + +
      • Curent version:
      • + +
      • Amendment Preamble-:
      • + + + +
      • Original rule:
      • + +
      • + This rule was never amended. +
      • +
      +
      +
    • +
    + + + +

    Articles .1 to .:

    + +
      + +
    • +
      + + Article . 0): ?>-: : - -
      - This rule has not yet been approved. All rules need to be approved by the leaders from both systems. This rule is still missing approval from . -
      - -
      class="list-group-item"> - -
      + +
        + 0): ?> + + + +
      • Curent version:
      • + +
      • Amendment Preamble-:
      • + + + +
      • Original rule:
      • + +
      • + This rule was never amended. +
      • + +
    • - +
    -
    -
    - - -