implementing ota update over ui

This commit is contained in:
Bogdan Pilyugin 2023-08-21 09:13:49 +02:00
parent c1700adc0c
commit 425d9747bb
2 changed files with 12 additions and 5 deletions

View File

@ -10,8 +10,11 @@
<q-toggle v-model="data.res_ota_enab" label="Enable reset after update" />
<q-input v-model="data.ota_url" label="OTA firmware file URL" />
<q-input type="number" v-model="data.ota_auto_int" label="New firmware check interval, sec" />
<div>Current firmware version:: {{ data.fw_rev }}</div>
<div>Available firmware version:: {{ data.fw_rev }}</div>
<div>Current firmware version: {{ data.fw_rev }}</div>
<div>Available firmware version: {{ data.fw_rev }}</div>
<div>Firmware status: {{ data.ota_state }}
</div>
<q-btn color="primary" label="Check firmware" @click="CheckFirmware()"></q-btn>
</div>
</div>
</q-card-section>
@ -29,10 +32,13 @@ defineOptions({
})
const init = {
ota_enab: false, res_ota_enab: false, ota_url: "", ota_auto_int: 0, fw_rev: ""
ota_enab: false, res_ota_enab: false, ota_url: '',
ota_auto_int: 0, fw_rev: '', ota_newver: '', ota_state: ''
}
const data = reactive(init);
PostData(data, 2, 0, null);
function CheckFirmware() {
PostData({ ota_start: 1 }, 2, 0, () => { });
}
</script>

View File

@ -14,7 +14,8 @@ function ShowDelayDialog(mess, time, onexpire) {
message: '',
progress: true,
persistent: true, // we want the user to not be able to close it
ok: false // we want the user to not be able to close it
ok: false, // we want the user to not be able to close it
square: true
})
let percentage = 0