feat: added live status for TM74TFR
This commit is contained in:
+10
-7
@@ -2063,6 +2063,14 @@ export default function App() {
|
||||
<Combobox value={rstRcvd} options={rstOptions(mode, rstLists)} allowFreeText commitOnType onChange={(v) => { setRstRcvd(v); rstUserEditedRef.current = true; }} />
|
||||
</div>
|
||||
);
|
||||
// DX country flag, shown large next to RST (moved here from the Country field).
|
||||
const flagBlock = flagURL(details.dxcc) ? (
|
||||
<div className="flex flex-col justify-end shrink-0">
|
||||
<img src={flagURL(details.dxcc)} alt={country} title={country}
|
||||
className="h-9 rounded-[3px] border border-border/60 shadow-sm"
|
||||
referrerPolicy="no-referrer" onError={(e) => { (e.currentTarget as HTMLImageElement).style.display = 'none'; }} />
|
||||
</div>
|
||||
) : null;
|
||||
// Deferred-entry date: only shown when the start time is locked (back-entering
|
||||
// a past QSO). Sets the DATE part of qsoStartedAt; the time field keeps the time.
|
||||
const dateBlock = locks.start ? (
|
||||
@@ -2185,13 +2193,7 @@ export default function App() {
|
||||
);
|
||||
const countryRow = (
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-20 shrink-0 flex items-center gap-1.5">
|
||||
Country
|
||||
{flagURL(details.dxcc) && (
|
||||
<img src={flagURL(details.dxcc)} alt="" className="h-3 rounded-[2px] border border-border/50 shadow-sm mr-0.5"
|
||||
referrerPolicy="no-referrer" onError={(e) => { (e.currentTarget as HTMLImageElement).style.display = 'none'; }} />
|
||||
)}
|
||||
</Label>
|
||||
<Label className="w-20 shrink-0">Country</Label>
|
||||
<div className="flex-1 min-w-0">
|
||||
<Combobox value={country} options={countries} placeholder="Country" onChange={(v) => { setCountry(v); markEdited('country'); }} />
|
||||
</div>
|
||||
@@ -2927,6 +2929,7 @@ export default function App() {
|
||||
{callsignBlock}
|
||||
{rstTxBlock}
|
||||
{rstRxBlock}
|
||||
{flagBlock}
|
||||
<div className="ml-auto flex gap-2">
|
||||
{dateBlock}
|
||||
{startBlock}
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
GetDataDir,
|
||||
GetAutostartPrograms, SaveAutostartPrograms, BrowseExecutable, LaunchAutostartProgram,
|
||||
GetTelemetryEnabled, SetTelemetryEnabled,
|
||||
GetLiveStatusEnabled, SetLiveStatusEnabled,
|
||||
GetQSLDefaults, SaveQSLDefaults,
|
||||
GetExternalServices, SaveExternalServices, TestQRZUpload, TestClublogUpload,
|
||||
GetPOTAToken, SavePOTAToken,
|
||||
@@ -448,6 +449,25 @@ function TelemetryToggle() {
|
||||
);
|
||||
}
|
||||
|
||||
// LiveStatusToggle publishes this operator's current activity (call + band +
|
||||
// freq + mode) to the shared MySQL `live_status` table every ~15s, for multi-op
|
||||
// events — a small web script on your server renders it for the QRZ page. Only
|
||||
// useful on a MySQL logbook. Self-contained component (owns its async state).
|
||||
function LiveStatusToggle() {
|
||||
const [on, setOn] = useState(false);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
useEffect(() => {
|
||||
GetLiveStatusEnabled().then((v) => setOn(!!v)).catch(() => {}).finally(() => setLoaded(true));
|
||||
}, []);
|
||||
return (
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox checked={on} disabled={!loaded}
|
||||
onCheckedChange={(c) => { const v = !!c; setOn(v); SetLiveStatusEnabled(v).catch(() => {}); }} />
|
||||
Publish live operator status <span className="text-xs text-muted-foreground">(multi-op on shared MySQL — feeds a QRZ live page)</span>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
|
||||
// MainViewPanes lets the operator choose what the Main tab's left and right
|
||||
// panes show, independently: the great-circle map, the locator street map, the
|
||||
// cluster grid or the worked-before grid. Per-profile (stored via SetUIPref,
|
||||
@@ -3351,6 +3371,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
Check for updates at startup <span className="text-xs text-muted-foreground">(notifies when a newer OpsLog is published)</span>
|
||||
</label>
|
||||
<TelemetryToggle />
|
||||
<LiveStatusToggle />
|
||||
|
||||
<MainViewPanes onChanged={onMainPaneChanged} flexAvailable={flexAvailable} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user