mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 04:56:53 +03:00
show version in index pages
This commit is contained in:
@@ -80,10 +80,11 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No longer used
|
|
||||||
if (_task.compare("GitBaseBranch") == 0)
|
if (_task.compare("GitBaseBranch") == 0)
|
||||||
{
|
{
|
||||||
httpd_resp_sendstr_chunk(req, "");
|
string buf = "Branch: '" + std::string(GIT_BRANCH) + "', Tag: '" + std::string(GIT_TAG) + \
|
||||||
|
"', Revision: " + std::string(GIT_REV);
|
||||||
|
httpd_resp_sendstr_chunk(req, buf.c_str());
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,3 +29,28 @@ function LoadHostname() {
|
|||||||
// alert("Loading Hostname failed");
|
// alert("Loading Hostname failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function LoadVersion() {
|
||||||
|
_basepath = getbasepath();
|
||||||
|
|
||||||
|
var xhttp = new XMLHttpRequest();
|
||||||
|
xhttp.addEventListener('load', function(event) {
|
||||||
|
if (xhttp.status >= 200 && xhttp.status < 300) {
|
||||||
|
version = xhttp.responseText;
|
||||||
|
document.getElementById("Version").innerHTML = version;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.warn(request.statusText, request.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
url = _basepath + '/version?type=GitBaseBranch';
|
||||||
|
xhttp.open("GET", url, true);
|
||||||
|
xhttp.send();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
|||||||
@@ -151,8 +151,11 @@ li.dropdown {
|
|||||||
|
|
||||||
<iframe name="maincontent" class="iframe" id="maincontent" src="wasserzaehler_roi.html"></iframe>
|
<iframe name="maincontent" class="iframe" id="maincontent" src="wasserzaehler_roi.html"></iframe>
|
||||||
|
|
||||||
|
<span id="Version" style="font-size: 10px; margin-top: -5px">Loading version...</span>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
LoadHostname();
|
LoadHostname();
|
||||||
|
LoadVersion();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -152,11 +152,15 @@ li.dropdown {
|
|||||||
|
|
||||||
<iframe name="maincontent" class="iframe" id="maincontent" src="edit_config_param.html"></iframe>
|
<iframe name="maincontent" class="iframe" id="maincontent" src="edit_config_param.html"></iframe>
|
||||||
|
|
||||||
|
<span id="Version" style="font-size: 10px; margin-top: -5px">Loading version...</span>
|
||||||
|
|
||||||
<script type="text/javascript" src="common.js"></script>
|
<script type="text/javascript" src="common.js"></script>
|
||||||
<script type="text/javascript" src="gethost.js"></script>
|
<script type="text/javascript" src="gethost.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
LoadHostname();
|
LoadHostname();
|
||||||
|
LoadVersion();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user