Skip to content

Commit d5592e5

Browse files
CopilotMrAlders0n
andcommitted
Add sample count tracking to RX log entries and UI badges
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
1 parent 88e14f8 commit d5592e5

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

content/wardrive.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ function queueApiPost(entry) {
26632663

26642664
// Add aggregated entry to RX log UI
26652665
const timestamp = new Date(entry.timestamp_start).toISOString();
2666-
addRxLogEntry(entry.repeater_id, entry.snr_avg, entry.rssi_avg, entry.path_length, entry.header, entry.location.lat, entry.location.lng, timestamp);
2666+
addRxLogEntry(entry.repeater_id, entry.snr_avg, entry.rssi_avg, entry.path_length, entry.header, entry.location.lat, entry.location.lng, timestamp, entry.sample_count);
26672667
}
26682668

26692669
// ---- Mobile TX Log Bottom Sheet ----
@@ -3003,6 +3003,14 @@ function createRxLogEntryElement(entry) {
30033003
const chip = createChipElement(parsed.repeaterId, parsed.snr);
30043004
chipsRow.appendChild(chip);
30053005

3006+
// Add sample count badge if aggregated (sampleCount > 1)
3007+
if (entry.sampleCount && entry.sampleCount > 1) {
3008+
const badge = document.createElement('span');
3009+
badge.className = 'text-xs text-slate-400 ml-1';
3010+
badge.textContent = `x${entry.sampleCount}`;
3011+
chipsRow.appendChild(badge);
3012+
}
3013+
30063014
logEntry.appendChild(topRow);
30073015
logEntry.appendChild(chipsRow);
30083016

@@ -3162,7 +3170,7 @@ function toggleRxLogBottomSheet() {
31623170
* @param {number} lon - Longitude
31633171
* @param {string} timestamp - ISO timestamp
31643172
*/
3165-
function addRxLogEntry(repeaterId, snr, rssi, pathLength, header, lat, lon, timestamp) {
3173+
function addRxLogEntry(repeaterId, snr, rssi, pathLength, header, lat, lon, timestamp, sampleCount = 1) {
31663174
const entry = {
31673175
repeaterId,
31683176
snr,
@@ -3171,7 +3179,8 @@ function addRxLogEntry(repeaterId, snr, rssi, pathLength, header, lat, lon, time
31713179
header,
31723180
lat,
31733181
lon,
3174-
timestamp
3182+
timestamp,
3183+
sampleCount
31753184
};
31763185

31773186
rxLogState.entries.push(entry);

0 commit comments

Comments
 (0)