[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2023-12-16 16:12:03 +00:00
parent 436420f854
commit 19eb6ee6e9
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
10 changed files with 205 additions and 169 deletions

View file

@ -3,11 +3,15 @@ import { setActivePinia } from "pinia";
import pinia from "../../store/index";
setActivePinia(pinia);
import { sendModemCQ} from "../../js/api.js";
import { sendModemCQ } from "../../js/api.js";
</script>
<template>
<div class="fill h-100" style="width: calc(100% - 24px);">
<a class="btn btn-sm btn-secondary d-flex justify-content-center align-items-center object-fill border rounded w-100 h-100" @click="sendModemCQ" title="Send a CQ call!">CQ</a>
</div>
<div class="fill h-100" style="width: calc(100% - 24px)">
<a
class="btn btn-sm btn-secondary d-flex justify-content-center align-items-center object-fill border rounded w-100 h-100"
@click="sendModemCQ"
title="Send a CQ call!"
>CQ</a
>
</div>
</template>

View file

@ -25,60 +25,60 @@ var dxcallPing = ref("");
<template>
<div class="card h-100">
<div class="card-header p-0">
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>&nbsp;
<strong>Broadcasts</strong>
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>&nbsp;
<strong>Broadcasts</strong>
</div>
<div class="card-body overflow-auto p-0">
<div class="input-group input-group-sm mb-0">
<input
type="text"
class="form-control"
style="max-width: 6rem; min-width: 3rem; text-transform: uppercase"
placeholder="DXcall"
pattern="[A-Z]*"
maxlength="11"
aria-label="Input group"
aria-describedby="btnGroupAddon"
v-model="dxcallPing"
/>
<button
class="btn btn-sm btn-outline-secondary"
id="sendPing"
type="button"
data-bs-placement="bottom"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Send a ping request to a remote station"
@click="transmitPing()"
>
Ping
</button>
<div class="input-group input-group-sm mb-0">
<input
type="text"
class="form-control"
style="max-width: 6rem; min-width: 3rem; text-transform: uppercase"
placeholder="DXcall"
pattern="[A-Z]*"
maxlength="11"
aria-label="Input group"
aria-describedby="btnGroupAddon"
v-model="dxcallPing"
/>
<button
class="btn btn-sm btn-outline-secondary"
id="sendPing"
type="button"
data-bs-placement="bottom"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Send a ping request to a remote station"
@click="transmitPing()"
>
Ping
</button>
<button
class="btn btn-sm btn-outline-secondary ms-1"
id="sendCQ"
type="button"
title="Send a CQ to the world"
@click="sendModemCQ()"
>
Call CQ
</button>
<button
class="btn btn-sm btn-outline-secondary ms-1"
id="sendCQ"
type="button"
title="Send a CQ to the world"
@click="sendModemCQ()"
>
Call CQ
</button>
<button
type="button"
id="startBeacon"
class="btn btn-sm ms-1"
@click="startStopBeacon()"
v-bind:class="{
'btn-success': state.beacon_state === true,
'btn-outline-secondary': state.beacon_state === false,
}"
title="Toggle beacon mode. The interval can be set in settings. While sending a beacon, you can receive ping requests and open a datachannel. If a datachannel is opened, the beacon pauses."
>
Toggle beacon
</button>
</div>
<button
type="button"
id="startBeacon"
class="btn btn-sm ms-1"
@click="startStopBeacon()"
v-bind:class="{
'btn-success': state.beacon_state === true,
'btn-outline-secondary': state.beacon_state === false,
}"
title="Toggle beacon mode. The interval can be set in settings. While sending a beacon, you can receive ping requests and open a datachannel. If a datachannel is opened, the beacon pauses."
>
Toggle beacon
</button>
</div>
<!-- end of row-->
</div>
</div>

View file

