kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
Merge remote-tracking branch 'refs/remotes/origin/devel' into devel
commit
459673a310
|
@ -242,6 +242,32 @@ const char *handleWIFIPost(AsyncWebServerRequest *request) {
|
|||
setupWifiList();
|
||||
}
|
||||
|
||||
// Show current status
|
||||
void addSondeStatus(char *ptr, int i)
|
||||
{
|
||||
SondeInfo *s = &sonde.sondeList[i];
|
||||
strcat(ptr, "<table>");
|
||||
sprintf(ptr+strlen(ptr),"<tr><td id=\"sfreq\">%3.3f MHz, Type: %s</td><tr><td>ID: %s</td></tr><tr><td>QTH: %.6f,%.6f h=%.0fm</td></tr>\n",
|
||||
s->freq, sondeTypeStr[s->type],
|
||||
s->validID?s->id:"<??>",
|
||||
s->lat, s->lon, s->hei);
|
||||
sprintf(ptr+strlen(ptr), "<tr><td><a target=\"_empty\" href=\"geo:%.6f,%.6f\">Geo-Ref</a> -", s->lat, s->lon);
|
||||
sprintf(ptr+strlen(ptr), "<a target=\"_empty\" href=\"https://www.google.com/maps/search/?api=1&query=%.6f,%.6f\">Google map</a> - ", s->lat, s->lon);
|
||||
sprintf(ptr+strlen(ptr), "<a target=\"_empty\" href=\"https://www.openstreetmap.org/?mlat=%.6f&mlon=%.6f&zoom=14\">OSM</a></td></tr>", s->lat, s->lon);
|
||||
strcat(ptr, "</table><p/>\n");
|
||||
}
|
||||
|
||||
const char *createStatusForm() {
|
||||
char *ptr = message;
|
||||
strcpy(ptr,"<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"><meta http-equiv=\"refresh\" content=\"5\"></head><body>");
|
||||
|
||||
for(int i=0; i<sonde.nSonde; i++) {
|
||||
addSondeStatus(ptr, (i+sonde.currentSonde)%sonde.nSonde);
|
||||
}
|
||||
strcat(ptr,"</body></html>");
|
||||
return message;
|
||||
}
|
||||
|
||||
const char* PARAM_MESSAGE = "message";
|
||||
void SetupAsyncServer() {
|
||||
// Route for root / web page
|
||||
|
@ -272,6 +298,10 @@ void SetupAsyncServer() {
|
|||
handleWIFIPost(request);
|
||||
request->send(200, "text/html", createWIFIForm());
|
||||
});
|
||||
|
||||
server.on("/status.html", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||
request->send(200, "text/html", createStatusForm());
|
||||
});
|
||||
|
||||
// Route to load style.css file
|
||||
server.on("/style.css", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<div class="tab">
|
||||
<button class="tablinks" onclick="selTab(event,'QRG')" id="defaultTab">QRG</button>
|
||||
<button class="tablinks" onclick="selTab(event,'WIFI')">WLAN</button>
|
||||
<button class="tablinks" onclick="selTab(event,'Data')">Data</button>
|
||||
<button class="tablinks" onclick="selTab(event,'About')">About</button>
|
||||
</div>
|
||||
|
||||
|
@ -30,6 +31,11 @@
|
|||
<iframe src="wifi.html" style="border:none;" width="100%%" height="100%%"></iframe>
|
||||
</div>
|
||||
|
||||
<div id="Data" class="tabcontent">
|
||||
<h3>Data</h3>
|
||||
<iframe src="status.html" style="border:none;" width="100%%" height="100%%"></iframe>
|
||||
</div>
|
||||
|
||||
<div id="About" class="tabcontent">
|
||||
<h3>About</h3>
|
||||
RDZSonde
|
||||
|
|
|
@ -4,6 +4,16 @@ body, html {
|
|||
font-family: Arial;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
background-color: #ddd
|
||||
}
|
||||
|
||||
td#sfreq {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.tab {
|
||||
overflow: hidden;
|
||||
border: 1px solid #ccc;
|
||||
|
|
Ładowanie…
Reference in New Issue