-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'd39e2ebce8a9e7ddb64ca8e8060bbdbe2d9123a8' as 'software/…
…NRG_itho_wifi'
- Loading branch information
Showing
16 changed files
with
2,772 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
const char html_mainpage[] PROGMEM = R"=====( | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content="A layout example with a side menu that hides on mobile, just like the Pure website."> | ||
<title>Itho WiFi controller – System setup</title> | ||
<script src="/js/zepto.min.js"></script> | ||
<script src="/js/controls.js"></script> | ||
<link rel="stylesheet" href="pure-min.css"> | ||
</head> | ||
<body> | ||
<div id="layout"> | ||
<div id="message_box"></div> | ||
<!-- Menu toggle --> | ||
<a href="#menu" id="menuLink" class="menu-link"> | ||
<!-- Hamburger icon --> | ||
<span></span> | ||
</a> | ||
<div id="menu"> | ||
<div class="pure-menu"> | ||
<a class="pure-menu-heading" id="headingindex" href="index">Itho WiFi controller</a> | ||
<ul class="pure-menu-list"> | ||
<li class="pure-menu-item"><a href="wifisetup" class="pure-menu-link">Wifi setup</a></li> | ||
<li class="pure-menu-item"><a href="mqtt" class="pure-menu-link">MQTT</a></li> | ||
<li class="pure-menu-item"><a href="help" class="pure-menu-link">Help</a></li> | ||
<li class="pure-menu-item"><a href="update" class="pure-menu-link">Update</a></li> | ||
<li class="pure-menu-item"><a href="reset" class="pure-menu-link">Reset</a></li> | ||
<li class="pure-menu-item"><a href="debug" class="pure-menu-link">Debug</a></li> | ||
</ul> | ||
<div id="memory_box"></div> | ||
</div> | ||
</div> | ||
<div id="main"> | ||
</div> | ||
</div> | ||
</body> | ||
<script src="/js/general.js"></script> | ||
</html> | ||
)====="; | ||
|
||
|
||
void handleMainpage(AsyncWebServerRequest *request) { | ||
request->send_P(200, "text/html", html_mainpage); | ||
} | ||
|
||
void handleDebug(AsyncWebServerRequest *request) { | ||
AsyncResponseStream *response = request->beginResponseStream("text/html"); | ||
|
||
response->print("<div class=\"header\"><h1>Debug page</h1></div><br><br>"); | ||
response->print("<div>Firmware version: "); | ||
response->print(FWVERSION); | ||
response->print("<br><br>Config version: "); | ||
response->print(CONFIG_VERSION); | ||
response->print("</vid>"); | ||
|
||
request->send(response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
|
||
void css_code(AsyncWebServerRequest *request) { | ||
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/css", pure_min_css_gz, pure_min_css_gz_len); | ||
response->addHeader("Content-Encoding", "gzip"); | ||
request->send(response); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
void zepto_min_js_gz_code(AsyncWebServerRequest *request) { | ||
AsyncWebServerResponse *response = request->beginResponse_P(200, "application/javascript", zepto_min_js_gz, zepto_min_js_gz_len); | ||
response->addHeader("Content-Encoding", "gzip"); | ||
request->send(response); | ||
} | ||
|
||
void handleGeneralJs(AsyncWebServerRequest *request) { | ||
AsyncResponseStream *response = request->beginResponseStream("application/javascript"); | ||
response->addHeader("Server","Project WiFi Web Server"); | ||
|
||
response->print("var on_ap = false; var hostname = '"); | ||
response->print(EspHostname()); | ||
response->print("'; $(document).ready(function() { $('#headingindex').text(hostname); $('#headingindex').attr('href', 'http://' + hostname + '.local'); $('#main').append(html_index); });"); | ||
|
||
request->send(response); | ||
} | ||
|
||
void handleGeneralJsOnAp(AsyncWebServerRequest *request) { | ||
AsyncResponseStream *response = request->beginResponseStream("application/javascript"); | ||
response->addHeader("Server","Project WiFi Web Server"); | ||
|
||
response->print("var on_ap = true; var hostname = '"); | ||
response->print(EspHostname()); | ||
response->print("'; $(document).ready(function() { $('#headingindex').text(hostname); $('#headingindex').attr('href', 'http://' + hostname + '.local'); $('#main').append(html_wifisetup); });"); | ||
|
||
request->send(response); | ||
} |
Oops, something went wrong.