Update embedded page to generate ISO 8601 data time and hardcode websocket protocol

Bump version
This commit is contained in:
Luc 2022-09-11 17:53:54 +08:00
parent e73b5e85c8
commit a4e42340ef
4 changed files with 700 additions and 701 deletions

View File

@ -100,7 +100,6 @@ app.get("/command", function (req, res) {
WebCommunication: "Synchronous", WebCommunication: "Synchronous",
WebSocketIP: "localhost", WebSocketIP: "localhost",
WebSocketPort: "81", WebSocketPort: "81",
WebSocketSubProtocol: "webui-v3",
Hostname: "esp3d", Hostname: "esp3d",
WiFiMode: "STA", WiFiMode: "STA",
WebUpdate: "Enabled", WebUpdate: "Enabled",

View File

@ -30,7 +30,7 @@ let wsMsg = "";
let logOff = false; let logOff = false;
let pageId = ""; let pageId = "";
let currentPath = "/"; let currentPath = "/";
const version = "3.0.0.a5"; const version = "3.0.0.a6";
let xmlhttpupload; let xmlhttpupload;
let prgfiletext; let prgfiletext;
let prgfile; let prgfile;
@ -239,11 +239,11 @@ function getPCTime() {
padNumber(d.getMonth() + 1, 2) + padNumber(d.getMonth() + 1, 2) +
"-" + "-" +
padNumber(d.getDate(), 2) + padNumber(d.getDate(), 2) +
"-" + "T" +
padNumber(d.getHours(), 2) + padNumber(d.getHours(), 2) +
"-" + ":" +
padNumber(d.getMinutes(), 2) + padNumber(d.getMinutes(), 2) +
"-" + ":" +
padNumber(d.getSeconds(), 2) padNumber(d.getSeconds(), 2)
); );
} }
@ -357,18 +357,18 @@ function processFWJson(text) {
} }
} }
if (json.Hostname) document.title = json.Hostname; if (json.Hostname) document.title = json.Hostname;
startSocket(json.WebSocketIP, json.WebSocketPort, json.WebCommunication, json.WebSocketSubProtocol); startSocket(json.WebSocketIP, json.WebSocketPort, json.WebCommunication);
SendFileCommand("list", "all"); SendFileCommand("list", "all");
} }
function startSocket(ip, port, sync, protocol) { function startSocket(ip, port, sync) {
if (websocketStarted) { if (websocketStarted) {
wsSource.close(); wsSource.close();
} }
wsSource = new WebSocket( wsSource = new WebSocket(
"ws://" + ip + ":" + port + (sync == "Asynchronous" ? "/ws" : ""), "ws://" + ip + ":" + port + (sync == "Asynchronous" ? "/ws" : ""),
[protocol] ["webui-v3"]
); );
wsSource.binaryType = "arraybuffer"; wsSource.binaryType = "arraybuffer";
wsSource.onopen = function (e) { wsSource.onopen = function (e) {
@ -380,7 +380,7 @@ function startSocket(ip, port, sync, protocol) {
//if it is not a log off //if it is not a log off
if (!logOff) if (!logOff)
setTimeout(() => { setTimeout(() => {
startSocket(ip, port, sync, protocol); startSocket(ip, port, sync);
}, 3000); }, 3000);
}; };
wsSource.onerror = function (e) { wsSource.onerror = function (e) {

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H #define _VERSION_ESP3D_H
//version and sources location //version and sources location
#define FW_VERSION "3.0.0.a215" #define FW_VERSION "3.0.0.a216"
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H #endif //_VERSION_ESP3D_H

File diff suppressed because it is too large Load Diff