webapp: Only cut first char of git_hash if it equals "g"

This commit is contained in:
Thomas Basler 2023-04-04 20:50:47 +02:00
parent 93c69dbbeb
commit 3e4747e4b0
2 changed files with 4 additions and 3 deletions

View File

@ -17,9 +17,9 @@
</tr>
<tr>
<th>{{ $t('firmwareinfo.FirmwareVersion') }}</th>
<td><a :href="'https://github.com/tbnobody/OpenDTU/commits/' + systemStatus.git_hash?.substring(1)"
<td><a :href="'https://github.com/tbnobody/OpenDTU/commits/' + systemStatus.git_hash"
target="_blank" v-tooltip :title="$t('firmwareinfo.FirmwareVersionHint')">
{{ systemStatus.git_hash?.substring(1) }}
{{ systemStatus.git_hash }}
</a></td>
</tr>
<tr>

View File

@ -50,8 +50,9 @@ export default defineComponent({
})
},
getUpdateInfo() {
this.systemDataList.git_hash = this.systemDataList.git_hash?.substring(0, 1) == 'g' ? this.systemDataList.git_hash?.substring(1) : this.systemDataList.git_hash;
const fetchUrl = "https://api.github.com/repos/tbnobody/OpenDTU/compare/"
+ this.systemDataList.git_hash?.substring(1) + "...HEAD";
+ this.systemDataList.git_hash + "...HEAD";
fetch(fetchUrl)
.then((response) => {