From e961872f145295c0f772fbcf98929285897b20d9 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Wed, 5 Apr 2023 19:34:47 +0200 Subject: [PATCH] Fix: Handle format "v0.1-5-gabcdefh" of git hash --- webapp/src/views/SystemInfoView.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webapp/src/views/SystemInfoView.vue b/webapp/src/views/SystemInfoView.vue index 7150aa1..d34d6ce 100644 --- a/webapp/src/views/SystemInfoView.vue +++ b/webapp/src/views/SystemInfoView.vue @@ -50,7 +50,14 @@ export default defineComponent({ }) }, getUpdateInfo() { + // If the left char is a "g" the value is the git hash (remove the "g") this.systemDataList.git_hash = this.systemDataList.git_hash?.substring(0, 1) == 'g' ? this.systemDataList.git_hash?.substring(1) : this.systemDataList.git_hash; + + // Handle format "v0.1-5-gabcdefh" + if (this.systemDataList.git_hash.lastIndexOf("-") >= 0) { + this.systemDataList.git_hash = this.systemDataList.git_hash.substring(this.systemDataList.git_hash.lastIndexOf("-") + 2) + } + const fetchUrl = "https://api.github.com/repos/tbnobody/OpenDTU/compare/" + this.systemDataList.git_hash + "...HEAD";