From d7fa0a6039b20288b3743119db5fe0c94dc3f4c4 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 3 Nov 2023 21:41:23 -0400 Subject: [PATCH 01/12] Dont allow creation of blank callsigns in chat. --- gui/src/components/chat_navbar.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/src/components/chat_navbar.vue b/gui/src/components/chat_navbar.vue index 46a2bc72..d7b90f21 100644 --- a/gui/src/components/chat_navbar.vue +++ b/gui/src/components/chat_navbar.vue @@ -121,7 +121,8 @@ const beaconHistogramData = computed(() => ({ function newChat() { let callsign = this.newChatCall.value; - callsign = callsign.toUpperCase(); + callsign = callsign.toUpperCase().trim(); + if (callsign === "") return; chat.callsign_list.add(callsign); this.newChatCall.value = ""; } From 8015ce88c66ab3c7a9b7f34bb7585f56fe61cd9a Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 3 Nov 2023 21:43:07 -0400 Subject: [PATCH 02/12] Fix kHz label --- gui/src/components/main_footer_navbar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/components/main_footer_navbar.vue b/gui/src/components/main_footer_navbar.vue index 4df19e5a..b03635d4 100644 --- a/gui/src/components/main_footer_navbar.vue +++ b/gui/src/components/main_footer_navbar.vue @@ -130,7 +130,7 @@ const state = useStateStore(pinia); data-bs-title="What's the frequency, Kenneth?" style="pointer-events: auto" > - {{ parseInt(state.frequency) / 1000 }} KHz + {{ parseInt(state.frequency) / 1000 }} kHz From 39b28884bf214b70bf90944b517f15415a8a299a Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 3 Nov 2023 21:44:39 -0400 Subject: [PATCH 03/12] Remove text from frequency dropdown --- gui/src/components/main_active_rig_control.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/components/main_active_rig_control.vue b/gui/src/components/main_active_rig_control.vue index 51bd4e02..61dbd37a 100644 --- a/gui/src/components/main_active_rig_control.vue +++ b/gui/src/components/main_active_rig_control.vue @@ -80,7 +80,7 @@ function set_hamlib_rf_level() { data-bs-toggle="dropdown" aria-expanded="false" > - Select Frequency + From 7eb65dd91ec63feb38a6d473939bbfb933277ad7 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 3 Nov 2023 21:50:28 -0400 Subject: [PATCH 04/12] Move sort functions for freedata.js for use elsewhere, add a sort desc function as well. --- gui/src/js/chatHandler.ts | 12 +----------- gui/src/js/freedata.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/gui/src/js/chatHandler.ts b/gui/src/js/chatHandler.ts index 79191f3b..3138b07f 100644 --- a/gui/src/js/chatHandler.ts +++ b/gui/src/js/chatHandler.ts @@ -20,7 +20,7 @@ import { sendMessage, sendBroadcastChannel } from "./sock.js"; import { displayToast } from "./popupHandler.js"; //const FD = require("./src/js/freedata.js"); -import { btoa_FD } from "./freedata.js"; +import { btoa_FD,sortByProperty } from "./freedata.js"; // define default message object interface Attachment { @@ -279,16 +279,6 @@ function sortChatList() { return reorderedData; } -//https://medium.com/@asadise/sorting-a-json-array-according-one-property-in-javascript-18b1d22cd9e9 -function sortByProperty(property) { - return function (a, b) { - if (a[property] > b[property]) return 1; - else if (a[property] < b[property]) return -1; - - return 0; - }; -} - export function getMessageAttachment(id) { return new Promise(async (resolve, reject) => { try { diff --git a/gui/src/js/freedata.ts b/gui/src/js/freedata.ts index 6f532bee..18fdd623 100644 --- a/gui/src/js/freedata.ts +++ b/gui/src/js/freedata.ts @@ -25,3 +25,22 @@ export function atob(data) { //exports.atob = function (data) { return window.btoa(Buffer.from(data, "base64").toString("utf8")); } +//https://medium.com/@asadise/sorting-a-json-array-according-one-property-in-javascript-18b1d22cd9e9 +export function sortByProperty(property) { + return function (a, b) { + if (a[property] > b[property]) return 1; + else if (a[property] < b[property]) return -1; + + return 0; + }; +} + +//https://medium.com/@asadise/sorting-a-json-array-according-one-property-in-javascript-18b1d22cd9e9 +export function sortByPropertyDesc(property) { + return function (a, b) { + if (a[property] < b[property]) return 1; + else if (a[property] > b[property]) return -1; + + return 0; + }; +} \ No newline at end of file From 331031c0b9d69d1054efc41fe0a2010081877fcf Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 3 Nov 2023 21:54:29 -0400 Subject: [PATCH 05/12] Sort heard stations descending by timestamp --- gui/src/js/sock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/src/js/sock.js b/gui/src/js/sock.js index 72282466..f7e02866 100644 --- a/gui/src/js/sock.js +++ b/gui/src/js/sock.js @@ -1,5 +1,5 @@ var net = require("net"); -import { atob_FD, btoa_FD } from "./freedata"; +import { atob_FD, btoa_FD,sortByPropertyDesc } from "./freedata"; import { addDataToWaterfall } from "../js/waterfallHandler.js"; import { @@ -215,7 +215,7 @@ client.on("data", function (socketdata) { stateStore.dbfs_level = Math.round(stateStore.dbfs_level); stateStore.arq_total_bytes = data["total_bytes"]; - stateStore.heard_stations = data["stations"]; + stateStore.heard_stations = data["stations"].sort(sortByPropertyDesc("timestamp")); stateStore.dxcallsign = data["dxcallsign"]; stateStore.beacon_state = data["beacon_state"]; From 7e3e315f06f6bf56b8658d2e4564aaa4725bd30a Mon Sep 17 00:00:00 2001 From: Mashintime Date: Fri, 3 Nov 2023 22:12:06 -0400 Subject: [PATCH 06/12] Waterfall theme support --- gui/src/components/settings_gui.vue | 4 +++- gui/src/js/settingsHandler.ts | 5 ++++- gui/src/js/waterfallHandler.js | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gui/src/components/settings_gui.vue b/gui/src/components/settings_gui.vue index 19a15e60..7468d0b3 100644 --- a/gui/src/components/settings_gui.vue +++ b/gui/src/components/settings_gui.vue @@ -1,4 +1,5 @@