Fix BM status save
This commit is contained in:
parent
409b8fbcee
commit
0b85a68dae
2 changed files with 14 additions and 2 deletions
6
db.go
6
db.go
|
|
@ -570,14 +570,16 @@ func updateRepeater(db *sql.DB, r Repeater) error {
|
||||||
color_code=$12, ts_linked=$13, trustee=$14, ipsc_network=$15,
|
color_code=$12, ts_linked=$13, trustee=$14, ipsc_network=$15,
|
||||||
networks=$16, hotspot=$17, status=$18,
|
networks=$16, hotspot=$17, status=$18,
|
||||||
hardware=$19, firmware=$20, pep=$21, agl=$22,
|
hardware=$19, firmware=$20, pep=$21, agl=$22,
|
||||||
website=$23, description=$24
|
website=$23, description=$24,
|
||||||
|
last_seen=$25, bm_status=$26, bm_status_text=$27
|
||||||
WHERE id=$1`,
|
WHERE id=$1`,
|
||||||
r.ID, r.Callsign, r.FreqTx, r.FreqRx, r.FreqOffset, r.Band,
|
r.ID, r.Callsign, r.FreqTx, r.FreqRx, r.FreqOffset, r.Band,
|
||||||
r.Lat, r.Lng, r.City, r.State, r.Country,
|
r.Lat, r.Lng, r.City, r.State, r.Country,
|
||||||
r.ColorCode, r.TsLinked, r.Trustee, r.IpscNetwork,
|
r.ColorCode, r.TsLinked, r.Trustee, r.IpscNetwork,
|
||||||
r.Networks, r.Hotspot, r.Status,
|
r.Networks, r.Hotspot, r.Status,
|
||||||
r.Hardware, r.Firmware, r.Pep, r.Agl,
|
r.Hardware, r.Firmware, r.Pep, r.Agl,
|
||||||
r.Website, r.Description)
|
r.Website, r.Description,
|
||||||
|
r.LastSeen, r.BmStatus, r.BmStatusText)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1156,6 +1156,16 @@
|
||||||
updateField("website", bm.website);
|
updateField("website", bm.website);
|
||||||
updateField("description", bm.description);
|
updateField("description", bm.description);
|
||||||
|
|
||||||
|
// Readonly fields are skipped by updateField for editingRepeater,
|
||||||
|
// so set them directly in the format Go expects for save
|
||||||
|
if (editingRepeater) {
|
||||||
|
if (bm.last_seen) {
|
||||||
|
editingRepeater.last_seen = bm.last_seen.replace(" ", "T") + "Z";
|
||||||
|
}
|
||||||
|
editingRepeater.bm_status = bm.status;
|
||||||
|
editingRepeater.bm_status_text = bm.status_text || "";
|
||||||
|
}
|
||||||
|
|
||||||
saveStatus.textContent = "BM data loaded — review and save";
|
saveStatus.textContent = "BM data loaded — review and save";
|
||||||
saveStatus.className = "save-status success";
|
saveStatus.className = "save-status success";
|
||||||
fetchBmBtn.disabled = false;
|
fetchBmBtn.disabled = false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue