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;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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\"\
|
||||||
|
|||||||
@@ -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";
|
||||||
@@ -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";
|
||||||
|
|
||||||
|
|
||||||
@@ -36,3 +38,21 @@ 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;
|
||||||
|
}
|
||||||
@@ -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";
|
||||||
@@ -71,6 +71,17 @@ 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>
|
||||||
|
|
||||||
|
|||||||
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