preselect rigctld device

This commit is contained in:
DJ2LS 2023-10-21 11:51:54 +02:00
parent df95f4b82c
commit df3be3134d
2 changed files with 9 additions and 2 deletions

View file

@ -20,7 +20,6 @@ function startStopRigctld() {
settings.hamlib_deviceport = (<HTMLInputElement>document.getElementById("hamlib_deviceport")).value;
startRigctld();
break;

View file

@ -81,7 +81,15 @@ export const useSettingsStore = defineStore("settingsStore", () => {
function getSerialDevices() {
var html = "";
for (var key in serial_devices.value) {
html += `<option value="${serial_devices.value[key]["port"]}">${serial_devices.value[key]["port"]} - ${serial_devices.value[key]["description"]}</option>`;
let selected = ''
if (serial_devices.value[key]["name"] == hamlib_deviceport){
selected = "selected"
} else {
selected = ''
}
html += `<option value="${serial_devices.value[key]["port"]}" ${selected}>${serial_devices.value[key]["port"]} - ${serial_devices.value[key]["description"]}</option>`;
}
return html;
}