Ajouté les pages html dynamiques qui manquaient pour les démos ;-)

This commit is contained in:
Christian Zufferey
2019-04-22 09:44:34 +02:00
parent 4376f4b76d
commit e0bfed7568
8 changed files with 290 additions and 0 deletions

20
Meteo/z_index.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 home page</title>
</head>
<body>
<h1>ESP8266 home page 190217.1258</h1>
<h2>Différentes pages HTML:</h2>
<h3>
<a href="z_page1.html">Page 1, affichage de la température dynamique en code Lua inline.</a><br>
<a href="z_page2.html">Page 2, tableau dynamique écrit en Lua inline.</a><br>
<a href="z_page3.html">Page 3, affichage des résultats du WIFI sniffer écrit en Lua inline.</a><br>
<a href="page_qui_existe_pag.html">Page qui n'existe pas !</a><br>
</h3>
</body>
</html>

26
Meteo/z_page1.html Normal file
View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 page 1</title>
</head>
<body>
<h1>ESP8266 page 1 190127.1445</h1>
<br>
Coucou c'est la page 1 !<br>
<a href="/">Retour à la home page...</a><br><br><br>
La température est:
<%
ztemp=ztemp+1
zout(ztemp.."°C")
%>
<br>Mais il fait encore trop froid !<br>
</body>
</html>

51
Meteo/z_page2.html Normal file
View File

@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 page 2</title>
</head>
<body>
<h1>ESP8266 page 2 190127.1449</h1>
<br>
Coucou c'est la page 2 !<br>
<a href="/">Retour à la home page...</a><br><br><br>
Voici un tableau dynamique écrit en Lua inline.<br><br>
Le code Lua pour créer ce tableau se trouve dans le code HTML de cette page et est exécuté sur le NodeMCU.<br>
Les données du tableau viennent du NodeMCU !<br><br>
<%
-- création du tableau sur le NodeMCUjuste juste pour la démo ici !
zmac_adrs={}
zmac_adrs["b8:d7:af:a6:bd:86"]={["zname"]="S7 zf", ["zrssi"]=45, ["ztime"]="12:03:36"}
zmac_adrs["cc:c0:79:7d:f5:d5"]={["zname"]="S7 Mélanie", ["zrssi"]=50, ["ztime"]="14:23:46"}
zmac_adrs["5c:f9:38:a1:f7:f0"]={["zname"]="MAC zf", ["zrssi"]=40, ["ztime"]="11:53:16"}
zmac_adrs["d8:30:62:5a:d6:3a"]={["zname"]="IMAC Maman", ["zrssi"]=55, ["ztime"]="17:07:23"}
%>
<table border='1'>
<tr>
<th>MAC</th><th>Name</th><th>RSSI</th><th>Time</th>
</tr>
<%
for k, v in pairs(zmac_adrs) do
zout("<tr>\n")
zout("\t<td>" .. k .. "</td>\n")
zout("\t<td>" .. tostring(zmac_adrs[k]["zname"]) .. "</td>\n")
zout("\t<td>" .. tostring(zmac_adrs[k]["zrssi"]) .. "</td>\n")
zout("\t<td>" .. tostring(zmac_adrs[k]["ztime"]) .. "</td>\n")
zout("</tr>\n")
end
%>
</table>
<%
-- libère la mémoire du tableau sur le NodeMCU qui avait été créé pour la démo ici !
zmac_adrs=nil
%>
</body>
</html>

48
Meteo/z_page3.html Normal file
View File

@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 page 3</title>
</head>
<body>
<h1>ESP8266 page 3 190215.1854</h1>
<br>
Coucou c'est la page 3 !<br>
<a href="/">Retour à la home page...</a><br><br><br>
Voici le résultat du WIFI sniffer, dans un tableau dynamique écrit en Lua inline.<br><br>
Le code Lua pour créer ce tableau se trouve dans le code HTML de cette page et est exécuté sur le NodeMCU.<br>
Les données du tableau viennent du NodeMCU !<br><br>
<%
zout(node.heap().."<br><br>\n")
%>
<table border='1'>
<tr>
<th>Index</th><th>MAC</th><th>Name</th><th>RSSI</th><th>Time0</th><th>Time1</th><th>Distance</th>
</tr>
<%
zsort_rssi()
for i=1, #zmac_adrs do
-- print(i,zmac_adrs[i])
zadrs, zname, zrssi, ztime0, ztime1 = zmac_adrs[i]:match("([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)")
zout("<tr>\n")
if tonumber(zrssi,10) < 0 then
zout("\t<td>" .. tostring(i) .. "</td>\n")
zout("\t<td>" .. zadrs .. "</td>\n")
zout("\t<td>" .. tostring(zname) .. "</td>\n")
zout("\t<td>" .. tostring(zrssi) .. "</td>\n")
zout("\t<td>" .. tostring(ztime0) .. "</td>\n")
zout("\t<td>" .. tostring(ztime1) .. "</td>\n")
zout("\t<td>" .. tostring(zround(zcalc_distance(zrssi),1)) .. "m" .. "</td>\n")
zout("</tr>\n")
end
end
%>
</table>
</body>
</html>