@ -25,61 +25,59 @@ var dxcallPing = ref("");
<template>
<div class="card h-100">
<div class="card-header p-0">
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>&nbsp;
<strong>Broadcasts</strong>
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>&nbsp;
<strong>Broadcasts</strong>
</div>
<div class="card-body overflow-auto p-0">
<div class="input-group w-100">
<input
type="text"
class="form-control"
style="min-width: 3rem; text-transform: uppercase; height: 31px;"
placeholder="DXcall"
pattern="[A-Z]*"
maxlength="11"
aria-label="Input group"
aria-describedby="btnGroupAddon"
v-model="dxcallPing"
/>
<button
class="btn btn-sm btn-outline-secondary"
id="sendPing"
type="button"
data-bs-placement="bottom"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Send a ping request to a remote station"
@click="transmitPing()"
>
Ping
</button>
</div>
<button
type="button"
id="startBeacon"
class="btn btn-sm w-100"
@click="startStopBeacon()"
v-bind:class="{
'btn-success': state.beacon_state === true,
'btn-outline-secondary': state.beacon_state === false,
}"
title="Toggle beacon mode. The interval can be set in settings. While sending a beacon, you can receive ping requests and open a datachannel. If a datachannel is opened, the beacon pauses."
>
Toggle beacon
</button>
<button
class="btn btn-sm btn-outline-secondary w-100"
id="sendCQ"
type="button"
title="Send a CQ to the world"
@click="sendModemCQ()"
>
Call CQ
</button>
type="text"
class="form-control"
style="min-width: 3rem; text-transform: uppercase; height: 31px"
placeholder="DXcall"
pattern="[A-Z]*"
maxlength="11"
aria-label="Input group"
aria-describedby="btnGroupAddon"
v-model="dxcallPing"
/>
<button
class="btn btn-sm btn-outline-secondary"
id="sendPing"
type="button"
data-bs-placement="bottom"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Send a ping request to a remote station"
@click="transmitPing()"
>
Ping
</button>
</div>
<button
type="button"
id="startBeacon"
class="btn btn-sm w-100"
@click="startStopBeacon()"
v-bind:class="{
'btn-success': state.beacon_state === true,
'btn-outline-secondary': state.beacon_state === false,
}"
title="Toggle beacon mode. The interval can be set in settings. While sending a beacon, you can receive ping requests and open a datachannel. If a datachannel is opened, the beacon pauses."
>
Toggle beacon
</button>
<button
class="btn btn-sm btn-outline-secondary w-100"
id="sendCQ"
type="button"
title="Send a CQ to the world"
@click="sendModemCQ()"
>
Call CQ
</button>
</div>
</div>
</template>

View file

@ -1,13 +1,12 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../../store/index";
import { setModemRigMode,setModemRigPowerLvl } from "../../js/api";
import { setModemRigMode, setModemRigPowerLvl } from "../../js/api";
setActivePinia(pinia);
import { useStateStore } from "../../store/stateStore.js";
const state = useStateStore(pinia);
function set_hamlib_mode() {
setModemRigMode(state.mode);
}
@ -29,11 +28,20 @@ function set_hamlib_rf_level() {
<div class="me-2">
<div class="input-group input-group-sm">
<span class="input-group-text">QRG</span>
<span class="input-group-text">{{ state.frequency / 1000 }} kHz</span>
<span class="input-group-text"
>{{ state.frequency / 1000 }} kHz</span
>
<button class="btn btn-secondary dropdown-toggle" v-bind:class="{
<button
class="btn btn-secondary dropdown-toggle"
v-bind:class="{
disabled: state.hamlib_status === 'disconnected',
}" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasFrequency" aria-controls="offcanvasExample"></button>
}"
type="button"
data-bs-toggle="offcanvas"
data-bs-target="#offcanvasFrequency"
aria-controls="offcanvasExample"
></button>
</div>
</div>

View file

@ -7,18 +7,27 @@ import { useStateStore } from "../../store/stateStore.js";
const state = useStateStore(pinia);
</script>
<template>
<div class="w-100">
<div class="input-group input-group-sm" style="width: calc(100% - 24px);">
<span class="input-group-text">Hz</span>
<input type="text" class="form-control" style="min-width: 3em;" placeholder="mycall" v-model=state.frequency readonly>
<a class="btn btn-secondary dropdown-toggle" v-bind:class="{
disabled: state.hamlib_status === 'disconnected',
}" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasFrequency"></a>
<div class="w-100">
<div class="input-group input-group-sm" style="width: calc(100% - 24px)">
<span class="input-group-text">Hz</span>
</div>
</div>
<input
type="text"
class="form-control"
style="min-width: 3em"
placeholder="mycall"
v-model="state.frequency"
readonly
/>
<a
class="btn btn-secondary dropdown-toggle"
v-bind:class="{
disabled: state.hamlib_status === 'disconnected',
}"
type="button"
data-bs-toggle="offcanvas"
data-bs-target="#offcanvasFrequency"
></a>
</div>
</div>
</template>

View file

@ -11,20 +11,34 @@ import { useStateStore } from "../../store/stateStore.js";
const state = useStateStore(pinia);
function updateMyCall()
{
function updateMyCall() {
setConfig();
}
</script>
<template>
<div class="w-100">
<div class="input-group input-group-sm" style="width: calc(100% - 24px);">
<input type="text" class="form-control" style="min-width: 3em;" placeholder="mycall" v-model=settings.remote.STATION.mycall>
<span class="input-group-text">-</span>
<input type="text" class="form-control" style="min-width: 2em;max-width: 2.5em;" placeholder="id" v-model=settings.remote.STATION.myssid>
<a class="btn btn-sm btn-secondary" title="Apply changes to callsign/ssid" @click="updateMyCall"><i class="bi bi-check"></i></a>
</div>
</div>
<div class="w-100">
<div class="input-group input-group-sm" style="width: calc(100% - 24px)">
<input
type="text"
class="form-control"
style="min-width: 3em"
placeholder="mycall"
v-model="settings.remote.STATION.mycall"
/>
<span class="input-group-text">-</span>
<input
type="text"
class="form-control"
style="min-width: 2em; max-width: 2.5em"
placeholder="id"
v-model="settings.remote.STATION.myssid"
/>
<a
class="btn btn-sm btn-secondary"
title="Apply changes to callsign/ssid"
@click="updateMyCall"
><i class="bi bi-check"></i
></a>
</div>
</div>
</template>

View file

@ -14,31 +14,31 @@ function transmitPing() {
var dxcallPing = ref("");
</script>
<template>
<div class="input-group" style="width: calc(100% - 24px)">
<input
type="text"
class="form-control"
style="min-width: 3rem; text-transform: uppercase; height: 31px;"
placeholder="DXcall"
pattern="[A-Z]*"
maxlength="11"
aria-label="Input group"
aria-describedby="btnGroupAddon"
v-model="dxcallPing"
/>
<a
class="btn btn-sm btn-secondary"
style="max-width: 3em;"
id="sendPing"
type="button"
data-bs-placement="bottom"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Send a ping request to a remote station"
@click="transmitPing()"
>
Ping
</a>
</div>
<div class="input-group" style="width: calc(100% - 24px)">
<input
type="text"
class="form-control"
style="min-width: 3rem; text-transform: uppercase; height: 31px"
placeholder="DXcall"
pattern="[A-Z]*"
maxlength="11"
aria-label="Input group"
aria-describedby="btnGroupAddon"
v-model="dxcallPing"
/>
<a
class="btn btn-sm btn-secondary"
style="max-width: 3em"
id="sendPing"
type="button"
data-bs-placement="bottom"
data-bs-toggle="tooltip"
data-bs-trigger="hover"
data-bs-html="false"
title="Send a ping request to a remote station"
@click="transmitPing()"
>
Ping
</a>
</div>
</template>

View file

@ -7,5 +7,10 @@ import { useStateStore } from "../../store/stateStore.js";
const state = useStateStore(pinia);
</script>
<template>
<div class="d-flex justify-content-center align-items-center object-fill border rounded w-100 h-100" :class="state.ptt_state === true ? 'text-bg-warning' : 'text-bg-light'">TX</div>
<div
class="d-flex justify-content-center align-items-center object-fill border rounded w-100 h-100"
:class="state.ptt_state === true ? 'text-bg-warning' : 'text-bg-light'"
>
TX
</div>
</template>

View file

@ -114,12 +114,11 @@ export function getModemState() {
}
export function setModemFrequency(newFrequency) {
console.error("setModemFrequency needs implemented")
console.error("setModemFrequency needs implemented");
}
export function setModemRigMode(mode) {
console.error("setModemRigMode needs implemented")
console.error("setModemRigMode needs implemented");
}
export function setModemRigPowerLvl(power) {
console.error("setModemRigPowerLvl needs implemented")
console.error("setModemRigPowerLvl needs implemented");
}
;

View file

@ -21,8 +21,7 @@ export function initWaterfall(id) {
export function addDataToWaterfall(data) {
data = JSON.parse(data);
if (data.constructor !== Array)
return;
if (data.constructor !== Array) return;
spectrums.forEach((element) => {
//console.log(element);
element.addData(data);