link system information page

This commit is contained in:
technyon
2023-02-05 12:36:34 +01:00
parent 4dd1a9e516
commit 506bdbe8a8
2 changed files with 25 additions and 5 deletions

View File

@@ -487,7 +487,7 @@ void WebCfgServer::buildHtml(String& response)
printParameter(response, "NUKI Opener paired", _nukiOpener->isPaired() ? ("Yes (BLE Address " + _nukiOpener->getBleAddress().toString() + ")").c_str() : "No");
printParameter(response, "NUKI Opener state", lockstateArr);
}
printParameter(response, "Firmware", version.c_str());
printParameter(response, "Firmware", version.c_str(), "/info");
response.concat("</table><br><br>");
response.concat("<h3>MQTT and Network Configuration</h3>");
@@ -711,7 +711,12 @@ void WebCfgServer::buildInfoHtml(String &response)
DebugPreferences debugPreferences;
buildHtmlHeader(response);
response.concat("<h3>Info</h3> <pre>");
response.concat("<h3>System Information</h3> <pre>");
response.concat("Firmware version: ");
response.concat(NUKI_HUB_VERSION);
response.concat("\n");
response.concat(debugPreferences.preferencesToString(_preferences));
response.concat("Lock PIN set: ");
@@ -719,6 +724,10 @@ void WebCfgServer::buildInfoHtml(String &response)
response.concat("Opener PIN set: ");
response.concat(_nukiOpener->isPinSet() ? "Yes\n" : "No\n");
response.concat("Heap: ");
response.concat(esp_get_free_heap_size());
response.concat("\n");
response.concat("</pre> </BODY></HTML>");
}
@@ -912,14 +921,25 @@ void WebCfgServer::buildNavigationButton(String &response, const char *caption,
response.concat("</form>");
}
void WebCfgServer::printParameter(String& response, const char *description, const char *value)
void WebCfgServer::printParameter(String& response, const char *description, const char *value, const char *link)
{
response.concat("<tr>");
response.concat("<td>");
response.concat(description);
response.concat("</td>");
response.concat("<td>");
response.concat(value);
if(strcmp(link, "") == 0)
{
response.concat(value);
}
else
{
response.concat("<a href=\"");
response.concat(link);
response.concat("\"> ");
response.concat(value);
response.concat("</a>");
}
response.concat("</td>");
response.concat("</tr>");

View File

@@ -53,7 +53,7 @@ private:
const std::vector<std::pair<String, String>> getNetworkDetectionOptions() const;
const std::vector<std::pair<String, String>> getNetworkGpioOptions() const;
void printParameter(String& response, const char* description, const char* value);
void printParameter(String& response, const char* description, const char* value, const char *link = "");
String generateConfirmCode();
void waitAndProcess(const bool blocking, const uint32_t duration);