-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLOGPAGE.ino
161 lines (161 loc) · 5.17 KB
/
LOGPAGE.ino
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//const char HTML_LOGPAGE[] PROGMEM = R"=====(
//<!DOCTYPE html><html><head><meta charset='utf-8'>
//<title>ESP32-ECU</title>
//<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
//<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
//<link rel="stylesheet" type="text/css" href="/STYLESHEET">
//<style>
//#lijst {
// font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
// border-collapse: collapse;
// width: 88vw;
// font-size:2vw;
//}
//#lijst td, #customers th {
// border: 1px solid #ddd;
// padding: 6px;
//}
//#lijst tr:nth-child(even){background-color: #f2f2f2;}
//
//#lijst th {
// padding-top: 5px;
// padding-bottom: 5px;
// padding-left: 10px;
// text-align: left;
// background-color: #4CAF50;
// color: white;
//}
//tr {height:20px;}
//
//@media only screen and (max-width: 600px) {
//#lijst{ font-size:12px; }
//tr {height:10px;}
//#lijst td, #customers th { padding: 2px;}
//}
//</style>
//<script type="text/javascript" src="SECURITY"></script>
//</head>
//<body>
//<center>
//<ul>
//<li><a href='/'>close</a></li>
//<li><a href='/ABOUT'>info</a></li>
//<li><a onclick="return confirm('are you sure?')" href='/CLEAR_LOG'>clear</a></li>
//</ul>
//<br><kop>ECU LOG</kop>
//<div class='divstijl'>
//<table><tr><td style='width:240px;'>Last refresh : !@@!<td>
//
//<button onClick='window.location.reload();' style='width: 100px' value='0'>Refresh</button></table><br>
//
//<table id='lijst'>
//<tr><th style='width:16vw;'>Time</th>
//<th style='width:16vw;'>Type</th>
//<th style='width:56vw;'>Command</th></tr>
//<cont>
//
//</table></center></div>
//</div>
//</body>
//</html>
//)=====";
////</tr><tr><td>date </td><td>system</td><td>192.168.0.aaa.sss.ddd </td></tr>
//
//void zendPageLog( AsyncWebServerRequest *request ) {
//
// String uur = String(hour());
// if(hour() < 10) {
// uur = "0" + String(hour());
// }
// String minuten = String(minute());
// if(minute() < 10) {
// minuten = "0" + String(minute());
// }
//
//String cont = "";
//cont += uur + " : " + minuten + " hr.";
// char page[1536] = {0};
// char temp[100]={0};
// strcpy_P(page, ABOUT);
//char toSEND=FPSTR(HTML_LOGPAGE);
//
////toSEND.replace("HANSIART" , String(swName));
//
//toSEND.replace("!@@!", cont);
//
////DebugPrintln(" zendlogpage :build eventlist");
// byte Log_Count = 0;
// Log_MaxReached ? Log_Count = Log_MaxEvents : Log_Count = logNr; // determine if the max number of event is already reached
//
// int j = logNr;
// String content = "";
// for ( int i = 1; i <= Log_Count; i++ ) {
// //Serial.println("een regel van de lijst, nummer i = "); //Serial.println(i);
// j--; // we get the index of the last record in the array
// //Serial.println("een regel van de lijst, nummer j = "); //Serial.println(j);
// if (j ==-1) j = Log_MaxEvents - 1; // if we are under the first index of the array ,we go to the last
// ////////////////// One table line ///////////////////
//sprintf(temp,"<tr><td>%s</td><td>%s</td><td>%s</td>", Log_list[j].Log_date, Log_list[j].Log_kind, Log_list[j].Log_message);
//
// ////////////////// One table line ///////////////////
// }
// //Serial.print(content);
// toSEND.replace("<cont>", content);
// request->send(200, "text/html", toSEND);
//}
//
// void //Update_log(String what, String message) {
// String nu;
// //DebugPrintln("updating the log");
// if(what != "clear") {
// nu = String(day()) + "-" + String(hour()) + ":" + String(minute()) + ":" + String(second());
// } else {
// nu = "";
// what = "";}
// //DebugPrint("nu = "); DebugPrintln(nu);
// Log_list[logNr].Log_date = nu;
// Log_list[logNr].Log_kind = what;
// //Log_list[logNr].Log_issued = who;
// Log_list[logNr].Log_message = message;
// logNr++;
// if (logNr >= Log_MaxEvents)
// {
// logNr = 0;//start again
// Log_MaxReached = true;
// }
//}
////void //Update_log(String what, String message) {
//// String nu;
//// //DebugPrintln("updating the log");
//// if(what != "clear") {
//// nu = String(day()) + "-" + String(hour()) + ":" + String(minute()) + ":" + String(second());
//// } else {
//// nu = "";
//// what = "";}
//// //DebugPrint("nu = "); DebugPrintln(nu);
//// Log_list[logNr].Log_date = nu;
//// Log_list[logNr].Log_kind = what;
//// //Log_list[logNr].Log_issued = who;
//// Log_list[logNr].Log_message = message;
//// logNr++;
//// if (logNr >= Log_MaxEvents)
//// {
//// logNr = 0;//start again
//// Log_MaxReached = true;
//// }
////}
//
//void Clear_Log() {
// //Serial.println("clearing the log");
// if(logNr != 0) {
// String nu="";
// String what="";
// String message="";
// for (int i=0; i <= Log_MaxEvents; i++) {
// Update_Log("clear", "");
// }
// logNr = 0;//start again
// Log_MaxReached = false;
// //Serial.println("log cleared");
// }
//}