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
| Property | Description | Default |
|---|---|---|
| Name | Node name shown in the editor. | "" |
| Group | Dashboard group the widget is placed in. | (required) |
| Size | Width and height in the group grid. | 0 / 0 |
| Fields | Values 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 Label | Text of the delete button and title of the confirmation dialog. Empty: Delete. | Delete |
| Confirm Text | Message of the confirmation dialog. Empty: the default. | This will permanently delete the selected session. Continue? |
| Configuration | Shows the button that opens the configuration stored with the session. | on |
| Config Label | Text of that button and title of its dialog. Empty: Configuration. | Configuration |
| Config Path | Path inside msg.payload of the configuration object. Empty: config. The button is disabled when there is no non-empty object at that path. | config |
| Download | Shows the download button. | on |
| Download Label | Text of the download button. Empty: Download. | Download |
| Formats | Entries of the download menu: Summary CSV, Pieces CSV and JSON. See Downloads. | all on |
| Separator | CSV separator: ; writes decimal commas, , decimal points. | ; |
| Sessions Dir | Folder 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 URL | Path 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 |
| Topic | msg.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.payload | Effect |
|---|---|
| object | The 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:
| Field | Use |
|---|---|
sessionId | Required for the downloads, made only of digits; otherwise the download fails with Invalid session. |
startTs | Start in milliseconds. Without it, startDate, then sessionId. |
endTs | End 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. |
configName | Configuration name. Without it, config when it is text, else config.name. |
totalCounter | Inspected pieces. |
tagCounter | { "OK": n, "NOK": n }. Without it, NOK is noClassCounter and OK the rest of totalCounter. |
noClassCounter | NOK pieces, when there is no tagCounter. |
errorCounter | Count per class, for example { "Scratch": 11 }, for the Classes section of the summary CSV. Only plain numbers are counted. |
param | Statistics 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:
{
"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 progresswhile the session runs), Duration and Configuration; Inspected pieces, OK and NOK with their percentage (for example14 (17,28%)), and Saved pieces; aClassessection with the count of eacherrorCounterentry; aParameterssection with the min, max, mean and count of eachparamfield, 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 perresumevalue, and per image type a<type> URLcolumn plus a<type> detectionscolumn (number of boxes) when some piece has boxes on that type. Theresumefieldsscore,minScore,resultandisAnomalousare named<model> · Score,<model> · Threshold,<model> · Resultand<model> · Anomalous; the others keep their dotted key. - Full data (JSON),
session_<sessionId>.json:{ "exportedAt", "session", "pieces" }.sessionis the session withstartTs,endTs,durationMs,activeandsavedPiecesadded;piecesholds every metadata file with itsclassDirand aurlon 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
| Message | Where | Cause |
|---|---|---|
Export failed for session <sessionId>: <reason> | node error | A download could not be built. |
Download failed: <reason> | widget, under the buttons | The 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:
// 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:
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