added rigctld help field

This commit is contained in:
DJ2LS 2023-02-12 15:08:13 +01:00
parent 19a58a8a6c
commit 7e589c3bef
2 changed files with 68 additions and 57 deletions

View file

@ -383,34 +383,34 @@ window.addEventListener("DOMContentLoaded", () => {
// radio control element // radio control element
if (config.radiocontrol == "rigctld") { if (config.radiocontrol == "rigctld") {
document.getElementById("radio-control-switch-disabled").checked = false; document.getElementById("radio-control-switch-disabled").checked = false;
document.getElementById("radio-control-switch-network").checked = false; document.getElementById("radio-control-switch-rigctld").checked = true;
document.getElementById("radio-control-switch-help").checked = false;
document.getElementById("radio-control-disabled").style.visibility = document.getElementById("radio-control-disabled").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-disabled").style.display = "none"; document.getElementById("radio-control-disabled").style.display = "none";
document.getElementById("radio-control-network").style.visibility = document.getElementById("radio-control-help").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-network").style.display = "none"; document.getElementById("radio-control-help").style.display = "none";
document.getElementById("radio-control-rigctld-info").style.visibility = document.getElementById("radio-control-rigctld").style.visibility =
"hidden"; "visible";
document.getElementById("radio-control-rigctld-info").style.display = document.getElementById("radio-control-rigctld").style.display =
"none"; "block";
} else { } else {
document.getElementById("radio-control-switch-disabled").checked = true; document.getElementById("radio-control-switch-disabled").checked = true;
document.getElementById("radio-control-switch-network").checked = false; document.getElementById("radio-control-switch-help").checked = false;
document.getElementById( document.getElementById("radio-control-switch-rigctld").checked = false;
"radio-control-switch-rigctld-info"
).checked = false;
document.getElementById("radio-control-network").style.display = "none"; document.getElementById("radio-control-help").style.display = "none";
document.getElementById("radio-control-network").style.visibility = document.getElementById("radio-control-help").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-rigctld-info").style.visibility = document.getElementById("radio-control-rigctld").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-rigctld-info").style.display = document.getElementById("radio-control-rigctld").style.display =
"none"; "none";
} }
@ -484,13 +484,13 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("radio-control-disabled").style.visibility = document.getElementById("radio-control-disabled").style.visibility =
"visible"; "visible";
document.getElementById("radio-control-network").style.display = "none"; document.getElementById("radio-control-help").style.display = "none";
document.getElementById("radio-control-network").style.visibility = document.getElementById("radio-control-help").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-rigctld-info").style.visibility = document.getElementById("radio-control-rigctld").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-rigctld-info").style.display = document.getElementById("radio-control-rigctld").style.display =
"none"; "none";
config.radiocontrol = "disabled"; config.radiocontrol = "disabled";
@ -499,7 +499,7 @@ window.addEventListener("DOMContentLoaded", () => {
// // radio settings 'network' event listener // // radio settings 'network' event listener
document document
.getElementById("radio-control-switch-network") .getElementById("radio-control-switch-help")
.addEventListener("click", () => { .addEventListener("click", () => {
document.getElementById("hamlib_info_field").innerHTML = document.getElementById("hamlib_info_field").innerHTML =
"Set the ip and port of a rigctld session"; "Set the ip and port of a rigctld session";
@ -508,13 +508,13 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("radio-control-disabled").style.visibility = document.getElementById("radio-control-disabled").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-network").style.display = "block"; document.getElementById("radio-control-help").style.display = "block";
document.getElementById("radio-control-network").style.visibility = document.getElementById("radio-control-help").style.visibility =
"visible"; "visible";
document.getElementById("radio-control-rigctld-info").style.visibility = document.getElementById("radio-control-rigctld").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-rigctld-info").style.display = document.getElementById("radio-control-rigctld").style.display =
"none"; "none";
config.radiocontrol = "rigctld"; config.radiocontrol = "rigctld";
@ -523,7 +523,7 @@ window.addEventListener("DOMContentLoaded", () => {
// // radio settings 'rigctld' event listener // // radio settings 'rigctld' event listener
document document
.getElementById("radio-control-switch-rigctld-info") .getElementById("radio-control-switch-rigctld")
.addEventListener("click", () => { .addEventListener("click", () => {
document.getElementById("hamlib_info_field").innerHTML = document.getElementById("hamlib_info_field").innerHTML =
"Start and stop rigctld ."; "Start and stop rigctld .";
@ -532,13 +532,13 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("radio-control-disabled").style.visibility = document.getElementById("radio-control-disabled").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-network").style.display = "none"; document.getElementById("radio-control-help").style.display = "none";
document.getElementById("radio-control-network").style.visibility = document.getElementById("radio-control-help").style.visibility =
"hidden"; "hidden";
document.getElementById("radio-control-rigctld-info").style.visibility = document.getElementById("radio-control-rigctld").style.visibility =
"visible"; "visible";
document.getElementById("radio-control-rigctld-info").style.display = document.getElementById("radio-control-rigctld").style.display =
"block"; "block";
config.radiocontrol = "rigctld"; config.radiocontrol = "rigctld";

View file

@ -347,35 +347,16 @@
type="radio" type="radio"
class="btn-check" class="btn-check"
name="radio-control-switch" name="radio-control-switch"
id="radio-control-switch-rigctld-info" id="radio-control-switch-rigctld"
autocomplete="off" autocomplete="off"
/> />
<label <label
class="btn btn-sm btn-outline-secondary" class="btn btn-sm btn-outline-secondary"
for="radio-control-switch-rigctld-info" for="radio-control-switch-rigctld"
> >
Run locally Run locally
</label> </label>
</div> </div>
<div
class="btn-group btn-group-sm"
role="group"
aria-label="radio-control-switch-rigctld"
>
<input
type="radio"
class="btn-check"
name="radio-control-switch"
id="radio-control-switch-network"
autocomplete="off"
/>
<label
class="btn btn-sm btn-outline-secondary"
for="radio-control-switch-network"
>
Network
</label>
</div>
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button <button
type="button" type="button"
@ -389,15 +370,38 @@
PTT Test PTT Test
</button> </button>
</div> </div>
<div
class="btn-group btn-group-sm"
role="group"
aria-label="radio-control-switch-rigctld"
>
<input
type="radio"
class="btn-check"
name="radio-control-switch"
id="radio-control-switch-help"
autocomplete="off"
/>
<label
class="btn btn-sm btn-outline-secondary"
for="radio-control-switch-help"
>
Help
</label>
</div>
</div> </div>
<div class="card-body p-2"> <div class="card-body p-2">
<!-- RADIO CONTROL DISABLED --> <!-- RADIO CONTROL DISABLED -->
<div id="radio-control-disabled"> <div id="radio-control-disabled">
hamlib/rigctld connection disabled hamlib/rigctld connection disabled
</div> </div>
<!-- RADIO CONTROL NETWORK -->
<div id="radio-control-network"> <!-- RADIO CONTROL RIGCTLD INFO-->
<div id="radio-control-rigctld">
<div class="input-group input-group-sm mb-1"> <div class="input-group input-group-sm mb-1">
<div class="input-group input-group-sm mb-1">
<span class="input-group-text">Rigctld IP</span> <span class="input-group-text">Rigctld IP</span>
<input <input
type="text" type="text"
@ -417,10 +421,8 @@
aria-describedby="basic-addon1" aria-describedby="basic-addon1"
/> />
</div> </div>
</div>
<!-- RADIO CONTROL RIGCTLD INFO-->
<div id="radio-control-rigctld-info">
<div class="input-group input-group-sm mb-1">
<button <button
class="btn btn-outline-success" class="btn btn-outline-success"
type="button" type="button"
@ -444,7 +446,17 @@
Stop Stop
</button> </button>
</div> </div>
</div> </div>
<!-- RADIO CONTROL HELP -->
<div id="radio-control-help">
...
</div>
</div> </div>
<div class="card-footer text-muted small" id="hamlib_info_field"> <div class="card-footer text-muted small" id="hamlib_info_field">
Select your radio and PTT settings. Start/Stop Hamlib Rigctld Select your radio and PTT settings. Start/Stop Hamlib Rigctld
@ -2032,7 +2044,6 @@
Device Port Device Port
</span> </span>
</span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
aria-label=".form-select-sm" aria-label=".form-select-sm"