diff --git a/code/main/server_main.cpp b/code/main/server_main.cpp index 7579f902..6d57fe06 100644 --- a/code/main/server_main.cpp +++ b/code/main/server_main.cpp @@ -80,10 +80,11 @@ esp_err_t info_get_handler(httpd_req_t *req) return ESP_OK; } - // No longer used 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); return ESP_OK; } diff --git a/sd-card/html/common.js b/sd-card/html/common.js index 130bda20..9204ac07 100644 --- a/sd-card/html/common.js +++ b/sd-card/html/common.js @@ -29,3 +29,28 @@ function LoadHostname() { // 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) + {} +} diff --git a/sd-card/html/index.html b/sd-card/html/index.html index abc824b0..bcc47493 100644 --- a/sd-card/html/index.html +++ b/sd-card/html/index.html @@ -151,8 +151,11 @@ li.dropdown { +Loading version... + diff --git a/sd-card/html/index_configure.html b/sd-card/html/index_configure.html index 9fee5888..1f9406b9 100644 --- a/sd-card/html/index_configure.html +++ b/sd-card/html/index_configure.html @@ -152,11 +152,15 @@ li.dropdown { +Loading version... + +