feat: New tool to remove duplicates in the log
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user