Sfoglia il codice sorgente

fix version check (#1374)

Co-authored-by: CaCO3 <caco@ruinelli.ch>
CaCO3 3 anni fa
parent
commit
513e300676
2 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 1 1
      code/main/CMakeLists.txt
  2. 5 2
      sd-card/html/common.js

+ 1 - 1
code/main/CMakeLists.txt

@@ -39,7 +39,7 @@ set(VERSION "const char* GIT_REV=\"${GIT_REV}${GIT_DIFF}\";
 const char* GIT_TAG=\"${GIT_TAG}\";
 const char* GIT_TAG=\"${GIT_TAG}\";
 const char* GIT_BRANCH=\"${GIT_BRANCH}\";
 const char* GIT_BRANCH=\"${GIT_BRANCH}\";
 const char* BUILD_TIME=\"${BUILD_TIME}\";")
 const char* BUILD_TIME=\"${BUILD_TIME}\";")
-set(VERSION_HTML "${GIT_BRANCH}, ${GIT_REV}${GIT_DIFF}, ${GIT_TAG}")
+set(VERSION_HTML "${GIT_BRANCH}, ${GIT_TAG}, ${GIT_REV}${GIT_DIFF}")
 
 
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)
     file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_)
     file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_)

+ 5 - 2
sd-card/html/common.js

@@ -95,8 +95,11 @@ function compareVersions() {
 
 
     arr = fwVersion.split(" ");
     arr = fwVersion.split(" ");
     fWGitHash = arr[arr.length - 1].substring(0, 7);
     fWGitHash = arr[arr.length - 1].substring(0, 7);
+    arr = webUiVersion.split(" ");
+    webUiHash = arr[arr.length - 1].substring(0, 7);
+    console.log("FW Hash: " + fWGitHash + ", Web UI Hash: " + webUiHash);
     
     
-    if (fWGitHash != webUiVersion) {
-        alert("The Version of the Web Interface does not match the Firmware Version!");
+    if (fWGitHash != webUiHash) {
+        alert("The Version of the Web Interface does not match the Firmware Version! It is suggested to keep them on the same version!");
     }
     }
 }
 }