fix: added functionality to net control

This commit is contained in:
2026-06-24 19:09:34 +02:00
parent 8b831145ad
commit d6626d96d0
6 changed files with 205 additions and 207 deletions
+6 -4
View File
@@ -372,18 +372,20 @@ export function LookupCallsign(arg1:string):Promise<lookup.Result>;
export function MoveDatabase(arg1:string):Promise<void>;
export function NetActivate(arg1:string):Promise<main.netActiveEntry>;
export function NetActivate(arg1:string):Promise<qso.QSO>;
export function NetActiveList():Promise<Array<main.netActiveEntry>>;
export function NetActiveList():Promise<Array<qso.QSO>>;
export function NetClose():Promise<void>;
export function NetCreate(arg1:string):Promise<netctl.Net>;
export function NetDeactivate(arg1:string):Promise<number>;
export function NetDeactivate(arg1:number):Promise<number>;
export function NetDelete(arg1:string):Promise<void>;
export function NetDiscardActive(arg1:number):Promise<void>;
export function NetList():Promise<Array<netctl.Net>>;
export function NetLookup(arg1:string):Promise<netctl.Station>;
@@ -402,7 +404,7 @@ export function NetRosterUpsert(arg1:string,arg2:netctl.Station):Promise<void>;
export function NetSetDefaults(arg1:string,arg2:string,arg3:string,arg4:string):Promise<void>;
export function NetUpdateActive(arg1:main.netActiveEntry):Promise<void>;
export function NetUpdateActive(arg1:qso.QSO):Promise<void>;
export function OpenADIFFile():Promise<string>;
+4
View File
@@ -734,6 +734,10 @@ export function NetDelete(arg1) {
return window['go']['main']['App']['NetDelete'](arg1);
}
export function NetDiscardActive(arg1) {
return window['go']['main']['App']['NetDiscardActive'](arg1);
}
export function NetList() {
return window['go']['main']['App']['NetList']();
}
-45
View File
@@ -2004,51 +2004,6 @@ export namespace main {
return a;
}
}
export class netActiveEntry {
callsign: string;
name: string;
qth: string;
country: string;
rst_sent: string;
rst_rcvd: string;
comment: string;
// Go type: time
time_on: any;
static createFrom(source: any = {}) {
return new netActiveEntry(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.callsign = source["callsign"];
this.name = source["name"];
this.qth = source["qth"];
this.country = source["country"];
this.rst_sent = source["rst_sent"];
this.rst_rcvd = source["rst_rcvd"];
this.comment = source["comment"];
this.time_on = this.convertValues(source["time_on"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}