mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 13:36:54 +03:00
add html version
This commit is contained in:
@@ -83,6 +83,14 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "ClassLogFile.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
ClassFlowControll tfliteflow;
|
||||
|
||||
TaskHandle_t xHandleblink_task_doFlow = NULL;
|
||||
@@ -417,11 +419,19 @@ esp_err_t handler_sysinfo(httpd_req_t *req)
|
||||
const char* resp_str;
|
||||
string zw;
|
||||
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 = "[\
|
||||
{\
|
||||
\"firmware\" : \"2.0.0\",\
|
||||
\"html\" : \"1.0.1\",\
|
||||
\"firmware\" : \"" + gitversion + "\",\
|
||||
\"buildtime\" : \"" + buildtime + "\",\
|
||||
\"gitbranch\" : \"" + gitbranch + "\",\
|
||||
\"gitbasebranch\" : \"" + gitbasebranch + "\",\
|
||||
\"html\" : \"" + htmlversion + "\",\
|
||||
\"cputemp\" : \"" + cputemp + "\",\
|
||||
\"hostname\" : \"host\",\
|
||||
\"IPv4\" : \"IP\"\
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="bafd67b";
|
||||
const char* GIT_REV="9080f1d+";
|
||||
const char* GIT_TAG="";
|
||||
const char* GIT_BRANCH="master";
|
||||
const char* BUILD_TIME="2020-09-28 19:57";
|
||||
const char* GIT_BRANCH="rolling";
|
||||
const char* BUILD_TIME="2020-09-28 23:50";
|
||||
@@ -8,6 +8,8 @@ extern "C"
|
||||
extern const char* BUILD_TIME;
|
||||
}
|
||||
|
||||
#include <string>
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="bafd67b";
|
||||
const char* GIT_REV="9080f1d+";
|
||||
const char* GIT_TAG="";
|
||||
const char* GIT_BRANCH="master";
|
||||
const char* BUILD_TIME="2020-09-28 19:57";
|
||||
const char* GIT_BRANCH="rolling";
|
||||
const char* BUILD_TIME="2020-09-28 23:50";
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<title>Set PreValue</title>
|
||||
<meta charset="utf-8">
|
||||
|
||||
|
||||
<style>
|
||||
h1 {font-size: 2em;}
|
||||
h2 {font-size: 1.5em;}
|
||||
@@ -16,11 +16,11 @@ div {
|
||||
border: 1px solid #ccc;
|
||||
font-family: arial;
|
||||
font-size: 16px;
|
||||
max-height: 35px;
|
||||
max-height: 35px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ div {
|
||||
<object data="/version?type=GitBranch"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
@@ -49,7 +49,7 @@ div {
|
||||
<object data="/version?type=GitBaseBranch"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
@@ -60,7 +60,7 @@ div {
|
||||
<object data="/version?type=GitVersion"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
@@ -71,9 +71,20 @@ div {
|
||||
<object data="/version?type=BuildTime"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
HTML Version:
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<object data="/version?type=HTMLVersion"></object>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
1
sd-card/html/version.txt
Normal file
1
sd-card/html/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.0
|
||||
Reference in New Issue
Block a user