forked from whatnick/ATM90E26_SPI_DIN_Wemos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigPage.html
97 lines (80 loc) · 2.4 KB
/
configPage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<style type="text/css">
#content {
text-align: center ;
width: 700px ;
margin-left: auto ;
margin-right: auto ;
}
body{font-family: verdana,arial,sans-serif;}
table.gridtable {
margin: 0px auto;
font-size:18px;
color:#333333;
border-width: 1px;
border-collapse: collapse;
}
table.gridtable th {
border-width: 1px;
padding: 8px;
border-style: solid;
background-color: #dedede;
}
table.gridtable td {
border-width: 1px;
padding: 8px;
border-style: solid;
background-color: #ffffff;
}
</style>
<div id="content">
<h1>WhatNick Energymon Config</h1>
<form id="mainForm" method="get" action="/set">
<h2>Wifi Settings:</h2>
<table class="gridtable" >
<tr><th>SSID</th><th>RSSI</th></tr>
<tbody ID="netTableBody">
</tbody>
</table>
<br>
SSID:<input id="txt_ssid" type="text" name="wifi_ssid" />
Password:<input type="text" name="wifi_password" />
<br>
<h2>Other Options:</h2>
<br>
</form>
</div>
</body>
<script>
var netArray = ["NEt1","NEt2","Net 1234 ","BSOD","Liuntless"];
var rSSI=["1","2","4","7","4"];
var optionals={"eic2_CRC2":0,"eic2_CRC1":2,"eic2_gain":3,"eic2_ugain":7,"eic1_CRC2":0,"eic1_CRC1":2,"eic1_gain":3,"eic1_ugain":7,"ts_auth":"dd","ts_server":"aaa.com"};
var arrayLength = netArray.length;
var tblBody=document.getElementById("netTableBody");
var tableText="";
for (var i = 0; i < arrayLength; i++) {
var text="<tr><td><a id="+i+" onClick='reply_click(this.id)' href=#>"+netArray[i]+"</a></td><td>"+rSSI[i]+"</td></tr>";
tableText=tableText+text;
}
tblBody.innerHTML=tableText;
function reply_click(clicked_id)
{
document.getElementById("txt_ssid").value=netArray[clicked_id];
}
var form=document.getElementById("mainForm");
for (var k in optionals){
if (optionals.hasOwnProperty(k)) {
newoption=k+ "<input type=text name="+k+" value='"+optionals[k]+"'><br>";
form.insertAdjacentHTML('beforeend',newoption);
}
}
form.insertAdjacentHTML("beforeend","<br><input value=Save type=submit>");
form.insertAdjacentHTML("beforeend","<br><a href='/update'>Click here to upload new firmware</a>");
</script>
</html>