20
No_linear/z_index.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 home page</title>
</head>
<body>
<h1>ESP8266 home page 190217.1258</h1>
<h2>Différentes pages HTML:</h2>
<h3>
<a href="z_page1.html">Page 1, affichage de la température dynamique en code Lua inline.</a><br>
<a href="z_page2.html">Page 2, tableau dynamique écrit en Lua inline.</a><br>
<a href="z_page3.html">Page 3, affichage des résultats du WIFI sniffer écrit en Lua inline.</a><br>
<a href="page_qui_existe_pag.html">Page qui n'existe pas !</a><br>
</h3>
</body>
</html>

26
No_linear/z_page1.html Normal file
View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 page 1</title>
</head>
<body>
<h1>ESP8266 page 1 190127.1445</h1>
<br>
Coucou c'est la page 1 !<br>
<a href="/">Retour à la home page...</a><br><br><br>
La température est:
<%
ztemp=ztemp+1
zout(ztemp.."°C")
%>
<br>Mais il fait encore trop froid !<br>
</body>
</html>

51
No_linear/z_page2.html Normal file
View File

@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 page 2</title>
</head>
<body>
<h1>ESP8266 page 2 190127.1449</h1>
<br>
Coucou c'est la page 2 !<br>
<a href="/">Retour à la home page...</a><br><br><br>
Voici un tableau dynamique écrit en Lua inline.<br><br>
Le code Lua pour créer ce tableau se trouve dans le code HTML de cette page et est exécuté sur le NodeMCU.<br>
Les données du tableau viennent du NodeMCU !<br><br>
<%
-- création du tableau sur le NodeMCUjuste juste pour la démo ici !
zmac_adrs={}
zmac_adrs["b8:d7:af:a6:bd:86"]={["zname"]="S7 zf", ["zrssi"]=45, ["ztime"]="12:03:36"}
zmac_adrs["cc:c0:79:7d:f5:d5"]={["zname"]="S7 Mélanie", ["zrssi"]=50, ["ztime"]="14:23:46"}
zmac_adrs["5c:f9:38:a1:f7:f0"]={["zname"]="MAC zf", ["zrssi"]=40, ["ztime"]="11:53:16"}
zmac_adrs["d8:30:62:5a:d6:3a"]={["zname"]="IMAC Maman", ["zrssi"]=55, ["ztime"]="17:07:23"}
%>
<table border='1'>
<tr>
<th>MAC</th><th>Name</th><th>RSSI</th><th>Time</th>
</tr>
<%
for k, v in pairs(zmac_adrs) do
zout("<tr>\n")
zout("\t<td>" .. k .. "</td>\n")
zout("\t<td>" .. tostring(zmac_adrs[k]["zname"]) .. "</td>\n")
zout("\t<td>" .. tostring(zmac_adrs[k]["zrssi"]) .. "</td>\n")
zout("\t<td>" .. tostring(zmac_adrs[k]["ztime"]) .. "</td>\n")
zout("</tr>\n")
end
%>
</table>
<%
-- libère la mémoire du tableau sur le NodeMCU qui avait été créé pour la démo ici !
zmac_adrs=nil
%>
</body>
</html>

48
No_linear/z_page3.html Normal file
View File

@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>ESP8266 page 3</title>
</head>
<body>
<h1>ESP8266 page 3 190215.1854</h1>
<br>
Coucou c'est la page 3 !<br>
<a href="/">Retour à la home page...</a><br><br><br>
Voici le résultat du WIFI sniffer, dans un tableau dynamique écrit en Lua inline.<br><br>
Le code Lua pour créer ce tableau se trouve dans le code HTML de cette page et est exécuté sur le NodeMCU.<br>
Les données du tableau viennent du NodeMCU !<br><br>
<%
zout(node.heap().."<br><br>\n")
%>
<table border='1'>
<tr>
<th>Index</th><th>MAC</th><th>Name</th><th>RSSI</th><th>Time0</th><th>Time1</th><th>Distance</th>
</tr>
<%
zsort_rssi()
for i=1, #zmac_adrs do
-- print(i,zmac_adrs[i])
zadrs, zname, zrssi, ztime0, ztime1 = zmac_adrs[i]:match("([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)")
zout("<tr>\n")
if tonumber(zrssi,10) < 0 then
zout("\t<td>" .. tostring(i) .. "</td>\n")
zout("\t<td>" .. zadrs .. "</td>\n")
zout("\t<td>" .. tostring(zname) .. "</td>\n")
zout("\t<td>" .. tostring(zrssi) .. "</td>\n")
zout("\t<td>" .. tostring(ztime0) .. "</td>\n")
zout("\t<td>" .. tostring(ztime1) .. "</td>\n")
zout("\t<td>" .. tostring(zround(zcalc_distance(zrssi),1)) .. "m" .. "</td>\n")
zout("</tr>\n")
end
end
%>
</table>
</body>
</html>