feat: added support for eQSL
This commit is contained in:
@@ -24,6 +24,7 @@ const SERVICES = [
|
||||
{ v: 'qrz', label: 'QRZ.com' },
|
||||
{ v: 'clublog', label: 'Club Log' },
|
||||
{ v: 'hrdlog', label: 'HRDLog.net' },
|
||||
{ v: 'eqsl', label: 'eQSL.cc' },
|
||||
{ v: 'lotw', label: 'LoTW' },
|
||||
{ v: 'pota', label: 'POTA hunter log' },
|
||||
{ v: 'paper', label: 'Paper QSL' },
|
||||
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
GetTelemetryEnabled, SetTelemetryEnabled,
|
||||
GetLiveStatusEnabled, SetLiveStatusEnabled,
|
||||
GetQSLDefaults, SaveQSLDefaults,
|
||||
GetExternalServices, SaveExternalServices, TestQRZUpload, TestClublogUpload, TestHRDLogUpload,
|
||||
GetExternalServices, SaveExternalServices, TestQRZUpload, TestClublogUpload, TestHRDLogUpload, TestEQSLUpload,
|
||||
GetPOTAToken, SavePOTAToken,
|
||||
TestLoTWUpload, ListTQSLStationLocations,
|
||||
ComputeStationInfo,
|
||||
@@ -747,21 +747,21 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
// wired today. upload_mode is 'immediate' | 'delayed' (per-service).
|
||||
type ExtServiceCfg = {
|
||||
api_key: string; email: string; username: string; password: string; callsign: string;
|
||||
code: string;
|
||||
code: string; qth_nickname: string;
|
||||
force_station_callsign: string;
|
||||
tqsl_path: string; station_location: string; key_password: string;
|
||||
upload_flags: string[]; write_log: boolean;
|
||||
auto_upload: boolean; upload_mode: string;
|
||||
};
|
||||
type ExternalServices = { qrz: ExtServiceCfg; clublog: ExtServiceCfg; lotw: ExtServiceCfg; hrdlog: ExtServiceCfg };
|
||||
type ExternalServices = { qrz: ExtServiceCfg; clublog: ExtServiceCfg; lotw: ExtServiceCfg; hrdlog: ExtServiceCfg; eqsl: ExtServiceCfg };
|
||||
const emptyExtCfg = (): ExtServiceCfg => ({
|
||||
api_key: '', email: '', username: '', password: '', callsign: '', code: '',
|
||||
api_key: '', email: '', username: '', password: '', callsign: '', code: '', qth_nickname: '',
|
||||
force_station_callsign: '', tqsl_path: '', station_location: '', key_password: '',
|
||||
upload_flags: ['N', 'R'], write_log: false,
|
||||
auto_upload: false, upload_mode: 'immediate',
|
||||
});
|
||||
const [extSvc, setExtSvc] = useState<ExternalServices>({
|
||||
qrz: emptyExtCfg(), clublog: emptyExtCfg(), lotw: emptyExtCfg(), hrdlog: emptyExtCfg(),
|
||||
qrz: emptyExtCfg(), clublog: emptyExtCfg(), lotw: emptyExtCfg(), hrdlog: emptyExtCfg(), eqsl: emptyExtCfg(),
|
||||
});
|
||||
const [qrzTest, setQrzTest] = useState<{ ok: boolean; msg: string } | null>(null);
|
||||
const [qrzTesting, setQrzTesting] = useState(false);
|
||||
@@ -771,10 +771,12 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
const [lotwTesting, setLotwTesting] = useState(false);
|
||||
const [hrdlogTest, setHrdlogTest] = useState<{ ok: boolean; msg: string } | null>(null);
|
||||
const [hrdlogTesting, setHrdlogTesting] = useState(false);
|
||||
const [eqslTest, setEqslTest] = useState<{ ok: boolean; msg: string } | null>(null);
|
||||
const [eqslTesting, setEqslTesting] = useState(false);
|
||||
const [stationLocations, setStationLocations] = useState<string[]>([]);
|
||||
// Active tab in the External Services panel — lifted here because
|
||||
// PANELS[selected]() is called as a function, so panels can't hold hooks.
|
||||
const [extSvcTab, setExtSvcTab] = useState<'qrz' | 'clublog' | 'hrdlog' | 'eqsl' | 'hamqth' | 'lotw' | 'pota'>('qrz');
|
||||
const [extSvcTab, setExtSvcTab] = useState<'qrz' | 'clublog' | 'hrdlog' | 'eqsl' | 'lotw' | 'pota'>('qrz');
|
||||
// POTA hunter-log sync (stamps pota_ref on local QSOs from your pota.app log).
|
||||
const [potaToken, setPotaToken] = useState('');
|
||||
const [potaBusy, setPotaBusy] = useState(false);
|
||||
@@ -2607,8 +2609,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
{ k: 'qrz', label: 'QRZ.COM', ready: true },
|
||||
{ k: 'clublog', label: 'CLUBLOG', ready: true },
|
||||
{ k: 'hrdlog', label: 'HRDLOG.NET', ready: true },
|
||||
{ k: 'eqsl', label: 'EQSL' },
|
||||
{ k: 'hamqth', label: 'HAMQTH' },
|
||||
{ k: 'eqsl', label: 'EQSL', ready: true },
|
||||
{ k: 'lotw', label: 'LOTW', ready: true },
|
||||
{ k: 'pota', label: 'POTA', ready: true },
|
||||
];
|
||||
@@ -2679,6 +2680,24 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
}
|
||||
}
|
||||
|
||||
const eqsl = extSvc.eqsl;
|
||||
const setEqsl = (patch: Partial<ExtServiceCfg>) =>
|
||||
setExtSvc((s) => ({ ...s, eqsl: { ...s.eqsl, ...patch } }));
|
||||
|
||||
async function testEqsl() {
|
||||
setEqslTesting(true);
|
||||
setEqslTest(null);
|
||||
try {
|
||||
await SaveExternalServices(extSvc as any);
|
||||
const msg = await TestEQSLUpload();
|
||||
setEqslTest({ ok: true, msg });
|
||||
} catch (e: any) {
|
||||
setEqslTest({ ok: false, msg: String(e?.message ?? e) });
|
||||
} finally {
|
||||
setEqslTesting(false);
|
||||
}
|
||||
}
|
||||
|
||||
const lotw = extSvc.lotw;
|
||||
const setLotw = (patch: Partial<ExtServiceCfg>) =>
|
||||
setExtSvc((s) => ({ ...s, lotw: { ...s.lotw, ...patch } }));
|
||||
@@ -2913,6 +2932,72 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : extSvcTab === 'eqsl' ? (
|
||||
<div className="space-y-4 max-w-2xl">
|
||||
<div className="grid grid-cols-[170px_1fr] gap-3 items-center">
|
||||
<Label className="text-sm">Username (callsign)</Label>
|
||||
<Input
|
||||
value={eqsl.username}
|
||||
onChange={(e) => setEqsl({ username: e.target.value.toUpperCase() })}
|
||||
placeholder="your eQSL.cc login (callsign)"
|
||||
className="font-mono text-xs"
|
||||
/>
|
||||
<Label className="text-sm">Password</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={eqsl.password}
|
||||
onChange={(e) => setEqsl({ password: e.target.value })}
|
||||
placeholder="eQSL.cc account password"
|
||||
className="text-xs"
|
||||
/>
|
||||
<Label className="text-sm">QTH nickname</Label>
|
||||
<Input
|
||||
value={eqsl.qth_nickname}
|
||||
onChange={(e) => setEqsl({ qth_nickname: e.target.value })}
|
||||
placeholder="optional — required only if your eQSL account has several QTHs"
|
||||
className="text-xs"
|
||||
/>
|
||||
</div>
|
||||
<div className="text-[10px] text-muted-foreground -mt-1">
|
||||
The QTH nickname tells eQSL which location profile to file the QSO under. Leave blank if you have only one.
|
||||
</div>
|
||||
|
||||
<div className="border-t border-border/60 pt-3 space-y-3">
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox
|
||||
checked={eqsl.auto_upload}
|
||||
onCheckedChange={(c) => setEqsl({ auto_upload: !!c })}
|
||||
/>
|
||||
Automatic upload on new QSO
|
||||
</label>
|
||||
|
||||
<div className="grid grid-cols-[170px_1fr] gap-3 items-center">
|
||||
<Label className="text-sm">Upload timing</Label>
|
||||
<Select
|
||||
value={eqsl.upload_mode || 'immediate'}
|
||||
onValueChange={(v) => setEqsl({ upload_mode: v })}
|
||||
>
|
||||
<SelectTrigger className="h-8 w-64"><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="immediate">Immediate</SelectItem>
|
||||
<SelectItem value="delayed">Delayed (1–2 min, lets you fix mistakes)</SelectItem>
|
||||
<SelectItem value="on_close">On app close (batch)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<Button variant="outline" size="sm" onClick={testEqsl} disabled={eqslTesting}>
|
||||
<UploadCloud className="size-3.5" /> {eqslTesting ? 'Testing…' : 'Test connection'}
|
||||
</Button>
|
||||
{eqslTest && (
|
||||
<span className={cn('text-xs', eqslTest.ok ? 'text-emerald-700' : 'text-rose-700')}>
|
||||
{eqslTest.msg}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : extSvcTab === 'lotw' ? (
|
||||
<div className="space-y-4 max-w-2xl">
|
||||
<div className="grid grid-cols-[170px_1fr] gap-3 items-center">
|
||||
|
||||
Vendored
+2
@@ -471,6 +471,8 @@ export function SyncPOTAHunterLog(arg1:boolean,arg2:boolean):Promise<main.POTASy
|
||||
|
||||
export function TestClublogUpload():Promise<string>;
|
||||
|
||||
export function TestEQSLUpload():Promise<string>;
|
||||
|
||||
export function TestEmail(arg1:string):Promise<void>;
|
||||
|
||||
export function TestHRDLogUpload():Promise<string>;
|
||||
|
||||
@@ -914,6 +914,10 @@ export function TestClublogUpload() {
|
||||
return window['go']['main']['App']['TestClublogUpload']();
|
||||
}
|
||||
|
||||
export function TestEQSLUpload() {
|
||||
return window['go']['main']['App']['TestEQSLUpload']();
|
||||
}
|
||||
|
||||
export function TestEmail(arg1) {
|
||||
return window['go']['main']['App']['TestEmail'](arg1);
|
||||
}
|
||||
|
||||
@@ -670,6 +670,7 @@ export namespace extsvc {
|
||||
password: string;
|
||||
callsign: string;
|
||||
code: string;
|
||||
qth_nickname: string;
|
||||
force_station_callsign: string;
|
||||
tqsl_path: string;
|
||||
station_location: string;
|
||||
@@ -691,6 +692,7 @@ export namespace extsvc {
|
||||
this.password = source["password"];
|
||||
this.callsign = source["callsign"];
|
||||
this.code = source["code"];
|
||||
this.qth_nickname = source["qth_nickname"];
|
||||
this.force_station_callsign = source["force_station_callsign"];
|
||||
this.tqsl_path = source["tqsl_path"];
|
||||
this.station_location = source["station_location"];
|
||||
@@ -706,6 +708,7 @@ export namespace extsvc {
|
||||
clublog: ServiceConfig;
|
||||
lotw: ServiceConfig;
|
||||
hrdlog: ServiceConfig;
|
||||
eqsl: ServiceConfig;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new ExternalServices(source);
|
||||
@@ -717,6 +720,7 @@ export namespace extsvc {
|
||||
this.clublog = this.convertValues(source["clublog"], ServiceConfig);
|
||||
this.lotw = this.convertValues(source["lotw"], ServiceConfig);
|
||||
this.hrdlog = this.convertValues(source["hrdlog"], ServiceConfig);
|
||||
this.eqsl = this.convertValues(source["eqsl"], ServiceConfig);
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
|
||||
Reference in New Issue
Block a user