[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2023-12-05 03:27:35 +00:00
parent 54cf0bef3f
commit ad11332d16
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
3 changed files with 69 additions and 54 deletions

View file

@ -61,11 +61,7 @@ const gridWidgets = [
),
new gridWidget(s_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"),
new gridWidget(
grid_activities,
{ x: 1, y: 1, w: 3, h: 27 },
"Activities",
),
new gridWidget(grid_activities, { x: 1, y: 1, w: 3, h: 27 }, "Activities"),
];
onMounted(() => {
grid = GridStack.init({

View file

@ -1,5 +1,4 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);
@ -28,12 +27,15 @@ function getDateTime(timestampRaw) {
<div class="card-header">
<strong>Activity</strong>
</div>
<div class="card-body overflow-auto" style="align-items: start;">
<div class="card-body overflow-auto" style="align-items: start">
<div v-for="item in state.activities" :key="item[0]">
<h6 style="text-align: start;" >{{ item[1].origin }} - {{ getDateTime(item[1].timestamp) }}</h6>
<p style="text-align: start;">{{item[1].activity_type}} - {{ item[1].direction }}</p>
<h6 style="text-align: start">
{{ item[1].origin }} - {{ getDateTime(item[1].timestamp) }}
</h6>
<p style="text-align: start">
{{ item[1].activity_type }} - {{ item[1].direction }}
</p>
</div>
</div>
</div>
</template>

View file

@ -141,17 +141,26 @@ export function stateDispatcher(data) {
function build_HSL() {
//Use data from activities to build HSL list
for (let i = 0; i < stateStore.activities.length; i++) {
if (stateStore.activities[i][1].direction != "received" || stateStore.activities[i][1].origin == undefined){
if (
stateStore.activities[i][1].direction != "received" ||
stateStore.activities[i][1].origin == undefined
) {
//Ignore stations without origin and not received type
//console.warn("HSL: Ignoring " + stateStore.activities[i][0]);
continue;
}
let found = false;
for (let ii = 0; ii < stateStore.heard_stations.length; ii++) {
if (stateStore.heard_stations[ii].origin == stateStore.activities[i][1].origin) {
if (
stateStore.heard_stations[ii].origin ==
stateStore.activities[i][1].origin
) {
//Station already in HSL, check if newer than one in HSL
found = true;
if (stateStore.heard_stations[ii].timestamp < stateStore.activities[i][1].timestamp) {
if (
stateStore.heard_stations[ii].timestamp <
stateStore.activities[i][1].timestamp
) {
//Update existing entry in HSL
stateStore.heard_stations[ii] = stateStore.activities[i][1];
}
@ -213,7 +222,15 @@ export function eventDispatcher(data) {
return;
case "PING_ACK":
//Qrv received
displayToast("success", "bi-arrow-left-right", "Received ping-ack from " + "callsignisbroken" + " | " + data["dxgrid"], 5000);
displayToast(
"success",
"bi-arrow-left-right",
"Received ping-ack from " +
"callsignisbroken" +
" | " +
data["dxgrid"],
5000,
);
return;
}