[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2023-11-13 06:21:13 +00:00
parent 1a27458d14
commit f34f7d317e
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
5 changed files with 130 additions and 89 deletions

View file

@ -3,7 +3,6 @@ import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);
import main_modals from "./main_modals.vue";
import main_top_navbar from "./main_top_navbar.vue";
import main_rig_control from "./main_rig_control.vue";
@ -155,11 +154,13 @@ function stopAllTransmissions() {
<!--beginn of blur div -->
<!-------------------------------- MAIN AREA ---------------->
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
<button
type="button"
class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#staticBackdrop"
>
Check Screen
</button>

View file

@ -21,7 +21,6 @@ import { sendTestFrame, setTxAudioLevel, setRxAudioLevel } from "../js/sock.js";
import main_startup_check from "./main_startup_check.vue";
function tuneAudio() {
sendTestFrame();
}
@ -129,12 +128,8 @@ const transmissionSpeedChartDataMessageInfo = computed(() => ({
</script>
<template>
<main_startup_check />
<!-- updater release notes-->
<div
class="modal fade"

View file

@ -1,66 +1,111 @@
<script setup lang="ts">
</script>
<script setup lang="ts"></script>
<template>
<!-- Modal -->
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div
class="modal fade"
id="staticBackdrop"
data-bs-backdrop="static"
data-bs-keyboard="false"
tabindex="-1"
aria-labelledby="staticBackdropLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="staticBackdropLabel">Pre-Check</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<div class="accordion" id="accordionFlushExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#flush-collapseOne"
aria-expanded="false"
aria-controls="flush-collapseOne"
>
Network <span class="badge ms-2 bg-success">Connected</span>
</button>
</h2>
<div id="flush-collapseOne" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample">
<div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the first item's accordion body.</div>
<div
id="flush-collapseOne"
class="accordion-collapse collapse"
data-bs-parent="#accordionFlushExample"
>
<div class="accordion-body">
Placeholder content for this accordion, which is intended to
demonstrate the <code>.accordion-flush</code> class. This is
the first item's accordion body.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwo" aria-expanded="false" aria-controls="flush-collapseTwo">
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#flush-collapseTwo"
aria-expanded="false"
aria-controls="flush-collapseTwo"
>
Modem <span class="badge ms-2 bg-success">Running</span>
</button>
</h2>
<div id="flush-collapseTwo" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample">
<div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the second item's accordion body. Let's imagine this being filled with some actual content.</div>
<div
id="flush-collapseTwo"
class="accordion-collapse collapse"
data-bs-parent="#accordionFlushExample"
>
<div class="accordion-body">
Placeholder content for this accordion, which is intended to
demonstrate the <code>.accordion-flush</code> class. This is
the second item's accordion body. Let's imagine this being
filled with some actual content.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseThree" aria-expanded="false" aria-controls="flush-collapseThree">
Radio control <span class="badge ms-2 bg-danger">Disconnected</span>
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#flush-collapseThree"
aria-expanded="false"
aria-controls="flush-collapseThree"
>
Radio control
<span class="badge ms-2 bg-danger">Disconnected</span>
</button>
</h2>
<div id="flush-collapseThree" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample">
<div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.</div>
<div
id="flush-collapseThree"
class="accordion-collapse collapse"
data-bs-parent="#accordionFlushExample"
>
<div class="accordion-body">
Placeholder content for this accordion, which is intended to
demonstrate the <code>.accordion-flush</code> class. This is
the third item's accordion body. Nothing more exciting
happening here in terms of content, but just filling up the
space to make it look, at least at first glance, a bit more
representative of how this would look in a real-world
application.
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Continue</button>
@ -68,6 +113,4 @@
</div>
</div>
</div>
</template>

View file

@ -20,14 +20,12 @@ import { useSettingsStore } from "../store/settingsStore.js";
const settings = useSettingsStore(pinia);
export function connectionFailed(endpoint, event) {
stateStore.modem_connection = "disconnected"
stateStore.modem_connection = "disconnected";
}
export function stateDispatcher(data) {
console.log(data);
stateStore.modem_connection = "connected"
stateStore.modem_connection = "connected";
if (data["freedata-message"] == "state-change") {
stateStore.channel_busy = data["channel_busy"];

View file

@ -1,4 +1,8 @@
import { eventDispatcher, stateDispatcher, connectionFailed } from "../js/eventHandler.js";
import {
eventDispatcher,
stateDispatcher,
connectionFailed,
} from "../js/eventHandler.js";
import { addDataToWaterfall } from "../js/waterfallHandler.js";
function connect(endpoint, dispatcher) {
@ -17,7 +21,7 @@ function connect(endpoint, dispatcher) {
// handle errors
socket.addEventListener("error", function (event) {
console.error("WebSocket error:", event);
connectionFailed(endpoint, event)
connectionFailed(endpoint, event);
});
// handle closing and reconnect