From 3443834d3e3ef60be9b1bcab8e33a2f3fc6b43b3 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 26 Sep 2022 02:02:02 +0000 Subject: [PATCH] sync w/ DL2MF: web interface enhancements --- RX_FSK/RX_FSK.ino | 44 +++++++++++++++++++++++++++++-------------- RX_FSK/data/map.html | 24 +++++++++++++++++++++++ RX_FSK/data/rdz.js | 1 - RX_FSK/data/style.css | 3 +++ 4 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 RX_FSK/data/map.html diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index b79e449..8165962 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -442,6 +442,8 @@ const char *createWIFIForm() { return message; } +#if 0 + // moved to map.html (active warning is still TODO const char *createSondeHubMap() { SondeInfo *s = &sonde.sondeList[0]; char *ptr = message; @@ -464,6 +466,7 @@ const char *createSondeHubMap() { HTMLBODYEND(ptr); return message; } +#endif const char *handleWIFIPost(AsyncWebServerRequest *request) { char label[10]; @@ -508,7 +511,7 @@ void addSondeStatus(char *ptr, int i) { struct tm ts; SondeInfo *s = &sonde.sondeList[i]; - strcat(ptr, ""); + strcat(ptr, "
"); sprintf(ptr + strlen(ptr), "", s->d.lat, s->d.lon); - strcat(ptr, "
%3.3f MHz, Type: %s
ID: %s", s->freq, sondeTypeLongStr[sonde.realType(s)], s->d.validID ? s->d.id : ""); if (s->d.validID && (TYPE_IS_DFM(s->type) || TYPE_IS_METEO(s->type) || s->type == STYPE_MP3H) ) { @@ -529,13 +532,15 @@ void addSondeStatus(char *ptr, int i) sprintf(ptr + strlen(ptr), "OSM - ", s->d.lat, s->d.lon); sprintf(ptr + strlen(ptr), "Google

\n"); + strcat(ptr, "\n"); } const char *createStatusForm() { char *ptr = message; strcpy(ptr, HTMLHEAD); - strcat(ptr, ""); + strcat(ptr, ""); + HTMLBODY(ptr, "status.html"); + strcat(ptr, "

"); for (int i = 0; i < sonde.config.maxsonde; i++) { int snum = (i + sonde.currentSonde) % sonde.config.maxsonde; @@ -543,7 +548,12 @@ const char *createStatusForm() { addSondeStatus(ptr, snum); } } - strcat(ptr, ""); + strcat(ptr, "
" + "rdzTTGOserver "); + strcat(ptr, version_id); + strcat(ptr, ""); + + HTMLBODYEND(ptr); Serial.printf("Status form: size=%d bytes\n", strlen(message)); return message; } @@ -720,7 +730,8 @@ const int N_CONFIG = (sizeof(config_list) / sizeof(struct st_configitems)); const char *createConfigForm() { char *ptr = message; - strcpy(ptr, HTMLHEAD); strcat(ptr, ""); + strcpy(ptr, HTMLHEAD); + strcat(ptr, ""); HTMLBODY(ptr, "config.html"); strcat(ptr, "
"); strcat(ptr, ""); @@ -764,6 +775,7 @@ const char *createConfigForm() { strcat(ptr, "\");\n"); } strcat(ptr, "configTable();\n "); + strcat(ptr, ""); HTMLSAVEBUTTON(ptr); HTMLBODYEND(ptr); Serial.printf("Config form: size=%d bytes\n", strlen(message)); @@ -832,7 +844,7 @@ const char *ctrllabel[] = {"Receiver/next freq. (short keypress)", "Scanner (dou const char *createControlForm() { char *ptr = message; strcpy(ptr, HTMLHEAD); - strcat(ptr, ""); + strcat(ptr, ""); HTMLBODY(ptr, "control.html"); for (int i = 0; i < 9; i++) { strcat(ptr, "

"); } } - strcat(ptr, "\n"); + strcat(ptr, "
" + "rdzTTGOserver "); + strcat(ptr, version_id); + strcat(ptr, ""); HTMLBODYEND(ptr); Serial.printf("Control form: size=%d bytes\n", strlen(message)); return message; @@ -1185,13 +1200,14 @@ void SetupAsyncServer() { request->send(200, "text/html", createWIFIForm()); }); - server.on("/map.html", HTTP_GET, [](AsyncWebServerRequest * request) { - request->send(200, "text/html", createSondeHubMap()); - }); - server.on("/map.html", HTTP_POST, [](AsyncWebServerRequest * request) { - handleWIFIPost(request); - request->send(200, "text/html", createSondeHubMap()); - }); + +// server.on("/map.html", HTTP_GET, [](AsyncWebServerRequest * request) { +// request->send(200, "text/html", createSondeHubMap()); +// }); +// server.on("/map.html", HTTP_POST, [](AsyncWebServerRequest * request) { +// handleWIFIPost(request); +// request->send(200, "text/html", createSondeHubMap()); +// }); server.on("/config.html", HTTP_GET, [](AsyncWebServerRequest * request) { request->send(200, "text/html", createConfigForm()); diff --git a/RX_FSK/data/map.html b/RX_FSK/data/map.html new file mode 100644 index 0000000..3126aec --- /dev/null +++ b/RX_FSK/data/map.html @@ -0,0 +1,24 @@ + + + + + + + diff --git a/RX_FSK/data/rdz.js b/RX_FSK/data/rdz.js index 8eaa998..9f2a133 100644 --- a/RX_FSK/data/rdz.js +++ b/RX_FSK/data/rdz.js @@ -12,7 +12,6 @@ function footer() { document.querySelector(".save").disabled = false; }); document.querySelector(".save").disabled = true; - document.querySelector(".ttgoinfo").innerHTML = "rdzTTGOserver %VERSION_ID%"; }); } diff --git a/RX_FSK/data/style.css b/RX_FSK/data/style.css index 31ab12c..c5d02b7 100755 --- a/RX_FSK/data/style.css +++ b/RX_FSK/data/style.css @@ -13,6 +13,9 @@ body, html { th.cfg { padding:5pt } +table.stat { + margin:0px 0px 5px 0px; +} .hamburger { position: relative;