feat: New tool to remove duplicates in the log

This commit is contained in:
2026-07-05 10:58:49 +02:00
parent 2d742be7df
commit 45b9bcdea7
7 changed files with 300 additions and 2 deletions
+32
View File
@@ -1528,6 +1528,38 @@ export namespace main {
this.is_custom = source["is_custom"];
}
}
export class DuplicateGroup {
key: string;
qsos: qso.QSO[];
static createFrom(source: any = {}) {
return new DuplicateGroup(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.key = source["key"];
this.qsos = this.convertValues(source["qsos"], qso.QSO);
}
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;
}
}
export class EmailSettings {
enabled: boolean;
smtp_host: string;