From b2c5096744c99453856f7281251b3f0cb4b9baae Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 9 Nov 2026 05:22:14 +0000 Subject: dashboard: a subscribed node's message written out, read from it when shown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A subscribed node's messages come without being written out (their stream leaves the text out: up to 8 KiB each, 500 at a time), so the figures box said only when, both ends, type and size of one. Now the node answers for one message by its number, `GET /admin/dashboard/messages/own/{seq}` (`{"text": …}`, `404` once it isn't kept), which pages of other origins may call as they do its streams (`cors::open`), and the page reads it when the message is shown, with its narrow token, and keeps it on the message. Where it can't be read, the box says why. --- src/transport/traffic.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/transport/traffic.rs') diff --git a/src/transport/traffic.rs b/src/transport/traffic.rs index bac0da7..5ff588e 100644 --- a/src/transport/traffic.rs +++ b/src/transport/traffic.rs @@ -325,6 +325,16 @@ impl MessageLog { } /// The messages after `seq`, the latest `most` of them. + /// The message `seq` written out, while it is kept. + pub(crate) fn text_of(&self, seq: u64) -> Option { + let inner = self.inner.lock_or_recover(); + inner + .entries + .iter() + .find(|entry| entry.seq == seq) + .map(|entry| entry.text.clone()) + } + pub(crate) fn after(&self, seq: u64, most: usize) -> Vec { let inner = self.inner.lock_or_recover(); let newer: Vec<&Logged> = inner.entries.iter().filter(|e| e.seq > seq).collect(); -- cgit v1.3.1