@@ -130,7 +130,7 @@ function page(res, headline, text, cb, additionalHeadTags) {
130130 }
131131 res . setStatus ( 200 ) ;
132132 res . headers . set ( "content-type" , "text/html" ) ;
133- res . write ( "<!doctype html><html><head><title>esp32-javascript</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n <style>\n body {\n font-family: monospace;\n font-size: 13pt;\n }\n .input {\n font-family: monospace;\n font-size: 13pt;\n }\n .fill {\n width: calc(100% - 146px);\n }\n .full {\n width: calc(100% - 16px);\n }\n .txt {\n height: 100px;\n }\n .formlabel {\n display: inline-block;\n width: 130px;\n }\n .formpad {\n padding: 8px;\n }\n .green {\n color: green;\n }\n .red {\n color: red;\n }\n .inline-form {\n display: inline;\n }\n .blink {\n animation: blinkanimation 1s linear infinite;\n }\n @keyframes blinkanimation {\n 50% {\n opacity: 0;\n }\n }\n </style>\n " + ( additionalHeadTags ? additionalHeadTags : "" ) + "\n </head>\n <body><div><div><div><h1>" + headline + "</h1>" ) ;
133+ res . write ( "<!doctype html><html><head><title>esp32-javascript</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n <style>\n body {\n font-family: monospace;\n font-size: 13pt;\n }\n .input {\n font-family: monospace;\n font-size: 13pt;\n }\n .fill {\n width: calc(100% - 146px);\n }\n .full {\n width: calc(100% - 16px);\n }\n .txt {\n height: 100px;\n }\n .formlabel {\n display: inline-block;\n }\n .formpad {\n padding: 8px;\n }\n .green {\n color: green;\n }\n .red {\n color: red;\n }\n .inline-form {\n display: inline;\n }\n .blink {\n animation: blinkanimation 1s linear infinite;\n }\n .nowrap {\n white-space: nowrap;\n }\n @keyframes blinkanimation {\n 50% {\n opacity: 0;\n }\n }\n </style>\n " + ( additionalHeadTags ? additionalHeadTags : "" ) + "\n <script>\n function showpassword(label)\n {\n var inputId=label.parentElement.getAttribute(\"for\");\n document.getElementById(inputId).setAttribute(\"type\",\"text\");\n }\n </script>\n </head>\n <body><div><div><div><h1>" + headline + "</h1>" ) ;
134134 if ( Array . isArray ( text ) ) {
135135 res . write ( text . join ( "" ) ) ;
136136 }
@@ -216,12 +216,12 @@ function startConfigServer() {
216216 var config = configManager . config ;
217217 page ( res , "Setup" , "" + ( successMessage
218218 ? "<div class=\"formpad green\">" + successMessage + "</div>"
219- : "" ) + ( errorMessage ? "<div class=\"formpad red\">" + errorMessage + "</div>" : "" ) + "<h2>Configuration</h2><h3>Wifi</h3><form action=\"/setup\" method=\"post\">\n <div class=\"formpad\"><label for=\"ssid\" class=\"formlabel\">SSID</label><input type=\"text\" name=\"ssid\" class=\"fill input\" value=\"" + ( ( ( _a = config . wifi ) === null || _a === void 0 ? void 0 : _a . ssid ) || "" ) + "\" /></div>\n <div class=\"formpad\"><label for=\"password\" class=\"formlabel\">Password</label><input type=\"text\" name=\"password\" class=\"fill input\" value=\"" + ( ( ( _b = config . wifi ) === null || _b === void 0 ? void 0 : _b . password ) || "" ) + "\" /></div>\n <div class=\"formpad\"><label for=\"bssid\" class=\"formlabel\">BSSID (optional)</label><input type=\"text\" name=\"bssid\" class=\"fill input\" value=\"" + ( ( ( _c = config . wifi ) === null || _c === void 0 ? void 0 : _c . bssid ) || "" ) + "\" /></div>\n <h3>Basic authentication</h3>\n <div class=\"formpad\"><label for=\"username\" class=\"formlabel\">Username</label><input type=\"text\" name=\"username\" class=\"fill input\" value=\"" + config . access . username + "\" /></div>\n <div class=\"formpad\"><label for=\"userpass\" class=\"formlabel\">Password</label><input type=\"text\" name=\"userpass\" class=\"fill input\" value=\"" + config . access . password + "\" /></div>\n <h3>JavaScript OTA</h3><div class=\"formpad\"><label for=\"url\" class=\"formlabel\">JS file url</label><input type=\"text\" name=\"url\" class=\"fill input\" value=\"" + ( ( ( _d = config . ota ) === null || _d === void 0 ? void 0 : _d . url ) || "" ) + "\" /></div>\n <div class=\"formpad\"><label for=\"offline\"><input type=\"checkbox\" name=\"offline\" value=\"true\" " + ( ( ( _e = config . ota ) === null || _e === void 0 ? void 0 : _e . offline ) ? "checked" : "" ) + "/> Offline Mode</label></div>\n <label for=\"script\" class=\"formpad\">Offline Script</label><div class=\"formpad\"><textarea name=\"script\" class=\"full input txt\">" + ( ( ( _f = config . ota ) === null || _f === void 0 ? void 0 : _f . script ) || "" ) + "</textarea></div>\n <div class=\"formpad\"><input type=\"submit\" value=\"Save\" class=\"formpad input\"/></div></form>\n <h2>Logs</h2>\n <div class=\"formpad\">\n <p>\n Showing last " + filelogging_1 . LOG_FILE_NUM_LIMIT + " log files, with each having maximum of " + filelogging_1 . LOG_FILE_SIZE_LIMIT / 1024 + " kB data.<br/>\n </p>\n " + getLogFileList ( )
219+ : "" ) + ( errorMessage ? "<div class=\"formpad red\">" + errorMessage + "</div>" : "" ) + "<h2>Configuration</h2><h3>Wifi</h3><form action=\"/setup\" method=\"post\">\n <div class=\"formpad\"><label for=\"ssid\" class=\"formlabel\">SSID</label><br /><input type=\"text\" name=\"ssid\" class=\"full input\" value=\"" + ( ( ( _a = config . wifi ) === null || _a === void 0 ? void 0 : _a . ssid ) || "" ) + "\" /></div>\n <div class=\"formpad\"><label for=\"password\" class=\"formlabel\">Password (<a href=\"javascript:void(0)\" onclick=\"showpassword(this)\">Show</a>)</label><br /><input type=\"password\" name=\"password\" id=\"password\" class=\"full input\" value=\"" + ( ( ( _b = config . wifi ) === null || _b === void 0 ? void 0 : _b . password ) || "" ) + "\" /></div>\n <div class=\"formpad\"><label for=\"bssid\" class=\"formlabel\">BSSID (optional)</label></br /><input type=\"text\" name=\"bssid\" class=\"full input\" value=\"" + ( ( ( _c = config . wifi ) === null || _c === void 0 ? void 0 : _c . bssid ) || "" ) + "\" /></div>\n <h3>Basic authentication</h3>\n <div class=\"formpad\"><label for=\"username\" class=\"formlabel\">Username</label></br /><input type=\"text\" name=\"username\" class=\"full input\" value=\"" + config . access . username + "\" /></div>\n <div class=\"formpad\"><label for=\"userpass\" class=\"formlabel\">Password (<a href=\"javascript:void(0)\" onclick=\"showpassword(this)\">Show</a>)</label></br /><input type=\"password\" name=\"userpass\" id=\"userpass\" class=\"full input\" value=\"" + config . access . password + "\" /></div>\n <h3>JavaScript OTA</h3><div class=\"formpad\"><label for=\"url\" class=\"formlabel\">JS file url</label></br /><input type=\"text\" name=\"url\" class=\"full input\" value=\"" + ( ( ( _d = config . ota ) === null || _d === void 0 ? void 0 : _d . url ) || "" ) + "\" /></div>\n <div class=\"formpad\"><label for=\"offline\"><input type=\"checkbox\" name=\"offline\" value=\"true\" " + ( ( ( _e = config . ota ) === null || _e === void 0 ? void 0 : _e . offline ) ? "checked" : "" ) + "/> Offline Mode</label></div>\n <label for=\"script\" class=\"formpad\">Offline Script</label><div class=\"formpad\"><textarea name=\"script\" class=\"full input txt\">" + ( ( ( _f = config . ota ) === null || _f === void 0 ? void 0 : _f . script ) || "" ) + "</textarea></div>\n <div class=\"formpad\"><input type=\"submit\" value=\"Save\" class=\"formpad input\"/></div></form>\n <h2>Logs</h2>\n <div class=\"formpad\">\n <p>\n Showing last " + filelogging_1 . LOG_FILE_NUM_LIMIT + " log files, with each having maximum of " + filelogging_1 . LOG_FILE_SIZE_LIMIT / 1024 + " kB data.<br/>\n </p>\n " + getLogFileList ( )
220220 . map ( function ( e ) {
221- return e . filename + " (" + ( e . size === undefined ? "?" : Math . floor ( e . size / 1024 ) ) + " kB) <form action=\"/viewlog\" method=\"post\" class=\"inline-form\"><button class=\"input\" type=\"submit\" name=\"file\" value=\"" + filelogging_1 . FILE_LOGGING_DIRECTORY + "/" + e . filename + "\">View</button></form> <form action=\"/deletelog\" method=\"post\" class=\"inline-form\"><button class=\"input\" type=\"submit\" name=\"file\" value=\"" + filelogging_1 . FILE_LOGGING_DIRECTORY + "/" + e . filename + "\">Delete</button></form><br / >" ;
221+ return "<div>" + e . filename + " (" + ( e . size === undefined ? "?" : Math . floor ( e . size / 1024 ) ) + " kB) <span class=\"nowrap\">< form action=\"/viewlog\" method=\"post\" class=\"inline-form\"><button class=\"input\" type=\"submit\" name=\"file\" value=\"" + filelogging_1 . FILE_LOGGING_DIRECTORY + "/" + e . filename + "\">View</button></form> <form action=\"/deletelog\" method=\"post\" class=\"inline-form\"><button class=\"input\" type=\"submit\" name=\"file\" value=\"" + filelogging_1 . FILE_LOGGING_DIRECTORY + "/" + e . filename + "\">Delete</button></form></span></div >" ;
222222 } )
223223 . join ( "" ) + "\n </form>\n </div>\n \n " + ( el_is_native_ota_supported ( )
224- ? "<h2>Native OTA Upgrade</h2>\n <form action=\"/native-ota\" method=\"post\" class=\"formpad\" >\n <div class=\"formpad\"><label for=\"appbin\" class=\"formlabel\">URL to app binary</label><input type=\"text\" name=\"appbin\" class=\"fill input\" value=\"\" /></div>\n <div class=\"formpad\"><label for=\"modulesbin\" class=\"formlabel\">URL to modules binary</label><input type=\"text\" name=\"modulesbin\" class=\"fill input\" value=\"\" /></div>\n <div class=\"formpad\"><input type=\"submit\" value=\"Upgrade\" class=\"formpad input\" " + ( upgradeStatus . status === "inprogress" ? "disabled" : "" ) + "/> " + ( upgradeStatus . status !== "idle"
224+ ? "<h2>Native OTA Upgrade</h2>\n <form action=\"/native-ota\" method=\"post\">\n <div class=\"formpad\"><label for=\"appbin\" class=\"formlabel\">URL to app binary</label><br />< input type=\"text\" name=\"appbin\" class=\"full input\" value=\"\" /></div>\n <div class=\"formpad\"><label for=\"modulesbin\" class=\"formlabel\">URL to modules binary</label><br />< input type=\"text\" name=\"modulesbin\" class=\"full input\" value=\"\" /></div>\n <div class=\"formpad\"><input type=\"submit\" value=\"Upgrade\" class=\"formpad input\" " + ( upgradeStatus . status === "inprogress" ? "disabled" : "" ) + "/> " + ( upgradeStatus . status !== "idle"
225225 ? '<a href="/native-ota">Upgrade status</a>'
226226 : "" ) + "</div>\n </form>"
227227 : "" ) + "\n\n <h2>Request restart</h2>\n <form action=\"/restart\" method=\"post\"><div class=\"formpad\"><input type=\"submit\" value=\"Restart\" class=\"formpad input\"/></div></form>\n <h2>Uptime</h2>\n <div class=\"formpad\">\n Boot time: " + boot_1 . getBootTime ( ) + "\n </div>\n <div class=\"formpad\">\n Uptime (hours): " + Math . floor ( ( Date . now ( ) - boot_1 . getBootTime ( ) . getTime ( ) ) / 10 / 60 / 60 ) /
0 commit comments