FreeDATA/gui/src/store/chatStore.js

93 lines
2.4 KiB
JavaScript
Raw Normal View History

2023-10-03 13:15:17 +00:00
import { defineStore } from "pinia";
2023-10-22 13:44:05 +00:00
import { ref } from "vue";
2023-10-03 13:15:17 +00:00
export const useChatStore = defineStore("chatStore", () => {
var chat_filter = ref([
{ type: "newchat" },
{ type: "received" },
{ type: "transmit" },
{ type: "ping-ack" },
{ type: "broadcast_received" },
{ type: "broadcast_transmit" },
//{ type: "request" },
//{ type: "response" },
]);
var selectedCallsign = ref();
2023-10-14 13:32:30 +00:00
// we need a default value in our ref because of our message info modal
var selectedMessageObject = ref({
2023-10-22 08:12:00 +00:00
command: "msg",
hmac_signed: false,
percent: 0,
is_new: false,
_id: "2ead6698",
timestamp: 1697289795,
dxcallsign: "DJ2LS-0",
dxgrid: "null",
msg: "test",
checksum: "",
type: "transmit",
status: "transmitting",
attempt: 1,
uuid: "2ead6698",
duration: 0,
nacks: 0,
speed_list: "null",
_attachments: {
"": {
content_type: "text",
data: "",
},
},
});
var inputText = ref("");
2023-10-03 13:15:17 +00:00
var inputFile = ref();
var inputFileName = ref();
var inputFileType = ref();
var inputFileSize = ref();
var callsign_list = ref();
var sorted_chat_list = ref();
var unsorted_chat_list = ref([]);
var sorted_beacon_list = ref({});
var unsorted_beacon_list = ref({});
var chartSpeedPER0 = ref();
var chartSpeedPER25 = ref();
var chartSpeedPER75 = ref();
// var beaconDataArray = ref([-3, 10, 8, 5, 3, 0, -5, 10, 8, 5, 3, 0, -5, 10, 8, 5, 3, 0, -5, 10, 8, 5, 3, 0, -5])
// var beaconLabelArray = ref(['18:10', '19:00', '23:00', '01:13', '04:25', '08:15', '09:12', '18:10', '19:00', '23:00', '01:13', '04:25', '08:15', '09:12', '18:10', '19:00', '23:00', '01:13', '04:25', '08:15', '09:12', '01:13', '04:25', '08:15', '09:12'])
var beaconDataArray = ref([]);
var beaconLabelArray = ref([]);
2023-10-22 12:49:33 +00:00
var arq_speed_list_bpm = ref([]);
var arq_speed_list_timestamp = ref([]);
var arq_speed_list_snr = ref([]);
2023-10-03 13:15:17 +00:00
return {
selectedCallsign,
2023-10-14 13:32:30 +00:00
selectedMessageObject,
2023-10-03 13:15:17 +00:00
inputText,
chat_filter,
callsign_list,
sorted_chat_list,
unsorted_chat_list,
inputFileName,
inputFileSize,
inputFileType,
inputFile,
chartSpeedPER0,
chartSpeedPER25,
chartSpeedPER75,
beaconDataArray,
beaconLabelArray,
unsorted_beacon_list,
sorted_beacon_list,
2023-10-22 12:49:33 +00:00
arq_speed_list_bpm,
arq_speed_list_snr,
arq_speed_list_timestamp,
2023-10-03 13:15:17 +00:00
};
2023-09-12 15:52:16 +00:00
});