mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Eliminate multiple GET /config requests
This commit is contained in:
parent
381c0d7813
commit
e861dde9c8
|
@ -3,8 +3,6 @@ import { setActivePinia } from "pinia";
|
||||||
import pinia from "../store/index";
|
import pinia from "../store/index";
|
||||||
setActivePinia(pinia);
|
setActivePinia(pinia);
|
||||||
|
|
||||||
import { getRemote } from "../store/settingsStore";
|
|
||||||
|
|
||||||
import main_modals from "./main_modals.vue";
|
import main_modals from "./main_modals.vue";
|
||||||
import main_top_navbar from "./main_top_navbar.vue";
|
import main_top_navbar from "./main_top_navbar.vue";
|
||||||
import main_rig_control from "./main_rig_control.vue";
|
import main_rig_control from "./main_rig_control.vue";
|
||||||
|
@ -19,9 +17,7 @@ import main_active_audio_level from "./main_active_audio_level.vue";
|
||||||
|
|
||||||
import chat from "./chat.vue";
|
import chat from "./chat.vue";
|
||||||
import infoScreen from "./infoScreen.vue";
|
import infoScreen from "./infoScreen.vue";
|
||||||
|
|
||||||
import main_modem_healthcheck from "./main_modem_healthcheck.vue";
|
import main_modem_healthcheck from "./main_modem_healthcheck.vue";
|
||||||
getRemote();
|
|
||||||
|
|
||||||
function stopAllTransmissions() {
|
function stopAllTransmissions() {
|
||||||
console.log("stopping transmissions");
|
console.log("stopping transmissions");
|
||||||
|
|
|
@ -25,10 +25,7 @@ var updateAvailable = process.env.FDUpdateAvail;
|
||||||
|
|
||||||
// start modemCheck modal once on startup
|
// start modemCheck modal once on startup
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getModemConfig();
|
|
||||||
getModemCurrentState();
|
getModemCurrentState();
|
||||||
getModemVersion();
|
|
||||||
getConfig();
|
|
||||||
getVersion();
|
getVersion();
|
||||||
new Modal("#modemCheck", {}).show();
|
new Modal("#modemCheck", {}).show();
|
||||||
});
|
});
|
||||||
|
@ -45,20 +42,21 @@ function getNetworkState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRigControlStuff() {
|
function getRigControlStuff() {
|
||||||
switch (settings.radiocontrol) {
|
switch (settings.remote.RADIO.radiocontrol) {
|
||||||
case "disabled":
|
case "disabled":
|
||||||
return true;
|
return true;
|
||||||
case "rigctld":
|
case "rigctld":
|
||||||
if (state.rigctld_started == "true") {
|
if (state.rigctld_started === true) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case "tci":
|
case "tci":
|
||||||
return true;
|
return true;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
console.error("Unknown radio control mode " + settings.radiocontrol);
|
console.error(
|
||||||
|
"Unknown radio control mode " + settings.remote.RADIO.radiocontrol,
|
||||||
|
);
|
||||||
return "Unknown control type";
|
return "Unknown control type";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,20 +145,6 @@ export function processModemConfig(data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function processModemAudioDevices(data) {
|
|
||||||
console.log(data);
|
|
||||||
audioStore.inputDevices = data["in"];
|
|
||||||
audioStore.outputDevices = data["out"];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function processModemSerialDevices(data) {
|
|
||||||
settings.serial_devices = data;
|
|
||||||
}
|
|
||||||
export function processModemVersion(data) {
|
|
||||||
//data = JSON.parse(data);
|
|
||||||
stateStore.modem_version = data["version"];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getModemConfigAsJSON() {
|
export function getModemConfigAsJSON() {
|
||||||
// create json output from settings
|
// create json output from settings
|
||||||
// TODO Can we make this more dynamic? Maybe using a settings object?
|
// TODO Can we make this more dynamic? Maybe using a settings object?
|
||||||
|
|
|
@ -16,4 +16,6 @@ export function getRemote() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settingsStore.remote["STATION"] === undefined) {
|
||||||
getRemote();
|
getRemote();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue