Skip to content

Session Details ​

The Session Details widget shows one session as a card: a grid of label and value fields read from msg.payload, a button that opens the configuration the session was started with, a download menu (summary CSV, pieces CSV and full JSON) and a delete button with a confirmation dialog. The node deletes nothing: when the user confirms, it sends a message and the flow does the deletion.

It is the details part of ui-sessions as a separate widget, fed by the flow, typically with the row clicked in a sessions table. ui-sessions-header and ui-sessions-images cover the image saving mode and the images of such a page.

Palette: category Monitor, label session details. 1 input, 1 output.

Configuration ​

PropertyDescriptionDefault
NameNode name shown in the editor.""
GroupDashboard group the widget is placed in.(required)
SizeWidth and height in the group grid.0 / 0
FieldsValues shown in the card. Each has a label, a value path inside msg.payload (dot notation, for example config.name), a format and a Hide empty box. Formats: text as is; number locale formatted with up to 2 decimals; date a millisecond timestamp as day/month/year hour:minute in the browser's time zone; duration milliseconds as 1 h 5 min 3 s. A value that cannot be converted is shown as is, a missing one as -. With Hide empty the field disappears when the session has no value for it. Rows with neither label nor path are dropped on save.Start date (startDate, date), Total (totalCounter, text)
Delete LabelText of the delete button and title of the confirmation dialog. Empty: Delete.Delete
Confirm TextMessage of the confirmation dialog. Empty: the default.This will permanently delete the selected session. Continue?
ConfigurationShows the button that opens the configuration stored with the session.on
Config LabelText of that button and title of its dialog. Empty: Configuration.Configuration
Config PathPath inside msg.payload of the configuration object. Empty: config. The button is disabled when there is no non-empty object at that path.config
DownloadShows the download button.on
Download LabelText of the download button. Empty: Download.Download
FormatsEntries of the download menu: Summary CSV, Pieces CSV and JSON. See Downloads.all on
SeparatorCSV separator: ; writes decimal commas, , decimal points.;
Sessions DirFolder on the Node-RED server with the saved pieces, <sessionId>/classes/<class>/<ts>.json. Read by the downloads. Empty: the default./opt/storage/images/sessions
Images URLPath under the Node-RED HTTP root (httpNodeRoot) where Sessions Dir is served, for the image links in the downloads. The node does not serve the folder: the Node-RED server must. Empty: the default.local/images/sessions
Topicmsg.topic of the delete message.delete-session

Config Label and Config Path are shown only with Configuration ticked; Download Label, Formats, Separator, Sessions Dir and Images URL only with Download ticked.

The configuration dialog has three tabs. Summary shows the plain values first, then one section per nested object or list. For a recipe, a configuration with an errors list or a format object, it shows instead the name, the creation date, the main format values, how many rules are active, and a table of the models per view built from the <view>_<kind>_model keys of format.models. Rules, present when errors is a non-empty list, shows each rule with its conditions and whether it is on (status not false). All lists every value by its path, with a search box.

Input ​

msg.payloadEffect
objectThe session to show. It replaces the previous one; the fields read their values from it and the downloads send it to the node.
"reset"Clears the card.

The node adds itself to the Accept Client Data list of the dashboard base, so a message that carries msg._client, such as the row click of a dashboard table, updates only the browser it came from. A message without it updates every connected browser, and is also kept for the browsers that load the page later.

The downloads read these fields of the session, when present:

FieldUse
sessionIdRequired for the downloads, made only of digits; otherwise the download fails with Invalid session.
startTsStart in milliseconds. Without it, startDate, then sessionId.
endTsEnd in milliseconds. null, or an endDate of En curso, marks a running session: End is In progress and the duration runs up to now. Without endTs, the end is the save time of the last saved piece.
configNameConfiguration name. Without it, config when it is text, else config.name.
totalCounterInspected pieces.
tagCounter{ "OK": n, "NOK": n }. Without it, NOK is noClassCounter and OK the rest of totalCounter.
noClassCounterNOK pieces, when there is no tagCounter.
errorCounterCount per class, for example { "Scratch": 11 }, for the Classes section of the summary CSV. Only plain numbers are counted.
paramStatistics per numeric result field, { "<model>.<field>": { min, max, mean, count } }, for the Parameters section of the summary CSV.

The pieces come from the metadata files the flow saved under Sessions Dir, one JSON file per saved piece next to its images. Their layout and fields are described in ui-sessions.

Output ​

When the user confirms the deletion, the node sends the session shown in the card:

json
{
  "topic": "delete-session",
  "payload": {
    "action": "delete-session",
    "session": { "sessionId": 1753600000000, "startDate": 1753600000000, "totalCounter": 1200 }
  }
}

msg.topic is the Topic property and payload.session the whole object received in msg.payload. The card of that browser is cleared; other browsers keep showing the session until the flow sends a new one or reset.

Downloads ​

The download menu lists the formats ticked in Formats. The node builds each file from the session shown in the card and from the metadata files of that session under Sessions Dir. Dates are written as dd/mm/yyyy hh:mm:ss in the browser's time zone, and decimals with the mark of Separator: a comma with ;, a point with ,. Image links are the dashboard address seen by the browser, followed by httpNodeRoot, Images URL, the session id, classes, the class and the file name.

  • Summary (CSV), session_<sessionId>_summary.csv: label and value lines without a header, in sections separated by a blank line. Session, Start, End (In progress while the session runs), Duration and Configuration; Inspected pieces, OK and NOK with their percentage (for example 14 (17,28%)), and Saved pieces; a Classes section with the count of each errorCounter entry; a Parameters section with the min, max, mean and count of each param field, or a single value when its min equals its max.
  • Pieces (CSV), session_<sessionId>_pieces.csv: one row per saved piece, oldest first. Columns: Date, Class, one per resume value, and per image type a <type> URL column plus a <type> detections column (number of boxes) when some piece has boxes on that type. The resume fields score, minScore, result and isAnomalous are named <model> · Score, <model> · Threshold, <model> · Result and <model> · Anomalous; the others keep their dotted key.
  • Full data (JSON), session_<sessionId>.json: { "exportedAt", "session", "pieces" }. session is the session with startTs, endTs, durationMs, active and savedPieces added; pieces holds every metadata file with its classDir and a url on each image.

The CSV files are UTF-8 with a byte order mark and CRLF line ends. Booleans are written Yes or No, objects as JSON. A value that looks like a number or a date starts with an invisible zero-width space, so spreadsheets keep it as text: every value stays left aligned and long ids keep all their digits.

Status and errors ​

MessageWhereCause
Export failed for session <sessionId>: <reason>node errorA download could not be built.
Download failed: <reason>widget, under the buttonsThe download request failed, for example Download failed: Invalid session.

HTTP endpoints ​

The downloads are built by the route POST /ui-session-details/<id>/export of the node, under the Node-RED HTTP root (httpNodeRoot), so the browser must reach it at the dashboard's address. <id> is the id of the node.

Usage example ​

A dashboard table lists the sessions and sends the clicked row as msg.payload. A function node between the table and this widget turns the row into the session object:

js
// msg.payload: the clicked row of the sessions table
const row = msg.payload;
msg.payload = {
    sessionId: Number(row.sessionId),
    startDate: Number(row.startDate),
    startTs: Number(row.startDate),
    endTs: row.endDate == null ? null : Number(row.endDate),
    configName: row.configName,
    totalCounter: row.totalCounter,
    noClassCounter: row.noClassCounter,
    tagCounter: JSON.parse(row.tagCounter || '{}'),     // { "OK": 1182, "NOK": 18 }
    errorCounter: JSON.parse(row.errorCounter || '{}'), // { "Scratch": 11, "Missing label": 7 }
    config: JSON.parse(row.config || 'null')
};
return msg;

The output goes to a function node that keeps only the deletions, removes the session row from the database and its folder, refreshes the table and clears the card:

js
if (msg.payload.action !== 'delete-session') return null;
msg.sessionId = msg.payload.session.sessionId;
return msg; // to the delete query; afterwards send "reset" to this widget