diff options
author | Minteck <contact@minteck.org> | 2022-05-24 23:06:46 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-05-24 23:06:46 +0200 |
commit | 94fea37d627a7f11a67d4eb472300dfa5abaafae (patch) | |
tree | 1729703dbc173ec7ffd574aacb24434d4cb96e38 | |
parent | a06bd771ff4ea43841edb8cba97df21258a9912b (diff) | |
download | vaportrail-94fea37d627a7f11a67d4eb472300dfa5abaafae.tar.gz vaportrail-94fea37d627a7f11a67d4eb472300dfa5abaafae.tar.bz2 vaportrail-94fea37d627a7f11a67d4eb472300dfa5abaafae.zip |
Pair programming with @CloudburstSys
-rw-r--r-- | .idea/copyright/MIT.xml | 6 | ||||
-rw-r--r-- | .idea/copyright/profiles_settings.xml | 3 | ||||
-rw-r--r-- | LICENSE | 21 | ||||
-rw-r--r-- | index.js | 62 | ||||
-rw-r--r-- | public/assets/custom.css | 29 | ||||
-rw-r--r-- | public/assets/scroll.js | 25 | ||||
-rw-r--r-- | public/assets/servers.js | 38 | ||||
-rw-r--r-- | refresh/pluralkit.js | 120 | ||||
-rw-r--r-- | refresh/servers.js (renamed from refresh.js) | 33 | ||||
-rw-r--r-- | views/index.ejs | 24 | ||||
-rw-r--r-- | views/partials/footer.ejs | 24 | ||||
-rw-r--r-- | views/partials/header.ejs | 24 | ||||
-rw-r--r-- | views/servers.ejs | 66 |
13 files changed, 458 insertions, 17 deletions
diff --git a/.idea/copyright/MIT.xml b/.idea/copyright/MIT.xml new file mode 100644 index 0000000..e75ed99 --- /dev/null +++ b/.idea/copyright/MIT.xml @@ -0,0 +1,6 @@ +<component name="CopyrightManager"> + <copyright> + <option name="notice" value="MIT License Copyright (c) &#36;{today.year}- Equestria.dev Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. " /> + <option name="myName" value="MIT" /> + </copyright> +</component>
\ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..c3ba54a --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ +<component name="CopyrightManager"> + <settings default="MIT" /> +</component>
\ No newline at end of file @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022- Equestria.dev Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
\ No newline at end of file @@ -1,39 +1,75 @@ +/* + * MIT License + * + * Copyright (c) 2022- Equestria.dev Developers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + // noinspection JSUnresolvedVariable,HttpUrlsUsage const express = require('express'); const app = express(); -app.use(express.static('public')); -app.set("view engine", "ejs"); - +// Public pages app.get('/', (req, res) => { res.render("index"); }); +app.get('/servers', (req, res) => { + res.render("servers"); +}); + // API -var serverCache = {}; +let serverCache = {}; +let pluralCache = {}; app.get("/api/servers", (req, res) => { res.json(serverCache); }); -const refresh = require('./refresh'); -setInterval(() => { +// Refresh handling +const refresh = require('./refresh/servers'); +const pkRefresh = require('./refresh/pluralkit'); +setInterval(cacheReload, 300000); + +function cacheReload() { console.log("Running refresh..."); refresh().then(data => { - console.log("Refresh done!"); + console.log("Refresh halfway done!"); serverCache = data; + pkRefresh().then(data => { + console.log("Refresh totally done!"); + pluralCache = data; + }); }); -}, 300000); +} + +// Server +app.use(express.static('public')); +app.set("view engine", "ejs"); const server = app.listen(8099, function () { let host = server.address().address let port = server.address().port console.log("Vapor Trail server listening at http://%s:%s", host, port) - console.log("Running refresh..."); - refresh().then(data => { - console.log("Refresh done!"); - serverCache = data; - }); + cacheReload(); })
\ No newline at end of file diff --git a/public/assets/custom.css b/public/assets/custom.css index d0a2f90..2fd749b 100644 --- a/public/assets/custom.css +++ b/public/assets/custom.css @@ -1,3 +1,28 @@ +/* + * MIT License + * + * Copyright (c) 2022- Equestria.dev Developers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + /** {*/ /* font-family: "Comic Sans MS", sans-serif !important;*/ /*}*/ @@ -76,4 +101,8 @@ html, body { .home-people-text { text-align: center; font-size: 36px; +} + +#navbar-skipper { + margin-top: 56px; }
\ No newline at end of file diff --git a/public/assets/scroll.js b/public/assets/scroll.js index a0c6b78..882ad0d 100644 --- a/public/assets/scroll.js +++ b/public/assets/scroll.js @@ -1,3 +1,28 @@ +/* + * MIT License + * + * Copyright (c) 2022- Equestria.dev Developers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + function posY(elm) { var test = elm, top = 0; diff --git a/public/assets/servers.js b/public/assets/servers.js new file mode 100644 index 0000000..6c6d129 --- /dev/null +++ b/public/assets/servers.js @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2022- Equestria.dev Developers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ +const SERVER_API = "/api/servers"; + +// apparently document.onload is never called??? +function a() { + console.log("a"); + fetch(SERVER_API) + .then(data => data = data.json()) + .then(data => { + console.log(data); + document.getElementById("canterlot").getElementsByClassName("cpu-type")[0].innerHTML = data.canterlot.cpu.model; + }); +} + +a();
\ No newline at end of file diff --git a/refresh/pluralkit.js b/refresh/pluralkit.js new file mode 100644 index 0000000..a0786e3 --- /dev/null +++ b/refresh/pluralkit.js @@ -0,0 +1,120 @@ +// noinspection JSDeprecatedSymbols,JSPrimitiveTypeWrapperUsage + +/* + * MIT License + * + * Copyright (c) 2022- Equestria.dev Developers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +const superagent = require("superagent"); +module.exports = () => { + // Code entered here will be run every 5 minutes + return new Promise(async (res) => { + let systems = [ + "gdapd", // Moonshine System + "ynmuc" // Cloudburst System + ] + + let stats = {} + + for (let system of systems) { + let status = { + available: true, + general: null, + members: null, + fronters: null, + switches: null + } + + superagent.get(`https://api.pluralkit.me/v2/systems/${system}`) + .timeout({ + response: 5000, + }) + .then(data => data = data.body) + .then(data => { + status.general = data; + superagent.get(`https://api.pluralkit.me/v2/systems/${system}/members`) + .timeout({ + response: 5000, + }) + .then(data => data = data.body) + .then(data => { + status.members = data; + superagent.get(`https://api.pluralkit.me/v2/systems/${system}/fronters`) + .timeout({ + response: 5000, + }) + .then(data => data = data.body) + .then(data => { + status.fronters = data; + }) + .catch(reason => { + if (reason.timeout) { + // We timed out. + status.available = false; + } else { + if(reason.code === "ECONNREFUSED") { + status.available = false; + console.warn("Error querying PluralKit API.") + } else { + console.error(reason); + } + } + }) + .finally(() => { + stats[system] = status; + + if(Object.keys(stats).length === systems.length) { + res(stats); + } + }); + }) + .catch(reason => { + if (reason.timeout) { + // We timed out. + status.available = false; + } else { + if(reason.code === "ECONNREFUSED") { + status.available = false; + console.warn("Error querying PluralKit API.") + } else { + console.error(reason); + } + } + }) + }) + .catch(reason => { + if (reason.timeout) { + // We timed out. + status.available = false; + } else { + if(reason.code === "ECONNREFUSED") { + status.available = false; + console.warn("Error querying PluralKit API.") + } else { + console.error(reason); + } + } + }) + } + }); +} diff --git a/refresh.js b/refresh/servers.js index 212a4cb..e6b7d25 100644 --- a/refresh.js +++ b/refresh/servers.js @@ -1,3 +1,28 @@ +/* + * MIT License + * + * Copyright (c) 2022- Equestria.dev Developers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + const dns = require("dns"); const superagent = require("superagent"); @@ -9,7 +34,7 @@ function resolveDNSAsync(domain) { family: 4, hints: dns.ADDRCONFIG | dns.V4MAPPED }; - dns.lookup(domain, options, (err, address, family) => { + dns.lookup(domain, options, (err, address) => { if (err) return rej(err); res(address); }); @@ -22,7 +47,7 @@ function roundToTwo(num) { module.exports = () => { // Code entered here will be run every 5 minutes - return new Promise(async (res, rej) => { + return new Promise(async (res) => { let servers = { canterlot: [await resolveDNSAsync("canterlot.equestria.dev"), 52937], ponyville: [await resolveDNSAsync("ponyville-ipv4.equestria.dev"), 52937], @@ -67,7 +92,7 @@ module.exports = () => { // We timed out. status.online = false; } else { - if(reason.code == "ECONNREFUSED") { + if(reason.code === "ECONNREFUSED") { status.online = false; console.warn(`Server ${key} refused our connection. `) } else { @@ -78,7 +103,7 @@ module.exports = () => { .finally(() => { stats[key] = status; - if(Object.keys(stats).length == Object.keys(servers).length) { + if(Object.keys(stats).length === Object.keys(servers).length) { res(stats); } }); diff --git a/views/index.ejs b/views/index.ejs index b618586..1f1661e 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,3 +1,27 @@ +<!-- + ~ MIT License + ~ + ~ Copyright (c) 2022- Equestria.dev Developers + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + ~ SOFTWARE. + ~ + --> <%- include("./partials/header.ejs", {title: "Home"}) %> <div id="hero"> <div id="hero-inner"> diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index 691287b..168dc25 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -1,2 +1,26 @@ +<!-- + ~ MIT License + ~ + ~ Copyright (c) 2022- Equestria.dev Developers + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + ~ SOFTWARE. + ~ + --> </body> </html>
\ No newline at end of file diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 57a3511..6a80ccf 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -1,3 +1,27 @@ +<!-- + ~ MIT License + ~ + ~ Copyright (c) 2022- Equestria.dev Developers + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + ~ SOFTWARE. + ~ + --> <!doctype html> <html lang="en"> <head> diff --git a/views/servers.ejs b/views/servers.ejs new file mode 100644 index 0000000..4f0e6e6 --- /dev/null +++ b/views/servers.ejs @@ -0,0 +1,66 @@ +<!-- + ~ MIT License + ~ + ~ Copyright (c) 2022- Equestria.dev Developers + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + ~ SOFTWARE. + ~ + --> +<%- include("./partials/header.ejs", {title: "Servers"}) %> + +<div id="navbar-skipper"> + <div class="server-container"> + <div class="server" id="canterlot"> + <h3 class="name">Canterlot</h3> + <div class="category cpu"> + <h4 class="name">CPU</h4> + <p>CPU Type: <span class="item cpu-type"></span></p> + <p>CPU Core count: <span class="item cpu-cores"></span></p> + <p>CPU Temperature: <span class="item cpu-temperature"></span></p> + <p>CPU Usage: <span class="item cpu-usage"></span></p> + <div class="subcategory processes"> + <h5 class="name">Processes</h5> + <p>Processes Total: <span class="item cpu-processes-total"></span></p> + <p>Processes Running: <span class="item cpu-processes-running"></span></p> + <p>Processes Sleeping: <span class="item cpu-processes-sleeping"></span></p> + <p>Processes Blocked: <span class="item cpu-processes-blocked"></span></p> + <p>Unknown Processes: <span class="item cpu-processes-unknown"></span></p> + </div> + </div> + <div class="category memory"> + <h4 class="name">Memory</h4> + <div class="subcategory swap"> + <h5 class="name">Swap</h5> + <p>Used Memory: <span class="item memory-swap-used"></span></p> + <p>Free Memory: <span class="item memory-swap-free"></span></p> + <p>Total Memory: <span class="item memory-swap-total"></span></p> + </div> + <div class="subcategory physical"> + <h5 class="name">Physical</h5> + <p>Used Memory: <span class="item memory-physical-used"></span></p> + <p>Free Memory: <span class="item memory-physical-free"></span></p> + <p>Total Memory: <span class="item memory-physical-total"></span></p> + </div> + </div> + </div> + </div> +</div> +<!-- Get the script which polls the API for server status --> +<script src="/assets/servers.js"></script> +<%- include("./partials/footer.ejs") %>
\ No newline at end of file |