diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/assets/css/bundle.css | 368 | ||||
-rw-r--r-- | public/assets/js/bundle.js | 428 | ||||
-rw-r--r-- | public/assets/logo/0.5x/Icon@0.5x.png | bin | 0 -> 18002 bytes | |||
-rw-r--r-- | public/assets/logo/150h/Icon.png | bin | 0 -> 3731 bytes | |||
-rw-r--r-- | public/assets/logo/1x/Icon.png | bin | 0 -> 41166 bytes | |||
-rw-r--r-- | public/index.html | 66 | ||||
-rw-r--r-- | public/logviewer.html | 64 | ||||
-rw-r--r-- | public/neo_ide.html | 274 | ||||
-rw-r--r-- | public/scripts.html | 73 | ||||
-rw-r--r-- | public/settings.html | 50 | ||||
-rw-r--r-- | public/strip_setup.html | 131 | ||||
-rw-r--r-- | public/update/index.html | 47 |
12 files changed, 1501 insertions, 0 deletions
diff --git a/public/assets/css/bundle.css b/public/assets/css/bundle.css new file mode 100644 index 0000000..fc0b937 --- /dev/null +++ b/public/assets/css/bundle.css @@ -0,0 +1,368 @@ +.general header, .general main, .general footer { + padding-left: 300px; } + +.general header .brand-logo { + padding-left: 15px; } + +@media only screen and (max-width: 992px) { + .general header, .general main, .general footer { + padding-left: 0; } } + +.general .user-view { + margin-top: 5px; + height: 150px; } + +.general .user-view .background { + margin-left: 85px; } + +@keyframes highlightNew { + 0% { + background-color: #ffc107; } + 100% { + background-color: white; } } + +.general .newLogEntry { + -webkit-animation-name: highlightNew; + /* Safari 4.0 - 8.0 */ + -webkit-animation-duration: 4s; + /* Safari 4.0 - 8.0 */ + animation-name: highlightNew; + animation-duration: 4s; } + +#scripts .script-list .badge { + margin-left: 0; + float: none; } + +#scripts .card { + /*margin-bottom: 60px;*/ } + +@media only screen and (max-width: 599px) { + #scripts .card-action { + border-top: 0 !important; + padding: 0 !important; + height: 0; + transition: padding 0.5s ease 0s, height 0.5s ease 0s; } + #scripts .card-action a i { + transform: scale(0); + transition: transform 0.1s ease 0.1s; } + #scripts .card:hover > .card-action { + height: 55px; + padding: 16px 24px !important; } + #scripts .card:hover > .card-action > a > i { + transform: scale(1); } } + +.neo_ide html, +.neo_ide body { + height: 100%; + font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + padding: 0; + margin: 0; + /*margin-top: -20px;*/ + overflow: auto; } + +.neo_ide #editor { + width: 100%; + height: 100%; + margin: -10px; } + +.neo_ide .page-container { + display: flex; + flex-direction: column; + justify-content: center; } + +.neo_ide .nav-container { + width: 100%; + height: 45px; + background-color: #333333; } + .neo_ide .nav-container ul { + display: flex; + flex-direction: row; + justify-content: space-between; + flex: 1; + align-self: center; + width: 100%; + list-style: none; } + .neo_ide .nav-container ul .left { + color: white; + padding: 15px; + margin-left: -40px; + margin-top: -19px; + font-size: 20px; } + .neo_ide .nav-container ul .center { + color: white; } + .neo_ide .nav-container ul .right { + width: 80px; + margin-right: 174px; + color: white; } + .neo_ide .nav-container ul .right .button { + padding: 15px; + margin-top: -15px; } + .neo_ide .nav-container .fileName { + color: grey; } + .neo_ide .nav-container ul .button:hover { + background-color: black; } + +@keyframes menuBarIn { + from { + height: 0; } + to { + height: 25px; } } + +@keyframes menuBarOut { + from { + height: 25px; } + to { + height: 0; } } + +.neo_ide .menuBarIn { + animation-name: menuBarIn; + animation-duration: 0.5s; + height: 25px !important; } + +.neo_ide .menuBarOut { + animation-name: menuBarOut; + animation-duration: 0.5s; + height: 0px !important; } + +.neo_ide .menubar-container { + background-color: #4e4e4e; + height: 0; } + .neo_ide .menubar-container ul { + display: flex; + flex-direction: row; + flex: 1; + width: 100%; + list-style: none; + margin-top: 2px; + margin-left: -30px; } + .neo_ide .menubar-container .button { + background-color: #3e3e3e; + color: white; + padding: 3px 10px 3px 10px; + margin-right: 4px; + font-size: 13px; + border-radius: 7px; } + .neo_ide .menubar-container .button:hover { + background-color: black; } + +.neo_ide .panel-container { + display: flex; + flex-direction: column; + flex: 1; + overflow: hidden; } + .neo_ide .panel-container .panel-top { + flex: 0 0 auto; + padding: 10px; + height: 80%; + width: 100%; + white-space: nowrap; + background: #838383; + color: white; } + .neo_ide .panel-container .splitter { + flex: 0 0 auto; + margin-top: -20px; + height: 25px; + background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/hsizegrip.png) center center no-repeat #535353; + cursor: row-resize; } + .neo_ide .panel-container .splitter .text { + margin-left: 10px; + margin-top: 4px; + color: #cccccc; } + .neo_ide .panel-container .splitter .text span { + margin-left: 5px; } + .neo_ide .panel-container .panel-bottom { + flex: 1 1 auto; + padding: 10px; + /*min-height: 200px;*/ + background: black; + color: white; + overflow-y: scroll; } + .neo_ide .panel-container .panel-bottom pre { + margin-top: -10px; } + .neo_ide .panel-container .panel-bottom pre .stdout { + color: white; } + .neo_ide .panel-container .panel-bottom pre .stderr { + color: red; } + .neo_ide .panel-container .panel-bottom pre .close { + color: yellow; } + +.neo_ide label { + font-size: 1.2em; + display: block; + font-weight: bold; + margin: 30px 0 10px; } + +.neo_ide .page-loader { + position: absolute; + margin: 0; + padding: 0; + border: 0; + width: 100vw; + height: 100vh; + background-color: #1fa2ed; + color: #fff; } + .neo_ide .page-loader .loader { + display: flex; + justify-content: center; + flex-flow: nowrap column; + align-items: center; + min-height: 100vh; } + .neo_ide .page-loader .loading { + display: flex; + margin: 24px 0; } + .neo_ide .page-loader .loading__element { + font: normal 100 2rem/1 Roboto; + letter-spacing: .5em; } + .neo_ide .page-loader [class*="el"] { + animation: bouncing 3s infinite ease; } + .neo_ide .page-loader .el1 { + animation-delay: 0.1s; } + .neo_ide .page-loader .el2 { + animation-delay: 0.2s; } + .neo_ide .page-loader .el3 { + animation-delay: 0.3s; } + .neo_ide .page-loader .el4 { + animation-delay: 0.4s; } + .neo_ide .page-loader .el5 { + animation-delay: 0.5s; } + .neo_ide .page-loader .el6 { + animation-delay: 0.6s; } + .neo_ide .page-loader .el7 { + animation-delay: 0.7s; } + .neo_ide .page-loader .el8 { + animation-delay: 0.8s; } + .neo_ide .page-loader .el9 { + animation-delay: 0.9s; } + .neo_ide .page-loader .el10 { + animation-delay: 1s; } + .neo_ide .page-loader .el11 { + animation-delay: 1.1s; } + .neo_ide .page-loader .el12 { + animation-delay: 1.2s; } + .neo_ide .page-loader .el13 { + animation-delay: 1.3s; } + .neo_ide .page-loader .el14 { + animation-delay: 1.4s; } + .neo_ide .page-loader .el15 { + animation-delay: 1.5s; } + .neo_ide .page-loader .el16 { + animation-delay: 1.6s; } + .neo_ide .page-loader .el17 { + animation-delay: 1.7s; } + .neo_ide .page-loader .el18 { + animation-delay: 1.8s; } + .neo_ide .page-loader .el19 { + animation-delay: 1.9s; } + +@keyframes bouncing { + 0%, 100% { + transform: scale3d(1, 1, 1); } + 50% { + transform: scale3d(0, 0, 1); } } + .neo_ide .page-loader .current-event { + color: rgba(255, 255, 255, 0.53); + font: normal 100 1rem/1 Roboto; + letter-spacing: .1em; } + +#update * { + margin: 0; + padding: 0; + border: 0; + box-sizing: border-box; } + #update *:before, #update *:after { + box-sizing: inherit; } + +#update html { + width: 100vw; + height: 100vh; } + +#update body { + background-color: #1fa2ed; + color: #fff; } + +#update .start-screen { + display: flex; + justify-content: center; + flex-flow: nowrap column; + align-items: center; + min-height: 100vh; } + +#update .loading { + display: flex; + margin: 24px 0; } + +#update .loading__element { + font: normal 100 2rem/1 Roboto; + letter-spacing: .5em; } + +#update [class*="el"] { + animation: bouncing 3s infinite ease; } + +#update .el1 { + animation-delay: 0.1s; } + +#update .el2 { + animation-delay: 0.2s; } + +#update .el3 { + animation-delay: 0.3s; } + +#update .el4 { + animation-delay: 0.4s; } + +#update .el5 { + animation-delay: 0.5s; } + +#update .el6 { + animation-delay: 0.6s; } + +#update .el7 { + animation-delay: 0.7s; } + +#update .el8 { + animation-delay: 0.8s; } + +#update .el9 { + animation-delay: 0.9s; } + +#update .el10 { + animation-delay: 1s; } + +#update .el11 { + animation-delay: 1.1s; } + +#update .el12 { + animation-delay: 1.2s; } + +#update .el13 { + animation-delay: 1.3s; } + +#update .el14 { + animation-delay: 1.4s; } + +#update .el15 { + animation-delay: 1.5s; } + +#update .el16 { + animation-delay: 1.6s; } + +#update .el17 { + animation-delay: 1.7s; } + +#update .el18 { + animation-delay: 1.8s; } + +#update .el19 { + animation-delay: 1.9s; } + +@keyframes bouncing { + 0%, 100% { + transform: scale3d(1, 1, 1); } + 50% { + transform: scale3d(0, 0, 1); } } + +#update .current-event { + color: rgba(255, 255, 255, 0.53); + font: normal 100 1rem/1 Roboto; + letter-spacing: .1em; } + diff --git a/public/assets/js/bundle.js b/public/assets/js/bundle.js new file mode 100644 index 0000000..75bdf8d --- /dev/null +++ b/public/assets/js/bundle.js @@ -0,0 +1,428 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +// General JavaScript +__webpack_require__ (1)(); + +// Page-specific JavaScript +const pageName = document.getElementsByTagName("body")[0].id; +try { + __webpack_require__(3)("./" + pageName)(); +} catch (error) { + console.log( + "Something went wrong when loading the js for this page...\n" + + "The pageName is \"" + pageName + "\".\n" + + "If it was excpected to get js for this page, please check the filename, and recompile webpack." + ); +} + +// Require all styles +__webpack_require__(8); + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +let sidenav = __webpack_require__(2); + +module.exports = () => { + const pageName = document.getElementsByTagName("body")[0].id; + if (pageName == "neo_ide") { return; } + + document.getElementById("sidenav").innerHTML = sidenav; + + M.AutoInit(); +}; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = ` +<ul id="slide-out" class="sidenav sidenav-fixed"> + <li> + <div class="user-view"> + <div class="background"> + <img src="./logo/150h/Icon.png"> + </div> + <!--<a href="#!user"><img class="circle" src="https://picsum.photos/200/300/?random"></a> + <a href="#!name"><span class="white-text name">John Doe</span></a> + <a href="#!email"><span class="white-text email">Guest</span></a>--> + </div> + </li> + <li><div class="divider"></div></li> + <li><a class="waves-effect" href="/"><i class="material-icons">dashboard</i> Dashboard</a></li> + <li><a class="waves-effect" href="/scripts"><i class="material-icons">cloud</i> Scripts</a></li> + <li><a class="waves-effect" href="/logviewer"><i class="material-icons">timeline</i> LogViewer</a></li> + <li><div class="divider"></div></li> + <li><a class="subheader">Settings</a></li> + <li><a class="waves-effect" href="strip_setup"><i class="material-icons">straighten</i> Strip setup</a></li> + <li><a class="waves-effect" href="/settings"><i class="material-icons">settings</i> Settings</a></li> +</ul> +`; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var map = { + "./": 4, + "./general": 1, + "./general.js": 1, + "./index": 4, + "./index.js": 4, + "./logviewer": 5, + "./logviewer.js": 5, + "./neo_ide": 6, + "./neo_ide.js": 6, + "./scripts": 7, + "./scripts.js": 7 +}; + + +function webpackContext(req) { + var id = webpackContextResolve(req); + return __webpack_require__(id); +} +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) { // check for number or string + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return id; +} +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = 3; + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +let socket = io(); + +module.exports = () => { + M.AutoInit(); + setupSocket(); + + setInterval(() => { + socket.emit("GetGeneralInfo"); + }, 500); + + socket.emit("GetLog", {filter: "success error event", entryN: 10}); +}; + +function setupSocket() { + + socket.on("lastLogEntries", (entries) => { + let list = ""; + entries.forEach((entry) => { + list += "<tr><td>" + prettifyType(entry.type) + "</td><td>" + entry.time + "</td><td>" + entry.details + "</td></tr>"; + }); + + document.getElementById("log-table-body").innerHTML = list; + M.AutoInit(); + }); + + socket.on("newLogEntry", (entry) => { + // Start with parsing the new entry, no reason to select the DOM-element and stuff, if we are filtering out the entry anyway. + let type = entry.type; + if ( (type.toUpperCase() !== "SUCCESS") && (type.toUpperCase() !== "ERROR") && (type.toUpperCase() !== "EVENT") && (type.toUpperCase() !== "INFO")) { + return; + } + + let logTable = document.getElementById("log-table-body"); + + let LTable = logTable.rows.length; + logTable.deleteRow(LTable - 1); // Since length outputs a 1-based number + + let newEntry = logTable.insertRow(0); + newEntry.insertCell(0).innerHTML = prettifyType(entry.type); + newEntry.insertCell(1).innerHTML = entry.time; + newEntry.insertCell(2).innerHTML = entry.details; + M.AutoInit(); + newEntry.className = "newLogEntry"; + }); + + socket.on("generalInfo", (info) => { + if (info["scriptIsExited"]) { + document.getElementById("currentScript").innerHTML = info["currentScript"] + " (exited)"; + } else { + document.getElementById("currentScript").innerHTML = info["currentScript"]; + } + document.getElementById("uptime").innerHTML = info["uptime"] + " seconds"; + }); + +} + +function prettifyType(type) { + let prettyTable = { + "DEBUG": `<span class="tooltipped" data-position="top" data-tooltip="Debug-log">😸</span>`, + "INFO": `<span class="tooltipped" data-position="top" data-tooltip="Just some information">ℹ️</span>`, + "WARNING": `<span class="tooltipped" data-position="top" data-tooltip="A warning">⚠️</span>`, + "EVENT": `<span class="tooltipped" data-position="top" data-tooltip="Event">⚡️</span>`, + "SUCCESS": `<span class="tooltipped" data-position="top" data-tooltip="Something exited successfully">✅</span>`, + "ERROR": `<span class="tooltipped" data-position="top" data-tooltip="Error">🔴</span>`, + "PYTHON": `<span class="tooltipped" data-position="top" data-tooltip="Output from user-script">🐍</span>` + }; + return prettyTable[type]; +} + + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +let socket = io(); + +module.exports = () => { + M.AutoInit(); + + socket.emit("GetLog", {filter: "success error event debug python info warning", entryN: 1000}); + socket.on("lastLogEntries", (entries) => { + M.toast({html: "Loading log-files..."}); + console.log("Log-entries received: " + entries.length); + let HTMLBasicTable = ""; + let HTMLAdvancedTable = ""; + let HTMLScriptTable = ""; + let HTMLRAWTable = ""; + + entries.forEach((entry) => { + let strHTML = "<tr><td>" + prettifyType(entry.type) + "</td><td>" + entry.time + "</td><td>" + entry.details + "</td></tr>"; + + if (entry.type === "SUCCESS") { HTMLBasicTable += strHTML; } + if (entry.type === "ERROR") { HTMLBasicTable += strHTML; } + if (entry.type === "EVENT") { HTMLBasicTable += strHTML; } + if (entry.type === "PYTHON") { HTMLScriptTable += strHTML; } + if (entry.type !== "PYTHON") { HTMLAdvancedTable += strHTML; } + + //HTMLRAWTable += entry.join(" "); + }); + + document.getElementById("log-table-basic").innerHTML = HTMLBasicTable; + document.getElementById("log-table-script").innerHTML = HTMLScriptTable; + document.getElementById("log-table-advanced").innerHTML = HTMLAdvancedTable; + //document.getElementById("log-table-raw").innerHTML = HTMLRAWTable; + + }); + + socket.on("newLogEntry", (entry) => { + if (entry.type === "SUCCESS") { appendEntryToTable("log-table-basic", entry); } + if (entry.type === "ERROR") { appendEntryToTable("log-table-basic", entry); } + if (entry.type === "EVENT") { appendEntryToTable("log-table-basic", entry); } + if (entry.type === "PYTHON") { appendEntryToTable("log-table-script", entry); } + if (entry.type !== "PYTHON") { appendEntryToTable("log-table-advanced", entry); } + }); + +}; + +function appendEntryToTable(tableName, entry) { + let newEntry = document.getElementById(tableName).insertRow(0); + newEntry.insertCell(0).innerHTML = prettifyType(entry.type); + newEntry.insertCell(1).innerHTML = entry.time; + newEntry.insertCell(2).innerHTML = entry.details; + M.AutoInit(); + newEntry.className = "newLogEntry"; +} + +function prettifyType(type) { + let prettyTable = { + "DEBUG": `<span class="tooltipped" data-position="top" data-tooltip="Debug-log">😸</span>`, + "INFO": `<span class="tooltipped" data-position="top" data-tooltip="Just some information">ℹ️</span>`, + "WARNING": `<span class="tooltipped" data-position="top" data-tooltip="A warning">⚠️</span>`, + "EVENT": `<span class="tooltipped" data-position="top" data-tooltip="Event">⚡️</span>`, + "SUCCESS": `<span class="tooltipped" data-position="top" data-tooltip="Something exited successfully">✅</span>`, + "ERROR": `<span class="tooltipped" data-position="top" data-tooltip="Error">🔴</span>`, + "PYTHON": `<span class="tooltipped" data-position="top" data-tooltip="Output from user-script">🐍</span>` + }; + return prettyTable[type]; +} + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +module.exports = () => { + + +}; + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +module.exports = () => { + let socket = io(); + socket.emit("GetScripts", {}); + + socket.on("updatedScriptList", (scriptList) => { + let localScriptsHTML = ""; + let remoteScriptsHTML = ""; + + for (let i = 0; i < scriptList.length; i++) { + if (scriptList[i].loc !== "local") { continue; } + let HTMLElem = "<li><div class=\"col s12 m4\"><div class=\"card blue darken-1\"><div class=\"card-content white-text\"><p class=\"card-title\">{{script_name}}</p><p>{{badges}}</p></div><div class=\"card-action white\">{{buttons}}</div></div></div></li>"; + if (scriptList[i].loc === "local") { + HTMLElem = HTMLElem.replace("{{badges}}", ""); + HTMLElem = HTMLElem.replace("{{script_name}}", scriptList[i].name); + HTMLElem = HTMLElem.replace("{{buttons}}", + "<a class=\"selectScript\" data-path=" + scriptList[i].path + "><i class=\"material-icons\">play_arrow</i></a>" + + "<a class=\"editScript\" data-path=" + scriptList[i].path + "><i class=\"material-icons\">edit</i></a>" + + "<a class=\"deleteScript\" data-path=" + scriptList[i].path + "><i class=\"material-icons\">delete_forever</i></a>" + ); + localScriptsHTML += HTMLElem; + } else if (scriptList[i].loc === "remote") { + HTMLElem = HTMLElem.replace("{{badges}}", "<span class=\"badge yellow darken-1 white-text\">GitHub</span>"); + HTMLElem = HTMLElem.replace("{{script_name}}", scriptList[i].name); + remoteScriptsHTML += HTMLElem; + } + } + + document.getElementById("local-scripts").innerHTML = localScriptsHTML; + document.getElementById("remote-scripts").innerHTML = remoteScriptsHTML; + + }); + + /* + The delays here with settimeout, is set to a second deliberately, because, rather than making a whole checking-thing. + We just wait a second, and assume, that if it worked, the change should show now. Else, check the logViewer. + */ + function clickHandler(event) { + let element = event.target.parentElement; + + if (element.className === "selectScript") { + M.toast({html: "Now selecting script: " + element.dataset.path}); + socket.emit("SelectScript", {"scriptPath": element.dataset.path}); + + } else if (element.className === "editScript") { + window.location.href = ( + "http://" + window.location.hostname + ":" + window.location.port + + "/neo_ide?scriptName=" + btoa(element.dataset.path) + ); + + } else if (element.className === "deleteScript") { + if (confirm("Do you really want to delete this script?\n" + element.dataset.path + "\n\nYou can not undo this action, and the script will be lost forever...")) { + M.toast({html: "Trying to create script. If no change after a second. Check the logViewer."}); + socket.emit("DeleteScript", {"scriptPath": element.dataset.path}); + setTimeout(() => {socket.emit("GetScripts", {})}, 1000); + } + + } else if (element.id === "createEmptyScript") { + var scriptName = prompt("Please enter the name of the new script:"); + if (scriptName != null || scriptName != "") { + M.toast({html: "Trying to create script. If no change after a second. Check the logViewer."}); + socket.emit("CreateEmptyScript", {"scriptName": scriptName}); + setTimeout(() => {socket.emit("GetScripts", {})}, 1000); + } + + } + + } + + addEventListener("click", clickHandler, false); + +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }) +/******/ ]);
\ No newline at end of file diff --git a/public/assets/logo/0.5x/Icon@0.5x.png b/public/assets/logo/0.5x/Icon@0.5x.png Binary files differnew file mode 100644 index 0000000..3af8d3f --- /dev/null +++ b/public/assets/logo/0.5x/Icon@0.5x.png diff --git a/public/assets/logo/150h/Icon.png b/public/assets/logo/150h/Icon.png Binary files differnew file mode 100644 index 0000000..3fd003b --- /dev/null +++ b/public/assets/logo/150h/Icon.png diff --git a/public/assets/logo/1x/Icon.png b/public/assets/logo/1x/Icon.png Binary files differnew file mode 100644 index 0000000..cda811f --- /dev/null +++ b/public/assets/logo/1x/Icon.png diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..db2faac --- /dev/null +++ b/public/index.html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html class="general"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>Luxcena Neo</title> + + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/css/materialize.min.css"> + <link rel="stylesheet" href="/css/bundle.css" type="text/css" /> + </head> + + <body id="index"> + <header> + <nav> + <div class="nav-wrapper"> + <a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a> + <a href="#" class="brand-logo">Luxcena Neo</a> + </div> + </nav> + <div id="sidenav"></div> + </header> + + <main> + <div class=""> + + <div class="row"> + + <div class="col s12 m6"> + <div class="card light-green lighten-1"> + <div class="card-content"> + <span class="card-title">General</span> + <p> + <b>Current script:</b> <span id="currentScript"></span> <br /> + <b>Uptime:</b> <span id="uptime"></span> + </p> + </div> + </div> + </div> + + <div class="col s12 m12"> + <div class="card lighten-3"> + <div class="card-content"> + <span class="card-title">Logs</span> + <table class="highlight" id="log-table"> + <tbody id="log-table-body"></tbody> + </table> + </div> + <div class="card-action"> + <a href="/logviewer">Open LogViewer</a> + </div> + </div> + </div> + + </div> + + </div> + + </main> + + + <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> + <script src="/socket.io/socket.io.js"></script> + <script type="text/javascript" src="/js/bundle.js"></script> + </body> +</html> diff --git a/public/logviewer.html b/public/logviewer.html new file mode 100644 index 0000000..7b94a61 --- /dev/null +++ b/public/logviewer.html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html class="general"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>Luxcena Neo - LogViewer</title> + + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/css/materialize.min.css"> + <link rel="stylesheet" href="/css/bundle.css" type="text/css" /> + </head> + + <body id="logviewer"> + <header> + <nav class="nav-extended"> + <div class="nav-wrapper"> + <a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a> + <a href="#" class="brand-logo">Luxcena Neo</a> + </div> + <div class="nav-content"> + <ul class="tabs tabs-transparent"> + <li class="tab"><a class="active" href="#basic">Basic</a></li> + <li class="tab"><a href="#advanced">Advanced</a></li> + <li class="tab"><a href="#script">Script</a></li> + <li class="tab"><a href="#raw">RAW</a></li> + </ul> + </div> + </nav> + <div id="sidenav"></div> + </header> + + <main class="row"> + <div id="basic" class="col s12"> + <table class="highlight log-table"> + <tbody id="log-table-basic" class="log-table-body"></tbody> + </table> + </div> + <div id="advanced" class="col s12"> + <table class="highlight log-table"> + <tbody id="log-table-advanced" class="log-table-body"></tbody> + </table> + </div> + <div id="script" class="col s12"> + <table class="highlight log-table"> + <tbody id="log-table-script" class="log-table-body"></tbody> + </table> + </div> + <div id="raw" class="col s12"> + <div class="col s12 m12"> + <div class="card lighten-3"> + <div class="card-content"> + This is nothing useful at the moment. Please view the file in your terminal. If you want to watch it, you can go to the rootDir of Luxcena-Neo, and type: + <pre>tail -fn 20 usrData/logs/logger.log</pre> + This will show the last twenty lines of the file, an show any new lines. + </div> + </div> + </div> + </div> + </main> + + <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> + <script src="/socket.io/socket.io.js"></script> + <script type="text/javascript" src="/js/bundle.js"></script> + </body> +</html> diff --git a/public/neo_ide.html b/public/neo_ide.html new file mode 100644 index 0000000..584b5ea --- /dev/null +++ b/public/neo_ide.html @@ -0,0 +1,274 @@ +<!DOCTYPE html> +<html class="neo_ide" style="overflow:hidden;"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>Luxcena Neo - Neo IDE</title> + + <link rel="stylesheet" href="/css/bundle.css" type="text/css" /> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous"> + </head> + + <body id="neo_ide"> + + <!--<div class="page-loader"> + <div class="loader"> + <div class="loading"> + <div class="loading__element el1">L</div> + <div class="loading__element el2">O</div> + <div class="loading__element el3">A</div> + <div class="loading__element el4">D</div> + <div class="loading__element el5">I</div> + <div class="loading__element el6">N</div> + <div class="loading__element el7">G</div> + <div class="loading__element el8">.</div> + <div class="loading__element el9">.</div> + <div class="loading__element el10">.</div> + </div> + <div class="current-event"> + <p id="event-text"></p> + </div> + </div> + <div class="error"> + <h1>ERROR</h1> + </error> + </div>--> + + <div class="page-container"> + + <nav class="nav-container"> + <ul> + <li id="back_button" class="left button"><i class="fas fa-chevron-left"></i></li> + <li class="center">Neo IDE - <span class="fileName"></span></li> + <li class="right"> + <ul> + <li id="toggle_menu" class="button"><i class="fas fa-caret-down"></i></li> + <li id="save_button" class="button"><i class="fas fa-save"></i></li> + <li id="stop_button" class="button"><i class="fas fa-stop"></i></li> + <li id="start_button" class="button"><i class="fas fa-play"></i></li> + </ul> + </li> + </ul> + </nav> + + <div class="menubar-container"> + <ul> + <li id="toggle_output_button" class="button"></i>Toggle output</li> + </ul> + </div> + + <div class="panel-container"> + <div class="panel-top"> + <div id="editor"></div> + </div> + + <div class="splitter"> + <div class="text"> + <i class="fas fa-terminal"></i> + <span>output</span> + </div> + </div> + + <div class="panel-bottom"><pre></pre></div> + </div> + + </div> + + <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> + <script src="/socket.io/socket.io.js"></script> + <script type="text/javascript" src="/js/bundle.js"></script> + <script type="text/javascript" src="https://rawgit.com/RickStrahl/jquery-resizable/master/src/jquery-resizable.js"></script> + <script src="/monaco-editor/min/vs/loader.js"></script> + <script> + require.config({ paths: { 'vs': 'monaco-editor/min/vs' }}); + let editor = undefined; + let socket = io(); + let outputLines = 0; + + function resize() { + let screenH = window.innerHeight; + + $(".panel-container").css("height", (screenH - 45) + "px"); + $(".panel-bottom").css("height", document.getElementsByClassName("panel-bottom")[0].clientHeight); + editor.layout(); + } + + function findGetParameter(parameterName) { + var result = null, + tmp = []; + location.search + .substr(1) + .split("&") + .forEach(function (item) { + tmp = item.split("="); + if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); + }); + return result; + } + + require(['vs/editor/editor.main'], function() { + + monaco.editor.defineTheme('neoIdeDark', { + base: 'vs-dark', + inherit: true, // can also be false to completely replace the builtin rules + rules: [ + { token: 'eachSecond(self)', foreground: 'ffa500', fontStyle: 'italic underline' }, + { token: 'string.LuxcenaNeo', foreground: '008800', fontStyle: 'bold' }, + { token: 'comment.css', foreground: '0000ff' } // will inherit fontStyle from `comment` above + ] + }); + + editor = monaco.editor.create(document.getElementById('editor'), { + value: [""].join('\n'), + language: 'python', + theme: 'neoIdeDark' + }); + + let decorations = editor.deltaDecorations([], [ + { range: new monaco.Range(3,1,5,1), options: { isWholeLine: true, linesDecorationsClassName: 'myLineDecoration' }}, + { range: new monaco.Range(7,1,7,24), options: { inlineClassName: 'myInlineDecoration' }}, + ]); + + let runScriptBinding = editor.addCommand(monaco.KeyCode.F5, function() { + alert('F5 pressed!'); + }); + + resize(); + socket.emit("NeoIde_GetScript", {"scriptPath": atob(findGetParameter("scriptName"))}); + }); + + $(".panel-top").resizable({ + handleSelector: ".splitter", + resizeWidth: false, + onDrag: resize + }); + + $("#toggle_menu").on("click", () => { + if ($(".menubar-container").hasClass("menuBarIn")) { + $(".menubar-container").removeClass("menuBarIn"); + $(".menubar-container").addClass("menuBarOut"); + $("#toggle_menu i").removeClass("fa-caret-up"); + $("#toggle_menu i").addClass("fa-caret-down"); + } else { + $(".menubar-container").removeClass("menuBarOut"); + $(".menubar-container").addClass("menuBarIn"); + $("#toggle_menu i").removeClass("fa-caret-down"); + $("#toggle_menu i").addClass("fa-caret-up"); + } + }); + + $("#back_button").on("click", () => { + window.location.href = "http://" + window.location.hostname + ":" + window.location.port + "/scripts"; + }); + + $("#save_button").on("click", () => { + $("#save_button").html('<i class="fas fa-circle-notch fa-spin"></i>'); + socket.emit("NeoIde_SaveScript", { + script: { + name: $(".fileName").html(), + path: atob(findGetParameter("scriptName")), + files: { + main: editor.getValue() + } + } + }); + }); + + $("#start_button").on("click", () => { + socket.emit("NeoIde_RunScript", { + scriptPath: atob(findGetParameter("scriptName")) + }) + }); + + $("#stop_button").on("click", () => { + socket.emit("NeoIde_StopScript", {}); + }); + + $("#toggle_output_button").on("click", () => { + console.log("NIY"); + }); + + window.onresize = resize; + + socket.on("callback", (reqResult) => { + switch (reqResult.request) { + case "NeoIde_GetScript": + if (!reqResult.success) { + alert("Could not load script..."); + window.location.href = "http://" + window.location.hostname + ":" + window.location.port + "/scripts"; + } + editor.setValue(reqResult.data.script.files.main); + $(".fileName").text(reqResult.data.script.name); + break; + + case "NeoIde_SaveScript": + if (!reqResult.success) { + $("#save_button").html('<i class="fas fa-times"></i>'); + alert("Could not save script, info in console."); + console.log(reqResult); + } else { + $("#save_button").html('<i class="fas fa-check"></i>'); + } + setTimeout(() => { + $("#save_button").html('<i class="fas fa-save"></i>'); + }, 1500); + break; + + case "NeoIde_StopScript": + console.log(reqResult); + break; + + case "NeoIde_GetScriptOutput": + if (reqResult.success) { + let lines = reqResult.output.split("\n"); + + let preObj = ""; + let currentClass = ""; + let currentData = ""; + for (let i = 0; i < lines.length; i++) { + if (lines[i].includes("====stdout====")) { + preObj += `<span class="${currentClass}">${currentData}</span>`; + currentClass = "stdout"; + currentData = ""; + } else if (lines[i].includes("====stderr====")) { + preObj += `<span class="${currentClass}">${currentData}</span>`; + currentClass = "stderr"; + currentData = ""; + } else if (lines[i].includes("====close====")) { + preObj += `<span class="${currentClass}">${currentData}</span>`; + currentClass = "close"; + currentData = ""; + } else { + if (lines [i].replace("\n", "") == "") { + //currentData += "\n" + } else { + currentData += lines[i] + "\n"; + } + } + } + preObj += `<span class="${currentClass}">${currentData}</span>`; + if (outputLines != lines.length) { + outputLines = lines.length; + $(".panel-bottom pre").html(preObj); + var element = document.getElementsByClassName('panel-bottom')[0]; + element.scrollTop = element.scrollHeight; + } + + } else { + $(".panel-bottom pre").html("<span class=\"stderr\">" + reqResult.error.reason + "</span>"); + } + break; + + default: + console.log("Got a weird callback from \"" + reqResult.request + "\""); + } + }); + + setInterval(() => { + socket.emit("NeoIde_GetScriptOutput", { + scriptPath: atob(findGetParameter("scriptName")) + }) + }, 400); + + </script> + </body> +</html> diff --git a/public/scripts.html b/public/scripts.html new file mode 100644 index 0000000..bb42bdf --- /dev/null +++ b/public/scripts.html @@ -0,0 +1,73 @@ +<!DOCTYPE html> +<html class="general"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>Luxcena Neo - scripts</title> + + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/css/materialize.min.css"> + <link rel="stylesheet" href="/css/bundle.css" type="text/css" /> + </head> + + <body id="scripts"> + <header> + <nav> + <div class="nav-wrapper"> + <a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a> + <a href="#" class="brand-logo">Luxcena Neo</a> + </div> + </nav> + <div id="sidenav"></div> + </header> + + <main> + + <ul class="row script-list"> + <div id="local-scripts"></div> + </ul> + + <ul class="row script-list"> + <div id="remote-scripts"></div> + </ul> + + <ul class="row script-list" style="display: none;"> + + <li> + <div class="col s12 m4"> + <div class="card blue darken-1"> + <div class="card-content white-text"> + <p class="card-title">{{script_name}}</p> + <p> + <span class="badge yellow darken-1 white-text">GitHub</span> + </p> + </div> + <div class="card-action white"> + <a href="#"><i class="material-icons">play_arrow</i></a> + <a href="#"><i class="material-icons">file_download</i></a> + <a href="#"><i class="material-icons">delete</i></a> + </div> + </div> + </div> + </li> + + </ul> + + <div class="fixed-action-btn"> + <a class="btn-floating btn-large red" id="createEmptyScript"><i class="large material-icons">add</i></a> + <!--<ul> + <li><a class="btn-floating tooltipped green" data-position="left" data-delay="50" data-tooltip="Update scripts from sources"><i class="material-icons">autorenew</i></a></li> + <li><a class="btn-floating tooltipped green" data-position="left" data-delay="50" data-tooltip="Update scripts from sources"><i class="material-icons">create</i></a></li> + <li><a class="btn-floating green" data-position="left" data-delay="50" data-tooltip="Manage external sources"><i class="material-icons">link</i></a></li> + <li><a class="btn-floating blue darken-1" data-position="left" data-delay="50" data-tooltip="Upload a script from your local computer"><i class="material-icons">file_upload</i></a></li> + </ul>--> + </div> + + + </main> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> + <script src="/socket.io/socket.io.js"></script> + <script type="text/javascript" src="/js/bundle.js"></script> + </body> +</html> diff --git a/public/settings.html b/public/settings.html new file mode 100644 index 0000000..d7fa5d9 --- /dev/null +++ b/public/settings.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html class="general"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>Luxcena Neo</title> + + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/css/materialize.min.css"> + <link rel="stylesheet" href="/css/bundle.css" type="text/css" /> + </head> + + <body id="settings"> + <header> + <nav> + <div class="nav-wrapper"> + <a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a> + <a href="#" class="brand-logo">Luxcena Neo</a> + </div> + </nav> + <div id="sidenav"></div> + </header> + + <main> + + <div class=""> + <div class="row"> + <div class="col s12 m3"> + <div class="card"> + <div class="card-content"> + <span class="card-title">Version</span> + <p> + Current Version: <em>0.0.1</em> on branch <em>dev</em> <br /> + <span class="teal-text">New update available (<em>0.0.1-2</em> on <em>dev</em>)</span> + </p> + </div> + </div> + </div> + </div> + + </div> + + + </main> + + <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> + <script src="/socket.io/socket.io.js"></script> + <script type="text/javascript" src="/js/bundle.js"></script> + </body> +</html> diff --git a/public/strip_setup.html b/public/strip_setup.html new file mode 100644 index 0000000..606d527 --- /dev/null +++ b/public/strip_setup.html @@ -0,0 +1,131 @@ +<!DOCTYPE html> +<html class="general"> + <head> + <!--Import Google Icon Font--> + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + <!--Import materialize.css--> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/css/materialize.min.css"> + <link rel="stylesheet" href="./css/luxcena.css" type="text/css" /> + <!--Let browser know website is optimized for mobile--> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + </head> + + <body> + <header> + <nav> + <div class="nav-wrapper"> + <a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a> + <a href="#" class="brand-logo">Luxcena Neo</a> + </div> + </nav> + + <ul id="slide-out" class="sidenav sidenav-fixed"> + <li> + <div class="user-view"> + <div class="background"> + <img src="./logo/150h/Icon.png"> + </div> + <!--<a href="#!user"><img class="circle" src="https://picsum.photos/200/300/?random"></a> + <a href="#!name"><span class="white-text name">John Doe</span></a> + <a href="#!email"><span class="white-text email">Guest</span></a>--> + </div> + </li> + <li><div class="divider"></div></li> + <li><a class="waves-effect" href="/"><i class="material-icons">dashboard</i> Dashboard</a></li> + <li><a class="waves-effect" href="/profiles"><i class="material-icons">cloud</i> Profiles</a></li> + <li><a class="waves-effect" href="/neo_ide"><i class="material-icons">code</i> Neo IDE</a></li> + <li><div class="divider"></div></li> + <li><a class="subheader">Settings</a></li> + <li><a class="waves-effect" href="strip_setup"><i class="material-icons">straighten</i> Strip setup</a></li> + <li><a class="waves-effect" href="/settings"><i class="material-icons">settings</i> Settings</a></li> + </ul> + </header> + + <main> + + <div class="row"> + + <div class="col s12 m5"> + <div class="card"> + <div class="card-content"> + + <div class="input-field"> + <select> + <option value="" disabled selected>How are the LEDs configured?</option> + <option value="1">Basic, straight?</option> + <option value="2">Adventorous, snake?</option> + <option value="3">Crazy, just something random?</option> + </select> + <label>Led configuration</label> + </div> + + <div class="input-field"> + <input type="number" name="" value=""> + <label>Number of LEDs</label> + </div> + + <div class="input-field"> + <input type="number" name="" value=""> + <label>Number of Segments</label> + </div> + + </div> + </div> + </div> + + <div class="col s12 m7"> + <div class="card"> + <div class="card-content"> + + Segment config... + + </div> + </div> + </div> + + </div> + + <div class="row"> + <div class="col s12 m12"> + <div class="card"> + <div class="card-content"> + <p>Explanation of them different configuration modes. "⮽" is the symbol used for LEDs, everything else is just wire.</p> + <h5>Straight:</h5> + Everything is in a stright line, or the cable is looped around. + <pre style="line-height:0.9em;"> +└⮽─⮽─⮽─⮽─⮽─⮽─⮽─⮽┐ + +└⮽─⮽─⮽─⮽┐ +┌────────┘ +└⮽─⮽─⮽─⮽┐ + </pre> + <h5>Snake:</h5> + The diodes are in a "snake"-pattern. + <pre style="line-height:0.9em;"> +└⮽─⮽─⮽─⮽┐ +┌⮽─⮽─⮽─⮽┘ +└⮽─⮽─⮽─⮽┐ + </pre> + <h5>Crazy:</h5> + <br />This will just assume you have no idea what you are doing, and make a random configuration for you. based purely on the number of LEDs you have. + <pre style="line-height:0.9em;"> +└⮽─⮽x⮽─⮽ + └─┐ +┌⮽─⮽x⮽─⮽┐ +└⮽─⮽─⮽─⮽┘ + </pre> + </div> + </div> + </div> + </div> + + </main> + + <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/js/materialize.min.js"></script> + <script type="text/javascript"> + var elem = document.querySelector('.sidenav'); + var instance = M.Sidenav.init(elem); + var instance = M.FormSelect.init(document.querySelector('select')); + </script> + </body> +</html> diff --git a/public/update/index.html b/public/update/index.html new file mode 100644 index 0000000..a2f404f --- /dev/null +++ b/public/update/index.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html id="update"> + <head> + <link rel="stylesheet" href="/css/bundle.css" type="text/css" /> + </head> + + <body> + <div class="start-screen"> + <div class="loading"> + <div class="loading__element el1">L</div> + <div class="loading__element el2">U</div> + <div class="loading__element el3">X</div> + <div class="loading__element el4">C</div> + <div class="loading__element el5">E</div> + <div class="loading__element el6">N</div> + <div class="loading__element el7">A</div> + <div class="loading__element el8"> </div> + <div class="loading__element el9">I</div> + <div class="loading__element el10">S</div> + <div class="loading__element el11"> </div> + <div class="loading__element el12">U</div> + <div class="loading__element el13">P</div> + <div class="loading__element el14">D</div> + <div class="loading__element el15">A</div> + <div class="loading__element el16">T</div> + <div class="loading__element el17">I</div> + <div class="loading__element el18">N</div> + <div class="loading__element el19">G</div> + </div> + <div class="current-event"> + <p id="event-text"></p> + </div> + </div> + + <script type="text/javascript"> + let socket = io(); + + socket.on("updaterStatus", (msg) => { + document.getElementById("event-text").innerHTML = msg; + }); + + setInterval(() => { + socket.emit("UpdaterStatus"); + }, 500); + </script> + </body> +</html> |