Fix some issues with check modal and modem refresh btn

This commit is contained in:
Mashintime 2023-11-23 01:04:04 -05:00
parent 22e2f2f08a
commit 01ae2748c8
2 changed files with 25 additions and 5 deletions

View file

@ -28,11 +28,15 @@ var updateAvailable = process.env.FDUpdateAvail;
// start modemCheck modal once on startup
onMounted(() => {
getModemState();
getVersion();
getModemState().then();
getVersion().then(res => {state.modem_version=res});
new Modal("#modemCheck", {}).show();
});
function refreshModem() {
getModemState();
}
function getModemStateLocal() {
// Returns active/inactive if modem is running for modem status label
if (state.is_modem_running == true) return "Active";
@ -197,6 +201,20 @@ function testHamlib() {
<i class="bi bi-stop-fill"></i>
</button>
</label>
<label class="input-group-text">
<button
type="button"
id="refreshModem"
class="btn btn-sm btn-outline-secondary"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Refresh modem status."
@click="refreshModem"
>
<i class="bi bi-bullseye"></i>
</button>
</label>
</div>
<!-- Audio Input Device -->
<div class="input-group input-group-sm mb-1">

View file

@ -35,11 +35,13 @@ export async function apiPost(endpoint, payload = {}) {
}
}
export function getVersion() {
return apiGet("/version");
export async function getVersion() {
let data = await apiGet("/version").then(res => {return res});
return data.version;
//return data["version"];
}
export function getConfig() {
export async function getConfig() {
return apiGet("/config");
}