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
54cf0bef3f
commit
ad11332d16
|
@ -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({
|
||||
|
@ -271,5 +267,5 @@ function quickfill() {
|
|||
.grid-container {
|
||||
border: 1px solid blue;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
import { setActivePinia } from "pinia";
|
||||
import pinia from "../store/index";
|
||||
setActivePinia(pinia);
|
||||
|
@ -24,16 +23,19 @@ function getDateTime(timestampRaw) {
|
|||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="card h-100" >
|
||||
<div class="card h-100">
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -140,18 +140,27 @@ 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){
|
||||
for (let i = 0; i < stateStore.activities.length; i++) {
|
||||
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) {
|
||||
for (let ii = 0; ii < stateStore.heard_stations.length; ii++) {
|
||||
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) {
|
||||
found = true;
|
||||
if (
|
||||
stateStore.heard_stations[ii].timestamp <
|
||||
stateStore.activities[i][1].timestamp
|
||||
) {
|
||||
//Update existing entry in HSL
|
||||
stateStore.heard_stations[ii] = stateStore.activities[i][1];
|
||||
}
|
||||
|
@ -162,8 +171,8 @@ function build_HSL() {
|
|||
stateStore.heard_stations.push(stateStore.activities[i][1]);
|
||||
}
|
||||
}
|
||||
stateStore.heard_stations.sort((a,b) => b.timestamp - a.timestamp); // b - a for reverse sort
|
||||
}
|
||||
stateStore.heard_stations.sort((a, b) => b.timestamp - a.timestamp); // b - a for reverse sort
|
||||
}
|
||||
|
||||
export function eventDispatcher(data) {
|
||||
data = JSON.parse(data);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue