add html version

This commit is contained in:
Philipp Harsch
2020-09-29 00:15:12 +02:00
parent 9080f1d2f0
commit 964486a819
7 changed files with 66 additions and 16 deletions

View File

@@ -83,6 +83,14 @@ esp_err_t info_get_handler(httpd_req_t *req)
return ESP_OK; return ESP_OK;
} }
if (_task.compare("HTMLVersion") == 0)
{
std::string zw;
zw = std::string(getHTMLversion());
httpd_resp_sendstr_chunk(req, zw.c_str());
httpd_resp_sendstr_chunk(req, NULL);
return ESP_OK;
}
return ESP_OK; return ESP_OK;
} }

View File

@@ -18,6 +18,8 @@
#include "ClassLogFile.h" #include "ClassLogFile.h"
#include "version.h"
ClassFlowControll tfliteflow; ClassFlowControll tfliteflow;
TaskHandle_t xHandleblink_task_doFlow = NULL; TaskHandle_t xHandleblink_task_doFlow = NULL;
@@ -417,11 +419,19 @@ esp_err_t handler_sysinfo(httpd_req_t *req)
const char* resp_str; const char* resp_str;
string zw; string zw;
string cputemp = std::to_string(temperatureRead()); string cputemp = std::to_string(temperatureRead());
string gitversion = libfive_git_version();
string buildtime = build_time();
string gitbranch = libfive_git_branch();
string gitbasebranch = git_base_branch();
string htmlversion = getHTMLversion();
zw = "[\ zw = "[\
{\ {\
\"firmware\" : \"2.0.0\",\ \"firmware\" : \"" + gitversion + "\",\
\"html\" : \"1.0.1\",\ \"buildtime\" : \"" + buildtime + "\",\
\"gitbranch\" : \"" + gitbranch + "\",\
\"gitbasebranch\" : \"" + gitbasebranch + "\",\
\"html\" : \"" + htmlversion + "\",\
\"cputemp\" : \"" + cputemp + "\",\ \"cputemp\" : \"" + cputemp + "\",\
\"hostname\" : \"host\",\ \"hostname\" : \"host\",\
\"IPv4\" : \"IP\"\ \"IPv4\" : \"IP\"\

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="bafd67b"; const char* GIT_REV="9080f1d+";
const char* GIT_TAG=""; const char* GIT_TAG="";
const char* GIT_BRANCH="master"; const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2020-09-28 19:57"; const char* BUILD_TIME="2020-09-28 23:50";

View File

@@ -8,6 +8,8 @@ extern "C"
extern const char* BUILD_TIME; extern const char* BUILD_TIME;
} }
#include <string>
const char* GIT_BASE_BRANCH = "master - v2.1.1 - 2020-09-28"; const char* GIT_BASE_BRANCH = "master - v2.1.1 - 2020-09-28";
@@ -35,4 +37,22 @@ const char* libfive_git_revision(void)
const char* libfive_git_branch(void) const char* libfive_git_branch(void)
{ {
return GIT_BRANCH; return GIT_BRANCH;
}
std::string getHTMLversion(void){
string line = "";
FILE* pFile;
string fn = FormatFileName("/sdcard/html/version.txt");
pFile = fopen(fn.c_str(), "r");
if (pFile == NULL)
return std::string("NAN");
char zw[1024];
fgets(zw, 1024, pFile);
line = std::string(trim(zw));
return line;
} }

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="bafd67b"; const char* GIT_REV="9080f1d+";
const char* GIT_TAG=""; const char* GIT_TAG="";
const char* GIT_BRANCH="master"; const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2020-09-28 19:57"; const char* BUILD_TIME="2020-09-28 23:50";

View File

@@ -3,7 +3,7 @@
<head> <head>
<title>Set PreValue</title> <title>Set PreValue</title>
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
h1 {font-size: 2em;} h1 {font-size: 2em;}
h2 {font-size: 1.5em;} h2 {font-size: 1.5em;}
@@ -16,11 +16,11 @@ div {
border: 1px solid #ccc; border: 1px solid #ccc;
font-family: arial; font-family: arial;
font-size: 16px; font-size: 16px;
max-height: 35px; max-height: 35px;
} }
</style> </style>
</head> </head>
@@ -38,7 +38,7 @@ div {
<object data="/version?type=GitBranch"></object> <object data="/version?type=GitBranch"></object>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
@@ -49,7 +49,7 @@ div {
<object data="/version?type=GitBaseBranch"></object> <object data="/version?type=GitBaseBranch"></object>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
@@ -60,7 +60,7 @@ div {
<object data="/version?type=GitVersion"></object> <object data="/version?type=GitVersion"></object>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
@@ -71,9 +71,20 @@ div {
<object data="/version?type=BuildTime"></object> <object data="/version?type=BuildTime"></object>
</div> </div>
</td> </td>
</tr>
<tr>
<td>
HTML Version:
</td>
<td>
<div>
<object data="/version?type=HTMLVersion"></object>
</div>
</td>
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>

1
sd-card/html/version.txt Normal file
View File

@@ -0,0 +1 @@
1.0.0