Message progress bar and footer updates

This commit is contained in:
Mashintime 2024-01-14 02:09:38 -05:00
parent e47b644bf9
commit 3a82e51a4f
3 changed files with 26 additions and 10 deletions

View file

@ -56,7 +56,7 @@
v-if="message.percent < 100 || message.status === 'failed'"
>
<div
class="progress rounded-0 rounded-bottom"
class="progress rounded-0 rounded-bottom" hidden
:style="{ height: '10px' }"
v-bind:class="{
'bg-danger': message.status == 'failed',

View file

@ -216,7 +216,7 @@ const state = useStateStore(pinia);
<div class="col-lg-4">
<div style="margin-right: 2px">
<div
class="progress w-100 rounded-0 rounded-top"
class="progress w-100 "
style="height: 20px; min-width: 200px"
>
<div
@ -231,11 +231,11 @@ const state = useStateStore(pinia);
<p
class="justify-content-center m-0 d-flex position-absolute w-100 text-dark"
>
{{ state.arq_seconds_until_finish }}s left
Message Progress
</p>
</div>
<div
<div hidden
class="progress mb-0 rounded-0 rounded-bottom"
style="height: 10px"
>

View file

@ -21,7 +21,7 @@ export function connectionFailed(endpoint, event) {
}
export function stateDispatcher(data) {
data = JSON.parse(data);
console.debug(data);
//console.debug(data);
if (data["type"] == "state-change" || data["type"] == "state") {
stateStore.modem_connection = "connected";
@ -51,7 +51,7 @@ export function stateDispatcher(data) {
export function eventDispatcher(data) {
data = JSON.parse(data);
//console.info(data);
console.debug(data);
if (data["scatter"] !== undefined) {
stateStore.scatter = JSON.parse(data["scatter"]);
@ -105,22 +105,27 @@ export function eventDispatcher(data) {
case "NEW":
message = `Type: ${data.type}, Session ID: ${data["arq-transfer-outbound"].session_id}, DXCall: ${data["arq-transfer-outbound"].dxcall}, Total Bytes: ${data["arq-transfer-outbound"].total_bytes}, State: ${data["arq-transfer-outbound"].state}`;
displayToast("success", "bi-check-circle", message, 5000);
stateStore.dxcallsign = data["arq-transfer-outbound"].dxcall
stateStore.arq_transmission_percent = 0;
stateStore.arq_total_bytes =0;
return;
case "OPEN_SENT":
console.log("state OPEN_SENT needs to be implemented");
console.info("state OPEN_SENT needs to be implemented");
return;
case "INFO_SENT":
console.log("state INFO_SENT needs to be implemented");
console.info("state INFO_SENT needs to be implemented");
return;
case "BURST_SENT":
message = `Type: ${data.type}, Session ID: ${data["arq-transfer-outbound"].session_id}, DXCall: ${data["arq-transfer-outbound"].dxcall}, Received Bytes: ${data["arq-transfer-outbound"].received_bytes}/${data["arq-transfer-outbound"].total_bytes}, State: ${data["arq-transfer-outbound"].state}`;
displayToast("info", "bi-info-circle", message, 5000);
stateStore.arq_transmission_percent = data["arq-transfer-outbound"].received_bytes / data["arq-transfer-outbound"].total_bytes * 100;
stateStore.arq_total_bytes = data["arq-transfer-outbound"].received_bytes;
return;
case "ABORTING":
console.log("state ABORTING needs to be implemented");
console.info("state ABORTING needs to be implemented");
return;
case "ABORTED":
@ -156,21 +161,30 @@ export function eventDispatcher(data) {
case "NEW":
message = `Type: ${data.type}, Session ID: ${data["arq-transfer-inbound"].session_id}, DXCall: ${data["arq-transfer-inbound"].dxcall}, State: ${data["arq-transfer-inbound"].state}`;
displayToast("info", "bi-info-circle", message, 5000);
stateStore.dxcallsign = data["arq-transfer-inbound"].dxcall;
stateStore.arq_transmission_percent=0;
stateStore.arq_total_bytes = 0;
return;
case "OPEN_ACK_SENT":
message = `Session ID: ${data["arq-transfer-inbound"].session_id}, DXCall: ${data["arq-transfer-inbound"].dxcall}, Total Bytes: ${data["arq-transfer-inbound"].total_bytes}, State: ${data["arq-transfer-inbound"].state}`;
displayToast("info", "bi-arrow-left-right", message, 5000);
stateStore.arq_transmission_percent = data["arq-transfer-inbound"].received_bytes / data["arq-transfer-inbound"].total_bytes * 100;
stateStore.arq_total_bytes = data["arq-transfer-inbound"].received_bytes;
return;
case "INFO_ACK_SENT":
message = `Type: ${data.type}, Session ID: ${data["arq-transfer-inbound"].session_id}, DXCall: ${data["arq-transfer-inbound"].dxcall}, Received Bytes: ${data["arq-transfer-inbound"].received_bytes}/${data["arq-transfer-inbound"].total_bytes}, State: ${data["arq-transfer-inbound"].state}`;
displayToast("info", "bi-info-circle", message, 5000);
stateStore.arq_transmission_percent = data["arq-transfer-inbound"].received_bytes / data["arq-transfer-inbound"].total_bytes * 100;
stateStore.arq_total_bytes = data["arq-transfer-inbound"].received_bytes;
return;
case "BURST_REPLY_SENT":
message = `Type: ${data.type}, Session ID: ${data["arq-transfer-inbound"].session_id}, DXCall: ${data["arq-transfer-inbound"].dxcall}, Received Bytes: ${data["arq-transfer-inbound"].received_bytes}/${data["arq-transfer-inbound"].total_bytes}, State: ${data["arq-transfer-inbound"].state}`;
displayToast("info", "bi-info-circle", message, 5000);
stateStore.arq_transmission_percent = data["arq-transfer-inbound"].received_bytes / data["arq-transfer-inbound"].total_bytes * 100;
stateStore.arq_total_bytes = data["arq-transfer-inbound"].received_bytes;
return;
case "ENDED":
@ -181,10 +195,12 @@ export function eventDispatcher(data) {
data["arq-transfer-inbound"].data,
data["arq-transfer-inbound"],
);
stateStore.arq_transmission_percent = data["arq-transfer-inbound"].received_bytes / data["arq-transfer-inbound"].total_bytes * 100;
stateStore.arq_total_bytes = data["arq-transfer-inbound"].received_bytes;
return;
case "ABORTED":
console.log("state ABORTED needs to be implemented");
console.info("state ABORTED needs to be implemented");
return;
case "FAILED":