Explorar el Código

Link recordings to events in UI

master
Jan Svabenik hace 3 días
padre
commit
f306cb3379
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. +2
    -1
      internal/recorder/list.go
  2. +1
    -1
      web/app.js

+ 2
- 1
internal/recorder/list.go Ver fichero

@@ -12,6 +12,7 @@ type Recording struct {
ID string `json:"id"`
Start time.Time `json:"start"`
CenterHz float64 `json:"center_hz"`
EventID int64 `json:"event_id"`
Path string `json:"path"`
}

@@ -38,7 +39,7 @@ func ListRecordings(root string) ([]Recording, error) {
if err := json.Unmarshal(b, &m); err != nil {
continue
}
out = append(out, Recording{ID: id, Start: m.Start, CenterHz: m.CenterHz, Path: filepath.Join(root, id)})
out = append(out, Recording{ID: id, Start: m.Start, CenterHz: m.CenterHz, EventID: m.EventID, Path: filepath.Join(root, id)})
}
sort.Slice(out, func(i, j int) bool { return out[i].Start.After(out[j].Start) })
return out, nil


+ 1
- 1
web/app.js Ver fichero

@@ -1138,7 +1138,7 @@ if (decodeEventBtn) {
const ev = eventsById.get(selectedEventId);
if (!ev) return;
if (!recordingMetaEl) return;
const rec = recordings.find(r => r.center_hz === ev.center_hz);
const rec = recordings.find(r => r.event_id === ev.id) || recordings.find(r => r.center_hz === ev.center_hz);
if (!rec) {
decodeResultEl.textContent = 'Decode: no recording';
return;


Cargando…
Cancelar
Guardar