добавил sha256 для файла обновления

This commit is contained in:
2024-11-14 11:34:28 +03:00
parent 0dcc562b7d
commit eda26319c4
5 changed files with 15 additions and 6 deletions

View File

@@ -619,6 +619,7 @@
<label>
<span>Файл {{ this.uploadFw.progress !== null ? `(${this.uploadFw.progress}%)` : '' }}</span>
<input type="file" accept="application/zip" @change="(e) => { this.uploadFw.filename = e.target.files[0] }">
<span v-if="uploadFw.sha256 !== null">SHA256: {{ uploadFw.sha256 }}</span>
</label>
<button class="dangerous-button" @click="settingsUploadUpdate()">Обновить встроенное ПО <span class="submit-spinner" v-show="submitStatus.firmwareUpload"></span></button>
</div>
@@ -954,7 +955,8 @@
uploadFw: {
progress: null,
filename: null
filename: null,
sha256: null
},
testState: false,
@@ -1313,6 +1315,8 @@
});
xhr.addEventListener("loadend", () => {
this.uploadFw.progress = 100
const rep = JSON.parse(xhr.responseText);
this.uploadFw.sha256 = rep['sha256']
resolve(xhr.readyState === 4 && xhr.status === 200);
});
xhr.open("PUT", "/api/firmwareUpdate", true);