smaller gui fixes, return all messages as valid json

This commit is contained in:
DJ2LS 2024-02-03 13:53:31 +01:00
parent d42b25d6eb
commit 08c2b7809a
3 changed files with 8 additions and 2 deletions

View file

@ -9,6 +9,11 @@ import {
validateCallsignWithoutSSID,
} from "../js/freedata";
function validateCall() {
//ensure callsign is uppercase:
let call = settings.remote.STATION.mycall
settings.remote.STATION.mycall = call.toUpperCase()
if (validateCallsignWithoutSSID(settings.remote.STATION.mycall))
//Send new callsign to modem if valid
onChange();
@ -25,6 +30,7 @@ function validateCall() {
<input
type="text"
class="form-control"
style="text-transform: uppercase"
placeholder="Enter your callsign and save it"
id="myCall"
aria-label="Station Callsign"

View file

@ -65,7 +65,7 @@ export function sortByPropertyDesc(property) {
*/
export function validateCallsignWithSSID(callsign: string) {
var patt = new RegExp("^[A-Z]+[0-9][A-Z]*-(1[0-5]|[0-9])$");
callsign = callsign
if (
callsign === undefined ||
callsign === "" ||

View file

@ -175,7 +175,7 @@ class DatabaseManager:
def get_all_messages_json(self):
messages_dict = self.get_all_messages()
messages_with_header = {'total_messages' : len(messages_dict), 'messages' : messages_dict}
return json.dumps(messages_with_header) # Convert to JSON string
return messages_with_header
def get_message_by_id(self, message_id):
session = self.get_thread_scoped_session()