Prettified Code!

This commit is contained in:
Mashintime 2023-03-28 23:29:51 +00:00 committed by GitHub Action
parent 3193ad1e85
commit 273d4589a5

View file

@ -589,19 +589,19 @@ window.addEventListener("DOMContentLoaded", () => {
switch (os.platform().toLowerCase()) { switch (os.platform().toLowerCase()) {
case "darwin": case "darwin":
case "linux": case "linux":
rigctld = rigctld.replace(" ","\\ "); rigctld = rigctld.replace(" ", "\\ ");
break; break;
case "win32": case "win32":
case "win64": case "win64":
if (rigctld.indexOf(" ") > -1) if (rigctld.indexOf(" ") > -1) rigctld = '"' + rigctld + '"';
rigctld = "\"" + rigctld + "\"";
break; break;
default: default:
console.log("Unhandled OS Platform: ", os.platform()); console.log("Unhandled OS Platform: ", os.platform());
break; break;
} }
rigctld += " " + document.getElementById("hamlib_rigctld_command").value + " -vv"; rigctld +=
" " + document.getElementById("hamlib_rigctld_command").value + " -vv";
document.getElementById("btnHamlibCopyCommandBi").classList = document.getElementById("btnHamlibCopyCommandBi").classList =
"bi bi-clipboard2-check-fill"; "bi bi-clipboard2-check-fill";
clipboard.writeText(rigctld); clipboard.writeText(rigctld);
@ -2359,9 +2359,9 @@ ipcRenderer.on("action-update-daemon-state", (event, arg) => {
document.getElementById("node_version").innerHTML = "Node " + process.version document.getElementById("node_version").innerHTML = "Node " + process.version
document.getElementById("node_version").className = "btn btn-sm btn-success"; document.getElementById("node_version").className = "btn btn-sm btn-success";
*/ */
if (arg.tnc_running_state != "stopped" && populateSerial == true) return; if (arg.tnc_running_state != "stopped" && populateSerial == true) return;
// UPDATE SERIAL DEVICES // UPDATE SERIAL DEVICES
if ( if (
document.getElementById("hamlib_deviceport").length != document.getElementById("hamlib_deviceport").length !=
arg.serial_devices.length arg.serial_devices.length
@ -2409,46 +2409,43 @@ ipcRenderer.on("action-update-daemon-state", (event, arg) => {
//Serial devices are updated on first pass //Serial devices are updated on first pass
populateSerial = true; populateSerial = true;
if (arg.tnc_running_state != "stopped") return; if (arg.tnc_running_state != "stopped") return;
// UPDATE AUDIO INPUT // UPDATE AUDIO INPUT
if ( if (
document.getElementById("audio_input_selectbox").length != document.getElementById("audio_input_selectbox").length !=
arg.input_devices.length arg.input_devices.length
) { ) {
document.getElementById("audio_input_selectbox").innerHTML = ""; document.getElementById("audio_input_selectbox").innerHTML = "";
for (i = 0; i < arg.input_devices.length; i++) { for (i = 0; i < arg.input_devices.length; i++) {
var option = document.createElement("option"); var option = document.createElement("option");
option.text = arg.input_devices[i]["name"]; option.text = arg.input_devices[i]["name"];
option.value = arg.input_devices[i]["id"]; option.value = arg.input_devices[i]["id"];
// set device from config if available // set device from config if available
if (config.rx_audio == option.text) { if (config.rx_audio == option.text) {
option.setAttribute("selected", true); option.setAttribute("selected", true);
}
document.getElementById("audio_input_selectbox").add(option);
} }
document.getElementById("audio_input_selectbox").add(option);
} }
}
// UPDATE AUDIO OUTPUT // UPDATE AUDIO OUTPUT
if ( if (
document.getElementById("audio_output_selectbox").length != document.getElementById("audio_output_selectbox").length !=
arg.output_devices.length arg.output_devices.length
) { ) {
document.getElementById("audio_output_selectbox").innerHTML = ""; document.getElementById("audio_output_selectbox").innerHTML = "";
for (i = 0; i < arg.output_devices.length; i++) { for (i = 0; i < arg.output_devices.length; i++) {
var option = document.createElement("option"); var option = document.createElement("option");
option.text = arg.output_devices[i]["name"]; option.text = arg.output_devices[i]["name"];
option.value = arg.output_devices[i]["id"]; option.value = arg.output_devices[i]["id"];
// set device from config if available // set device from config if available
if (config.tx_audio == option.text) { if (config.tx_audio == option.text) {
option.setAttribute("selected", true); option.setAttribute("selected", true);
}
document.getElementById("audio_output_selectbox").add(option);
} }
document.getElementById("audio_output_selectbox").add(option);
} }
}
}); });
// ACTION UPDATE HAMLIB TEST // ACTION UPDATE HAMLIB TEST