Merge pull request #637 from DJ2LS/develop

Config related adjustments and build process update
This commit is contained in:
DJ2LS 2024-02-10 14:01:21 +01:00 committed by GitHub
commit fd63cc7fa7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 51 additions and 61 deletions

View file

@ -39,7 +39,7 @@
"gatekeeperAssess": false,
"mergeASARs": true,
"x64ArchFiles": "**/*",
"artifactName": "${productName}-Mac-${version}.${ext}"
"artifactName": "${productName}-GUI-Mac-${version}.${ext}"
},
"win": {
"icon": "build/icon.png",
@ -49,7 +49,7 @@
"arch": ["arm64", "x64"]
}
],
"artifactName": "${productName}-Windows-${version}.${ext}"
"artifactName": "${productName}-GUI-Windows-${version}.${ext}"
},
"nsis": {
"oneClick": false,
@ -62,6 +62,6 @@
"target": [
"AppImage"
],
"artifactName": "${productName}-${version}.${ext}"
"artifactName": "${productName}-GUI-Linux-${version}.${ext}"
}
}

View file

@ -2,7 +2,7 @@
"name": "FreeDATA",
"description": "FreeDATA Client application for connecting to FreeDATA server",
"private": true,
"version": "0.13.2-alpha",
"version": "0.13.3-alpha",
"main": "dist-electron/main/index.js",
"scripts": {
"start": "vite",

View file

@ -8,7 +8,6 @@ import { getBeaconDataByCallsign } from "../js/api.js";
import { ref, computed } from "vue";
const chat = useChatStore(pinia);
function chatSelected(callsign) {
@ -46,24 +45,17 @@ function newChat() {
if (callsign === "") return;
this.newChatCall.value = "";
}
</script>
<template>
<nav class="navbar sticky-top bg-body-tertiary shadow">
<button
class="btn btn-outline-primary w-100"
data-bs-target="#newChatModal"
data-bs-toggle="modal"
>
<i class="bi bi-pencil-square"> Start a new chat</i>
</button>
</nav>
<nav class="navbar sticky-top bg-body-tertiary shadow">
<button
class="btn btn-outline-primary w-100"
data-bs-target="#newChatModal"
data-bs-toggle="modal"
>
<i class="bi bi-pencil-square"> Start a new chat</i>
</button>
</nav>
<div
class="list-group bg-body-tertiary m-0 p-1"

View file

@ -21,13 +21,9 @@ function getDateTime(timestampRaw) {
let day = date.getDate().toString().padStart(2, "0");
return `${year}-${month}-${day}`;
}
</script>
<template>
<div class="tab-content p-3" id="nav-tabContent-chat-messages">
<template
v-for="(details, callsign, key) in chat.callsign_list"
@ -66,10 +62,6 @@ function getDateTime(timestampRaw) {
</div>
</template>
</div>
</template>
<style>

View file

@ -69,8 +69,11 @@ export async function getVersion() {
let data = await apiGet("/version").then((res) => {
return res;
});
return data.version;
//return data["version"];
if (typeof data !== "undefined" && typeof data.version !== "undefined") {
return data.version;
}
return 0;
}
export async function getConfig() {

View file

@ -24,7 +24,10 @@ setActivePinia(pinia);
import { useStateStore } from "../store/stateStore.js";
const stateStore = useStateStore(pinia);
import { settingsStore as settings } from "../store/settingsStore.js";
import {
settingsStore as settings,
getRemote,
} from "../store/settingsStore.js";
export function connectionFailed(endpoint, event) {
stateStore.modem_connection = "disconnected";
@ -128,9 +131,15 @@ export function eventDispatcher(data) {
message = "Connected to server";
displayToast("success", "bi-ethernet", message, 5000);
stateStore.modem_connection = "connected";
getRemote().then(() => {
//initConnections();
getModemState();
});
//getConfig();
getModemState();
getOverallHealth();
getConfig();
getAudioDevices();
getSerialDevices();
getFreedataMessages();

View file

@ -29,23 +29,8 @@ nconf.file({ file: configPath });
//They should be an exact mirror (variable wise) of settingsStore.local
//Nothing else should be needed aslong as components are using v-bind
// +++
nconf.defaults({
local: {
host: "127.0.0.1",
port: "5000",
spectrum: "waterfall",
wf_theme: 2,
update_channel: "alpha",
enable_sys_notification: false,
grid_layout: "[]",
grid_preset: "[]",
grid_enabled: true,
},
});
nconf.required(["local:host", "local:port"]);
export const settingsStore = reactive({
const defaultConfig = {
local: {
host: "127.0.0.1",
port: "5000",
@ -104,7 +89,7 @@ export const settingsStore = reactive({
STATION: {
enable_explorer: false,
enable_stats: false,
mycall: "",
mycall: "DEFAULT",
myssid: 0,
mygrid: "",
ssid_list: [],
@ -114,7 +99,12 @@ export const settingsStore = reactive({
tci_port: 0,
},
},
});
};
nconf.defaults(defaultConfig.local);
nconf.required(["local:host", "local:port"]);
export const settingsStore = reactive(defaultConfig);
//Save settings for GUI to config file
settingsStore.local = nconf.get("local");
@ -128,7 +118,13 @@ export function onChange() {
export function getRemote() {
return getConfig().then((conf) => {
settingsStore.remote = conf;
if (typeof conf !== "undefined") {
settingsStore.remote = conf;
onChange();
} else {
console.warn("Received undefined configuration, using default!");
settingsStore.remote = defaultConfig.remote;
}
});
}

View file

@ -3,7 +3,7 @@ modemport = 3050
[STATION]
mycall = XX1XXX
mygrid = JN18cv
mygrid = AA12aa
myssid = 6
ssid_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
enable_explorer = True
@ -50,8 +50,8 @@ tuning_range_fmin = -50
enable_fsk = False
enable_low_bandwidth_mode = False
enable_morse_identifier = False
respond_to_cq = False
respond_to_cq = True
rx_buffer_size = 64
tx_delay = 200
beacon_interval = 90
beacon_interval = 300

View file

@ -24,7 +24,6 @@ class explorer():
self.config = self.config_manager.read()
self.states = states
self.explorer_url = "https://api.freedata.app/explorer.php"
self.publish_interval = 120
def push(self):
self.config = self.config_manager.read()
@ -40,11 +39,10 @@ class explorer():
# stop pushing if default callsign
if callsign in ['XX1XXX-6']:
# Reschedule the push method
self.scheduler.enter(self.publish_interval, 1, self.push)
return
log.info("[EXPLORER] publish", frequency=frequency, band=band, callsign=callsign, gridsquare=gridsquare, version=version, bandwidth=bandwidth)
# disabled this one
# log.info("[EXPLORER] publish", frequency=frequency, band=band, callsign=callsign, gridsquare=gridsquare, version=version, bandwidth=bandwidth)
headers = {"Content-Type": "application/json"}
station_data = {'callsign': callsign, 'gridsquare': gridsquare, 'frequency': frequency, 'strength': strength, 'band': band, 'version': version, 'bandwidth': bandwidth, 'beacon': beacon, "lastheard": []}

View file

@ -21,7 +21,7 @@ class ScheduleManager:
self.scheduler = sched.scheduler(time.time, time.sleep)
self.events = {
'check_for_queued_messages': {'function': self.check_for_queued_messages, 'interval': 10},
'explorer_publishing': {'function': self.push_to_explorer, 'interval': 120},
'explorer_publishing': {'function': self.push_to_explorer, 'interval': 60},
'transmitting_beacon': {'function': self.transmit_beacon, 'interval': self.beacon_interval},
'beacon_cleanup': {'function': self.delete_beacons, 'interval': 600},
}

View file

@ -29,7 +29,7 @@ app = Flask(__name__)
CORS(app)
CORS(app, resources={r"/*": {"origins": "*"}})
sock = Sock(app)
MODEM_VERSION = "0.13.2-alpha"
MODEM_VERSION = "0.13.3-alpha"
# set config file to use
def set_config():