[Show the message list in webrtc admin messages tab when drill down by date Adrian Georgescu **20260726073556 Ignore-this: bc07988406d0aedd23ed4f6d6eba6e9d893bf9f5069752ff4175454a5b7e7f4a6bf8ee532dbb85a ] hunk ./sylk/applications/webrtcgateway/web.py 1259 + // When a full day is selected the backend also returns that day's + // messages (day_messages), sorted by timestamp, without the content — + // shown as a second table below the type summary. + const dirArrow = d => d === 'outgoing' ? '→' : d === 'incoming' ? '←' : ''; + const dayMsgs = j.day_messages; + const dayList = dayMsgs ? ` +
+ ${Number(dayMsgs.length).toLocaleString()} message(s) on ${esc(msgDateLabel(j.date))}${j.contact ? ` with ${esc(j.contact)}` : ''}, by time + + + + + + + + ${ + dayMsgs.length ? dayMsgs.map(m => ` + + + + + + + + `).join('') + : `` + }
TimeDirContactContent typeStateMessage id
${esc((m.created_at || '').slice(11, 19) || m.created_at || '')}${dirArrow(m.direction)}${esc(m.contact)}${esc(m.content_type)}${esc(m.state)}${esc(m.message_id)}
No messages on this day.
+
click a message id to load its full content in the dump box below
+
` : ''; hunk ./sylk/applications/webrtcgateway/web.py 1298 - `; + ${dayList}`; hunk ./sylk/applications/webrtcgateway/web.py 1301 +// Load a message's full content into the dump box below (used by the +// per-day message list — the id links call this). +function msgDump(encAccount, encId) { + const acc = decodeURIComponent(encAccount), id = decodeURIComponent(encId); + if ($('dumpAccount')) $('dumpAccount').value = acc; + if ($('dumpId')) $('dumpId').value = id; + dumpMessage(); + const el = $('dumpResult'); + if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }); +} + hunk ./sylk/applications/webrtcgateway/web.py 3180 - reset).""" + reset). + + When the drill-down reaches a full day (date_filter is + YYYY-MM-DD) the result also carries day_messages: that day's + messages (honouring the contact filter) sorted by timestamp, + without the message content, so the admin can see the individual + messages behind the type summary.""" hunk ./sylk/applications/webrtcgateway/web.py 3190 + day_messages = [] # per-message list, only when a full day is selected hunk ./sylk/applications/webrtcgateway/web.py 3193 + want_list = level == 10 hunk ./sylk/applications/webrtcgateway/web.py 3220 + if want_list: + msg_ts = str(get(message, 'msg_timestamp') or '') + day_messages.append({'message_id': get(message, 'message_id') or '', + 'created_at': created[:19], + 'timestamp': msg_ts[:19] or None, + 'direction': get(message, 'direction') or '', + 'contact': contact, + 'content_type': content_type, + 'state': get(message, 'state') or '', + 'disposition': list(get(message, 'disposition') or [])}) + # the day's messages, sorted by timestamp (created_at is the stored + # order and the table's clustering key, so it always exists) + day_messages.sort(key=lambda m: (m['created_at'], m['message_id'])) hunk ./sylk/applications/webrtcgateway/web.py 3239 + 'day_messages': day_messages if want_list else None,