[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2023-12-04 03:49:02 +00:00
parent ce12679f2d
commit 645b159d73
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
14 changed files with 504 additions and 497 deletions

View file

@ -58,16 +58,8 @@ const gridWidgets = [
{ x: 1, y: 1, w: 3, h: 27 }, { x: 1, y: 1, w: 3, h: 27 },
"Mini Heard stations", "Mini Heard stations",
), ),
new gridWidget( new gridWidget(s_meter, { x: 1, y: 1, w: 2, h: 4 }, "S-Meter"),
s_meter, new gridWidget(dbfs_meter, { x: 1, y: 1, w: 2, h: 4 }, "Dbfs Meter"),
{ x: 1, y: 1, w: 2, h: 4 },
"S-Meter",
),
new gridWidget(
dbfs_meter,
{ x: 1, y: 1, w: 2, h: 4 },
"Dbfs Meter",
),
]; ];
onMounted(() => { onMounted(() => {
grid = GridStack.init({ grid = GridStack.init({
@ -77,8 +69,8 @@ onMounted(() => {
minRow: 50, minRow: 50,
margin: 5, margin: 5,
resizable: { resizable: {
handles: 'se,sw' handles: "se,sw",
} },
}); });
grid.on("dragstop", function (event, element) { grid.on("dragstop", function (event, element) {

View file

@ -16,14 +16,29 @@ function startStopRecordAudio() {
<div class="card w-100 h-100"> <div class="card w-100 h-100">
<div class="card-header"> <div class="card-header">
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <button
class="btn btn-sm btn-outline-secondary dropdown-toggle"
</button> type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
></button>
<i class="bi bi-volume-up" style="font-size: 1rem"></i>&nbsp; <i class="bi bi-volume-up" style="font-size: 1rem"></i>&nbsp;
<strong>Audio</strong> <strong>Audio</strong>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item" data-bs-toggle="modal" data-bs-target="#audioModal" href="#">Tune</a></li> <li>
<li><a class="dropdown-item" @click="startStopRecordAudio" href="#">Record</a></li> <a
class="dropdown-item"
data-bs-toggle="modal"
data-bs-target="#audioModal"
href="#"
>Tune</a
>
</li>
<li>
<a class="dropdown-item" @click="startStopRecordAudio" href="#"
>Record</a
>
</li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -84,7 +84,9 @@ function getMaidenheadDistance(dxGrid) {
> >
</td> </td>
<td> <td>
<span class="badge bg-secondary">{{ item[1].activity_type }}</span> <span class="badge bg-secondary">{{
item[1].activity_type
}}</span>
</td> </td>
<td> <td>
<span class="badge bg-secondary">{{ item[1].snr }}</span> <span class="badge bg-secondary">{{ item[1].snr }}</span>

View file

@ -60,9 +60,7 @@ function getMaidenheadDistance(dxGrid) {
<!--https://vuejs.org/guide/essentials/list.html--> <!--https://vuejs.org/guide/essentials/list.html-->
<tr v-for="item in state.activities" :key="item[0]"> <tr v-for="item in state.activities" :key="item[0]">
<td> <td>
<span class="fs-6">{{ <span class="fs-6">{{ getDateTime(item[1].timestamp) }}</span>
getDateTime(item[1].timestamp)
}}</span>
</td> </td>
<td> <td>

View file

@ -51,7 +51,11 @@ function set_hamlib_rf_level() {
></button> ></button>
<!-- Dropdown Menu --> <!-- Dropdown Menu -->
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton" style="z-index: 50;"> <ul
class="dropdown-menu"
aria-labelledby="dropdownMenuButton"
style="z-index: 50"
>
<li> <li>
<div class="input-group p-1"> <div class="input-group p-1">
<span class="input-group-text">frequency</span> <span class="input-group-text">frequency</span>
@ -223,7 +227,6 @@ function set_hamlib_rf_level() {
<option value="90">90</option> <option value="90">90</option>
<option value="100">100</option> <option value="100">100</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>

View file

@ -174,9 +174,14 @@ onMounted(() => {
// init waterfall // init waterfall
localSpectrum = initWaterfall("waterfall-grid"); localSpectrum = initWaterfall("waterfall-grid");
window.addEventListener("wf-data-avail",function(evt) {localSpectrum.addData(evt.detail);},false); window.addEventListener(
"wf-data-avail",
function (evt) {
localSpectrum.addData(evt.detail);
},
false,
);
}); });
</script> </script>
<template> <template>
@ -324,8 +329,6 @@ onMounted(() => {
data data
</button> </button>
</div> </div>
</div> </div>
<div class="card-body w-100 h-100 overflow-auto"> <div class="card-body w-100 h-100 overflow-auto">
<div class="tab-content h-100 w-100" id="nav-stats-tabContent"> <div class="tab-content h-100 w-100" id="nav-stats-tabContent">
@ -338,10 +341,7 @@ onMounted(() => {
role="stats_tabpanel" role="stats_tabpanel"
aria-labelledby="list-waterfall-list" aria-labelledby="list-waterfall-list"
> >
<canvas <canvas id="waterfall-grid" class="force-gpu"></canvas>
id="waterfall-grid"
class="force-gpu"
></canvas>
</div> </div>
<div <div
class="tab-pane fade" class="tab-pane fade"

View file

@ -5,13 +5,9 @@ setActivePinia(pinia);
import { useStateStore } from "../store/stateStore.js"; import { useStateStore } from "../store/stateStore.js";
const state = useStateStore(pinia); const state = useStateStore(pinia);
</script> </script>
<template> <template>
<div <div class="progress mb-0 me-4 rounded-0 rounded-top" style="height: 22px">
class="progress mb-0 me-4 rounded-0 rounded-top"
style="height: 22px"
>
<div <div
class="progress-bar progress-bar-striped bg-primary force-gpu" class="progress-bar progress-bar-striped bg-primary force-gpu"
id="dbfs_level" id="dbfs_level"
@ -28,10 +24,7 @@ const state = useStateStore(pinia);
{{ state.dbfs_level }} dBFS {{ state.dbfs_level }} dBFS
</p> </p>
</div> </div>
<div <div class="progress mb-0 me-4 rounded-0 rounded-bottom" style="height: 8px">
class="progress mb-0 me-4 rounded-0 rounded-bottom"
style="height: 8px"
>
<div <div
class="progress-bar progress-bar-striped bg-warning" class="progress-bar progress-bar-striped bg-warning"
role="progressbar" role="progressbar"

View file

@ -5,13 +5,9 @@ setActivePinia(pinia);
import { useStateStore } from "../store/stateStore.js"; import { useStateStore } from "../store/stateStore.js";
const state = useStateStore(pinia); const state = useStateStore(pinia);
</script> </script>
<template> <template>
<div <div class="progress mb-0 me-4 rounded-0 rounded-top" style="height: 22px">
class="progress mb-0 me-4 rounded-0 rounded-top"
style="height: 22px;"
>
<div <div
class="progress-bar progress-bar-striped bg-primary force-gpu" class="progress-bar progress-bar-striped bg-primary force-gpu"
id="noise_level" id="noise_level"
@ -28,10 +24,7 @@ const state = useStateStore(pinia);
S-Meter(dB): {{ state.s_meter_strength_raw }} S-Meter(dB): {{ state.s_meter_strength_raw }}
</p> </p>
</div> </div>
<div <div class="progress mb-0 me-4 rounded-0 rounded-bottom" style="height: 8px">
class="progress mb-0 me-4 rounded-0 rounded-bottom"
style="height: 8px"
>
<div <div
class="progress-bar progress-bar-striped bg-warning" class="progress-bar progress-bar-striped bg-warning"
role="progressbar" role="progressbar"

View file

@ -29,7 +29,6 @@ function getDateTime(timestampRaw) {
function getMaidenheadDistance(dxGrid) { function getMaidenheadDistance(dxGrid) {
try { try {
return parseInt(distance(settings.remote.STATION.mygrid, dxGrid)); return parseInt(distance(settings.remote.STATION.mygrid, dxGrid));
} catch (e) { } catch (e) {
console.warn(e); console.warn(e);
@ -105,7 +104,9 @@ function getMaidenheadDistance(dxGrid) {
> >
</td> </td>
<td> <td>
<span class="badge bg-secondary">{{ item[1].activity_type }}</span> <span class="badge bg-secondary">{{
item[1].activity_type
}}</span>
</td> </td>
<td> <td>
<span class="badge bg-secondary">{{ item[1].snr }}</span> <span class="badge bg-secondary">{{ item[1].snr }}</span>

View file

@ -179,7 +179,13 @@ export default {
// init waterfall // init waterfall
localSpectrum = initWaterfall("waterfall-main"); localSpectrum = initWaterfall("waterfall-main");
window.addEventListener("wf-data-avail",function(evt) {localSpectrum.addData(evt.detail);},false); window.addEventListener(
"wf-data-avail",
function (evt) {
localSpectrum.addData(evt.detail);
},
false,
);
}, },
}; };
</script> </script>
@ -362,7 +368,13 @@ export default {
<canvas <canvas
ref="waterfall-main" ref="waterfall-main"
id="waterfall-main" id="waterfall-main"
style="position: relative; z-index: 2;aspect-ratio:unset; width: 100%; height: 200px;" style="
position: relative;
z-index: 2;
aspect-ratio: unset;
width: 100%;
height: 200px;
"
class="force-gpu" class="force-gpu"
></canvas> ></canvas>
</div> </div>

View file

@ -9,7 +9,6 @@ import { settingsStore as settings } from "../store/settingsStore.js";
</script> </script>
<template> <template>
<div class="input-group input-group-sm mb-1"> <div class="input-group input-group-sm mb-1">
<label class="input-group-text w-50">Enable FSK mode</label> <label class="input-group-text w-50">Enable FSK mode</label>
<label class="input-group-text w-50"> <label class="input-group-text w-50">

View file

@ -130,5 +130,4 @@ function saveSettings() {
</div> </div>
</label> </label>
</div> </div>
</template> </template>

View file

@ -20,7 +20,8 @@ export function initWaterfall(id) {
export function addDataToWaterfall(data) { export function addDataToWaterfall(data) {
data = JSON.parse(data); data = JSON.parse(data);
window.dispatchEvent(new CustomEvent("wf-data-avail", {detail: data}));} window.dispatchEvent(new CustomEvent("wf-data-avail", { detail: data }));
}
/** /**
* Setwaterfall colormap array by index * Setwaterfall colormap array by index
* @param {number} index colormap index to use * @param {number} index colormap index to use

View file

@ -13,7 +13,6 @@ export const settingsStore = reactive({
high_graphics: true, high_graphics: true,
update_channel: "alpha", update_channel: "alpha",
enable_sys_notification: true, enable_sys_notification: true,
}, },
remote: { remote: {
AUDIO: { AUDIO: {