mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
smaller gui fixes, return all messages as valid json
This commit is contained in:
parent
d42b25d6eb
commit
08c2b7809a
3 changed files with 8 additions and 2 deletions
|
@ -9,6 +9,11 @@ import {
|
||||||
validateCallsignWithoutSSID,
|
validateCallsignWithoutSSID,
|
||||||
} from "../js/freedata";
|
} from "../js/freedata";
|
||||||
function validateCall() {
|
function validateCall() {
|
||||||
|
|
||||||
|
//ensure callsign is uppercase:
|
||||||
|
let call = settings.remote.STATION.mycall
|
||||||
|
settings.remote.STATION.mycall = call.toUpperCase()
|
||||||
|
|
||||||
if (validateCallsignWithoutSSID(settings.remote.STATION.mycall))
|
if (validateCallsignWithoutSSID(settings.remote.STATION.mycall))
|
||||||
//Send new callsign to modem if valid
|
//Send new callsign to modem if valid
|
||||||
onChange();
|
onChange();
|
||||||
|
@ -25,6 +30,7 @@ function validateCall() {
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
|
style="text-transform: uppercase"
|
||||||
placeholder="Enter your callsign and save it"
|
placeholder="Enter your callsign and save it"
|
||||||
id="myCall"
|
id="myCall"
|
||||||
aria-label="Station Callsign"
|
aria-label="Station Callsign"
|
||||||
|
|
|
@ -65,7 +65,7 @@ export function sortByPropertyDesc(property) {
|
||||||
*/
|
*/
|
||||||
export function validateCallsignWithSSID(callsign: string) {
|
export function validateCallsignWithSSID(callsign: string) {
|
||||||
var patt = new RegExp("^[A-Z]+[0-9][A-Z]*-(1[0-5]|[0-9])$");
|
var patt = new RegExp("^[A-Z]+[0-9][A-Z]*-(1[0-5]|[0-9])$");
|
||||||
|
callsign = callsign
|
||||||
if (
|
if (
|
||||||
callsign === undefined ||
|
callsign === undefined ||
|
||||||
callsign === "" ||
|
callsign === "" ||
|
||||||
|
|
|
@ -175,7 +175,7 @@ class DatabaseManager:
|
||||||
def get_all_messages_json(self):
|
def get_all_messages_json(self):
|
||||||
messages_dict = self.get_all_messages()
|
messages_dict = self.get_all_messages()
|
||||||
messages_with_header = {'total_messages' : len(messages_dict), 'messages' : messages_dict}
|
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):
|
def get_message_by_id(self, message_id):
|
||||||
session = self.get_thread_scoped_session()
|
session = self.get_thread_scoped_session()
|
||||||
|
|
Loading…
Reference in a new issue