Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Käppler
ampel-firmware
Commits
6f313488
Commit
6f313488
authored
Dec 19, 2020
by
Eric Duminil
Browse files
Adding links to source code and documentation on web-server
parent
45660953
Changes
1
Hide whitespace changes
Inline
Side-by-side
web_server.cpp
View file @
6f313488
...
...
@@ -42,9 +42,9 @@ namespace web_server {
PSTR
(
"<!doctype html><html lang=en>"
"<head>
\n
"
"<title>%d ppm - CO2 SENSOR - %s - %s</title>
\n
"
"<meta charset='UTF-8'>"
"<meta charset='UTF-8'>
\n
"
// HfT Favicon
"<link rel='icon' type='image/png' sizes='16x16' href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAHtJREFUOE9jvMnA+5+BAsBIFQMkl85h+P3kGcOb8jqwW+TPH2H4de0GA29UGNxtfx49YWCRk0HwHz5iuKegwwB2AS4DkA2F6VR6cAWsEQbgBqDY9vARw/ejJ+Au+LxsFcPz6BSwHpwGYPMCSS6gyAAKYhESiKMGjPgwAADopHVhn5ynEwAAAABJRU5ErkJggg=='/>"
"<link rel='icon' type='image/png' sizes='16x16' href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAHtJREFUOE9jvMnA+5+BAsBIFQMkl85h+P3kGcOb8jqwW+TPH2H4de0GA29UGNxtfx49YWCRk0HwHz5iuKegwwB2AS4DkA2F6VR6cAWsEQbgBqDY9vARw/ejJ+Au+LxsFcPz6BSwHpwGYPMCSS6gyAAKYhESiKMGjPgwAADopHVhn5ynEwAAAABJRU5ErkJggg=='/>
\n
"
// Responsive grid:
"<link rel='stylesheet' href='https://unpkg.com/purecss@2.0.3/build/pure-min.css'>
\n
"
"<link rel='stylesheet' href='https://unpkg.com/purecss@2.0.3/build/grids-responsive-min.css'>
\n
"
...
...
@@ -93,12 +93,15 @@ namespace web_server {
"<tr><td>Board</td><td>%s</td></tr>
\n
"
"<tr><td>Uptime</td><td>%4d h %02d min %02d s</td></tr>
\n
"
"</table>
\n
"
// CSV placeholder
"<div id='log' class='pure-u-1 pure-u-md-1-2'></div>
\n
"
"<form action='/delete_csv' method='POST' onsubmit=
\"
return confirm('Are you really sure you want to delete all data?') && (document.body.style.cursor = 'wait');
\"
>"
"<input type='submit' value='Delete CSV'/>"
"</form>
\n
"
"</div>
\n
"
);
"</div>
\n
"
"<a href='https://transfer.hft-stuttgart.de/gitlab/co2ampel/ampel-firmware' target='_blank'>Source code</a>
\n
"
"<a href='https://transfer.hft-stuttgart.de/gitlab/co2ampel/ampel-documentation' target='_blank'>Documentation</a>
\n
"
);
//TODO: Show PPM Color
script_template
=
PSTR
(
"<script>
\n
"
"document.body.style.cursor = 'default';
\n
"
...
...
@@ -176,7 +179,8 @@ namespace web_server {
//NOTE: Splitting in multiple parts in order to use less RAM
char
content
[
2000
];
// Update if needed
// Header size : 1383 - Body size : 1246 - Script size : 1648
// Header size : 1384 - Body size : 1652 - Script size : 1688
// Header
snprintf_P
(
content
,
sizeof
(
content
),
header_template
,
sensor
::
co2
,
SENSOR_ID
.
c_str
(),
WiFi
.
localIP
().
toString
().
c_str
(),
csv_writer
::
filename
.
c_str
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment