mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
[CodeFactor] Apply fixes
This commit is contained in:
parent
4f98929446
commit
ac9c46680d
5 changed files with 46 additions and 31 deletions
|
@ -42,7 +42,7 @@ function startStopRecordAudio() {
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-0 pb-0 ">
|
||||
<div class="card-body pt-0 pb-0">
|
||||
<div class="container-wide">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import {ref} from "vue";
|
||||
import { ref } from "vue";
|
||||
import { setActivePinia } from "pinia";
|
||||
import pinia from "../../store/index";
|
||||
setActivePinia(pinia);
|
||||
|
||||
import { settingsStore as settings} from "../../store/settingsStore.js";
|
||||
import { settingsStore as settings } from "../../store/settingsStore.js";
|
||||
|
||||
import { useStateStore } from "../../store/stateStore.js";
|
||||
const state = useStateStore(pinia);
|
||||
|
@ -18,8 +18,7 @@ function transmitPing() {
|
|||
function startStopBeacon() {
|
||||
if (state.beacon_state === true) {
|
||||
setModemBeacon(false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setModemBeacon(true);
|
||||
}
|
||||
}
|
||||
|
@ -30,14 +29,14 @@ var dxcallPing = ref("");
|
|||
<div class="card-header p-0">
|
||||
<div>
|
||||
<div>
|
||||
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>
|
||||
<strong>Broadcasts</strong>
|
||||
<i class="bi bi-broadcast" style="font-size: 1.2rem"></i>
|
||||
<strong>Broadcasts</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body overflow-auto p-0">
|
||||
<div>
|
||||
<div >
|
||||
<div>
|
||||
<div class="input-group input-group-sm mb-0">
|
||||
<input
|
||||
type="text"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
// @ts-nocheck
|
||||
// reason for no check is, that we have some mixing of typescript and chart js which seems to be not to be fixed that easy
|
||||
import {ref, computed, onMounted } from "vue";
|
||||
import { initWaterfall,setColormap } from "../../js/waterfallHandler.js";
|
||||
import { ref, computed, onMounted } from "vue";
|
||||
import { initWaterfall, setColormap } from "../../js/waterfallHandler.js";
|
||||
import { setActivePinia } from "pinia";
|
||||
import pinia from "../../store/index";
|
||||
setActivePinia(pinia);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { settingsStore as settings } from "../store/settingsStore.js";
|
||||
import { validateCallsignWithSSID,validateCallsignWithoutSSID } from "./freedata";
|
||||
import {
|
||||
validateCallsignWithSSID,
|
||||
validateCallsignWithoutSSID,
|
||||
} from "./freedata";
|
||||
|
||||
function buildURL(params, endpoint) {
|
||||
const url = "http://" + params.host + ":" + params.port + endpoint;
|
||||
|
@ -73,15 +76,16 @@ export function sendModemCQ() {
|
|||
}
|
||||
|
||||
export function sendModemPing(dxcall) {
|
||||
if (validateCallsignWithSSID(dxcall) === false && validateCallsignWithoutSSID(dxcall) === true) {
|
||||
dxcall=String(dxcall).toUpperCase().trim();
|
||||
dxcall=dxcall+"-0";
|
||||
|
||||
if (
|
||||
validateCallsignWithSSID(dxcall) === false &&
|
||||
validateCallsignWithoutSSID(dxcall) === true
|
||||
) {
|
||||
dxcall = String(dxcall).toUpperCase().trim();
|
||||
dxcall = dxcall + "-0";
|
||||
}
|
||||
dxcall=String(dxcall).toUpperCase().trim();
|
||||
dxcall = String(dxcall).toUpperCase().trim();
|
||||
if (validateCallsignWithSSID(dxcall))
|
||||
return apiPost("/modem/ping_ping", { dxcall: dxcall });
|
||||
|
||||
}
|
||||
|
||||
export function sendModemARQRaw(mycall, dxcall, data, uuid) {
|
||||
|
|
|
@ -60,28 +60,40 @@ export function sortByPropertyDesc(property) {
|
|||
* @param {string} callsign callsign to check
|
||||
* @returns true or false if callsign appears to be valid with an SSID
|
||||
*/
|
||||
export function validateCallsignWithSSID(callsign :string) {
|
||||
export function validateCallsignWithSSID(callsign: string) {
|
||||
var patt = new RegExp("^[A-Z,a-z]+[0-9][A-Z,a-z]*-(1[0-5]|[0-9])$");
|
||||
|
||||
if (callsign === undefined || callsign==="" || patt.test(callsign) === false)
|
||||
{
|
||||
console.error("Call sign given is not in correct format or missing; callsign passed is: " + callsign);
|
||||
if (
|
||||
callsign === undefined ||
|
||||
callsign === "" ||
|
||||
patt.test(callsign) === false
|
||||
) {
|
||||
console.error(
|
||||
"Call sign given is not in correct format or missing; callsign passed is: " +
|
||||
callsign,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Validate/check if a call sign has an SSID
|
||||
* @param {string} callsign callsign to check
|
||||
* @returns true or false if callsign appears to be valid without an SSID
|
||||
*/
|
||||
export function validateCallsignWithoutSSID(callsign :string) {
|
||||
export function validateCallsignWithoutSSID(callsign: string) {
|
||||
var patt = new RegExp("^[A-Za-z]+[0-9][A-Za-z]+$");
|
||||
|
||||
if (callsign === undefined || callsign==="" || patt.test(callsign) === false)
|
||||
{
|
||||
console.error("Call sign given is not in correct format or missing; callsign passed is: " + callsign);
|
||||
if (
|
||||
callsign === undefined ||
|
||||
callsign === "" ||
|
||||
patt.test(callsign) === false
|
||||
) {
|
||||
console.error(
|
||||
"Call sign given is not in correct format or missing; callsign passed is: " +
|
||||
callsign,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue