diff --git a/README.MD b/README.MD index 412f15a..aadd988 100644 --- a/README.MD +++ b/README.MD @@ -1,5 +1,8 @@ # openCountdown # ToDo -- [ ] Improve duration picker in table view - [P] Endpoint docs +- [ ] Better WS frames +- [ ] Diffrent time picker for countdown selection +- [X] Deprecate old UI +- [X] Proper 404 page \ No newline at end of file diff --git a/index.js b/index.js index c42f705..c52dc3a 100644 --- a/index.js +++ b/index.js @@ -87,12 +87,6 @@ app.get("/", function (req, res) { res.send(data); }); -app.get("/old", function (req, res) { - const data = fs.readFileSync("templates/adminPanel.html", "utf8"); - res.send(data); -}); - - app.get("/timer", function (req, res) { const data = fs.readFileSync("templates/timerPage.html", "utf8"); res.send(data); @@ -104,6 +98,8 @@ app.get("/api/v1/data", function (req, res) { }); app.get("/api/v1/system", function (req, res) { + const tempPkgFile = fs.readFileSync("package.json", "utf8"); + const tempPkgObj = JSON.parse(tempPkgFile); const systemData = { uptime: process.uptime(), memoryUsage: process.memoryUsage(), @@ -118,6 +114,7 @@ app.get("/api/v1/system", function (req, res) { nodeEnv: process.env, nodeConfig: process.config, nodeTitle: process.title, + systemVersion: tempPkgObj.version } res.json(systemData); }); @@ -298,6 +295,28 @@ app.get("/api/v1/storage/delete", function (req, res) { updatedData() }); +app.use(function(req, res, next) { + res.status(404); + + // respond with html page + if (req.accepts('html')) { + const data = fs.readFileSync("templates/errorPages/404.html", "utf8"); + res.status(404) + res.send(data); + return; + } + + // respond with json + if (req.accepts('json')) { + res.json({ error: 'Not found' }); + return; + } + + // default to plain-text. send() + res.type('txt').send('Not found'); +}); + + console.log("Starting server..."); const port = 3006 diff --git a/package-lock.json b/package-lock.json index 03d3600..6e76bb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,24 @@ { "name": "opencountdown", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "opencountdown", - "version": "1.0.0", + "version": "1.0.1", "license": "LGPL-3.0", "dependencies": { "body-parser": "^1.19.2", "bootstrap": "^5.1.3", "bootstrap-duration-picker": "^2.1.3", "bootstrap-icons": "^1.8.1", - "countdown": "^2.6.0", "darkreader": "^4.9.44", "express": "^4.17.3", "jquery": "^3.6.0", "js-cookie": "^3.0.1", + "less": "^3.13", "mdbootstrap": "^4.20.0", - "moment": "^2.29.1", "ws": "^8.5.0" } }, @@ -135,10 +134,16 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "node_modules/countdown": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/countdown/-/countdown-2.6.0.tgz", - "integrity": "sha1-Z3+446nUzE52QVkBuiU7UYrzQXc=" + "node_modules/copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } }, "node_modules/darkreader": { "version": "4.9.44", @@ -183,6 +188,18 @@ "node": ">= 0.8" } }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "optional": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -269,6 +286,12 @@ "node": ">= 0.6" } }, + "node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "optional": true + }, "node_modules/http-errors": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", @@ -295,6 +318,18 @@ "node": ">=0.10.0" } }, + "node_modules/image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", + "optional": true, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -308,6 +343,11 @@ "node": ">= 0.10" } }, + "node_modules/is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==" + }, "node_modules/jquery": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", @@ -321,6 +361,43 @@ "node": ">=12" } }, + "node_modules/less": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/less/-/less-3.13.1.tgz", + "integrity": "sha512-SwA1aQXGUvp+P5XdZslUOhhLnClSLIjWvJhmd+Vgib5BFIr9lMNlQwmwUNOjXThF/A0x+MCYYPeWEfeWiLRnTw==", + "dependencies": { + "copy-anything": "^2.0.1", + "tslib": "^1.10.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "native-request": "^1.0.5", + "source-map": "~0.6.0" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "optional": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/mdbootstrap": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/mdbootstrap/-/mdbootstrap-4.20.0.tgz", @@ -377,19 +454,17 @@ "node": ">= 0.6" } }, - "node_modules/moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "node_modules/native-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/native-request/-/native-request-1.1.0.tgz", + "integrity": "sha512-uZ5rQaeRn15XmpgE0xoPL8YWqcX90VtCFglYwAgkvKM5e8fog+vePLAhHxuuv/gRkrQxIeh5U3q9sMNUrENqWw==", + "optional": true + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -422,6 +497,15 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -434,6 +518,12 @@ "node": ">= 0.10" } }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "optional": true + }, "node_modules/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", @@ -491,6 +581,15 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/send": { "version": "0.17.2", "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", @@ -538,6 +637,15 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -554,6 +662,11 @@ "node": ">=0.6" } }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -693,10 +806,13 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "countdown": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/countdown/-/countdown-2.6.0.tgz", - "integrity": "sha1-Z3+446nUzE52QVkBuiU7UYrzQXc=" + "copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "requires": { + "is-what": "^3.14.1" + } }, "darkreader": { "version": "4.9.44", @@ -731,6 +847,15 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "optional": true, + "requires": { + "prr": "~1.0.1" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -802,6 +927,12 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "optional": true + }, "http-errors": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", @@ -822,6 +953,12 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", + "optional": true + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -832,6 +969,11 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==" + }, "jquery": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", @@ -842,6 +984,32 @@ "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz", "integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==" }, + "less": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/less/-/less-3.13.1.tgz", + "integrity": "sha512-SwA1aQXGUvp+P5XdZslUOhhLnClSLIjWvJhmd+Vgib5BFIr9lMNlQwmwUNOjXThF/A0x+MCYYPeWEfeWiLRnTw==", + "requires": { + "copy-anything": "^2.0.1", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "native-request": "^1.0.5", + "source-map": "~0.6.0", + "tslib": "^1.10.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "optional": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "mdbootstrap": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/mdbootstrap/-/mdbootstrap-4.20.0.tgz", @@ -880,16 +1048,17 @@ "mime-db": "1.51.0" } }, - "moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "native-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/native-request/-/native-request-1.1.0.tgz", + "integrity": "sha512-uZ5rQaeRn15XmpgE0xoPL8YWqcX90VtCFglYwAgkvKM5e8fog+vePLAhHxuuv/gRkrQxIeh5U3q9sMNUrENqWw==", + "optional": true + }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -913,6 +1082,12 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "optional": true + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -922,6 +1097,12 @@ "ipaddr.js": "1.9.1" } }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "optional": true + }, "qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", @@ -953,6 +1134,12 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "optional": true + }, "send": { "version": "0.17.2", "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", @@ -996,6 +1183,12 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -1006,6 +1199,11 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", diff --git a/package.json b/package.json index 4480ea6..b52f836 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencountdown", - "version": "1.0.0", + "version": "1.0.1", "description": "An opensource countdown", "main": "index.js", "scripts": { @@ -13,13 +13,12 @@ "bootstrap": "^5.1.3", "bootstrap-duration-picker": "^2.1.3", "bootstrap-icons": "^1.8.1", - "countdown": "^2.6.0", "darkreader": "^4.9.44", "express": "^4.17.3", "jquery": "^3.6.0", "js-cookie": "^3.0.1", + "less": "^3.13", "mdbootstrap": "^4.20.0", - "moment": "^2.29.1", "ws": "^8.5.0" } } diff --git a/static/css/errorPage/style.css b/static/css/errorPage/style.css new file mode 100644 index 0000000..27a7671 --- /dev/null +++ b/static/css/errorPage/style.css @@ -0,0 +1,86 @@ +html, body { + height: 100%; + width: 100%; + margin: 0; + padding: 0; +} + +.container { + height: 100%; + width: 100%; + background-color: #0B161E; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-family: 'Segoe UI'; + text-align: center; +} + +.color-foreground { + color: #474849 !important; +} + +.text-shadow { + text-shadow: 1px 1px 2px; +} + +.rainbow { + -webkit-animation:rainbow 16s infinite; + -ms-animation:rainbow 16s infinite; + -o-animation:rainbow 16s infinite; + animation:rainbow 16s infinite; +} + +@-webkit-keyframes rainbow { +0% {color: #ff0000;} +10% {color: #ff8000;} +20% {color: #ffff00;} +30% {color: #80ff00;} +40% {color: #00ff00;} +50% {color: #00ff80;} +60% {color: #00ffff;} +70% {color: #0080ff;} +80% {color: #0000ff;} +90% {color: #8000ff;} +100% {color: #ff0080;} +} +@-ms-keyframes rainbow { +0% {color: #ff0000;} +10% {color: #ff8000;} +20% {color: #ffff00;} +30% {color: #80ff00;} +40% {color: #00ff00;} +50% {color: #00ff80;} +60% {color: #00ffff;} +70% {color: #0080ff;} +80% {color: #0000ff;} +90% {color: #8000ff;} +100% {color: #ff0080;} +} +@-o-keyframes rainbow { +0% {color: #ff0000;} +10% {color: #ff8000;} +20% {color: #ffff00;} +30% {color: #80ff00;} +40% {color: #00ff00;} +50% {color: #00ff80;} +60% {color: #00ffff;} +70% {color: #0080ff;} +80% {color: #0000ff;} +90% {color: #8000ff;} +100% {color: #ff0080;} +} +@keyframes rainbow { +0% {color: #ff0000;} +10% {color: #ff8000;} +20% {color: #ffff00;} +30% {color: #80ff00;} +40% {color: #00ff00;} +50% {color: #00ff80;} +60% {color: #00ffff;} +70% {color: #0080ff;} +80% {color: #0000ff;} +90% {color: #8000ff;} +100% {color: #ff0080;} +} \ No newline at end of file diff --git a/static/css/errorPage/styles.less b/static/css/errorPage/styles.less new file mode 100644 index 0000000..b2732f5 --- /dev/null +++ b/static/css/errorPage/styles.less @@ -0,0 +1,62 @@ +.glitch-wrapper { + height: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.glitch { + @offset1: 2px; + @offset2: -2px; + @highlight1: #49FC00; + @highlight2: spin(@highlight1, 180); + + color: white; + font-size: 150px; + text-transform: upercase; + position: relative; + display: inline-block; + + &::before, + &::after { + content: attr(data-text); + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #0B161E; + } + + &::before { + left: @offset1; + text-shadow: -2px 0 @highlight1; + clip: rect(24px, 550px, 90px, 0); + animation: glitch-anim-2 3s infinite linear alternate-reverse; + } + + &::after { + left: @offset2; + text-shadow: -2px 0 @highlight2; + clip: rect(85px, 550px, 140px, 0); + animation: glitch-anim 2.5s infinite linear alternate-reverse; + } +} + +.glitch-frames (@n: 20, @index: 0) when (@index <= @n) { + @keyframeSel: percentage(@index/@n); + @rand1: unit(round(`Math.random()*150`),px); + @rand2: unit(round(`Math.random()*150`), px); + @{keyframeSel} { + clip: rect(@rand1, 9999px, @rand2, 0); + } + .glitch-frames(@n, (@index + 1)); +} + +@keyframes glitch-anim { + .glitch-frames(24); +} + +@keyframes glitch-anim-2 { + .glitch-frames(30,2); +} \ No newline at end of file diff --git a/static/css/mainStyle.css b/static/css/mainStyle.css index 29bd68c..e72f03b 100644 --- a/static/css/mainStyle.css +++ b/static/css/mainStyle.css @@ -10,7 +10,7 @@ body { main { display: flex; flex-wrap: nowrap; - height: 100vh; + height: 100vh !important; height: -webkit-fill-available; max-height: 100vh; overflow-x: auto; diff --git a/static/js/countdown.js b/static/js/countdown.js deleted file mode 120000 index 71edd1e..0000000 --- a/static/js/countdown.js +++ /dev/null @@ -1 +0,0 @@ -../../node_modules/countdown/countdown.js \ No newline at end of file diff --git a/static/js/interface.js b/static/js/interface.js index 402d313..35a7843 100644 --- a/static/js/interface.js +++ b/static/js/interface.js @@ -40,9 +40,10 @@ $(function () { } } - saveOption("/api/v1/system", function systemInfo(event) { - const dataSystem = JSON.parse(event.originalTarget.response) + saveOption("/api/v1/system", function systemInfoLoader(event) { + const dataSystem = JSON.parse(event.target.response) document.getElementById("nodejsVers").innerHTML = dataSystem.nodeVersion + document.getElementById("nodeSwVers").innerHTML = dataSystem.systemVersion const tree2 = jsonview.create(dataSystem); jsonview.render(tree2, document.getElementById("systemInfo")); @@ -95,8 +96,6 @@ $(function () { onChanged: function (newVal, test, val2) { // $('#duration-label2').text(newVal); val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value = newVal - //console.log(val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1].value) - //console.log(val2.days[0].parentElement.parentElement.parentElement.parentElement.children[1]) } }); }); @@ -105,25 +104,11 @@ $(function () { // Restore settings saveOption("/api/v1/data", function (event, xmlHttp) { - - const tableEntry = '