Skip to content

Commit bf8c768

Browse files
committed
feat: Enhance documentation with authentication details, per-device log level filtering, and routing features
1 parent b150ea4 commit bf8c768

10 files changed

Lines changed: 344 additions & 134 deletions

File tree

docs/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,20 @@ To understand the underlying concepts, read the **[Explanation](./explanation/)*
6161

6262
The PepperDash Essentials Web Config App provides several key features:
6363

64-
- **🔍 Debug Console**: Real-time log monitoring with filtering and search
65-
- **⚙️ Device Management**: Inspect and interact with connected devices
64+
- **� Authentication**: Secure login required before accessing any app data
65+
- **🔍 Debug Console**: Real-time log monitoring with per-device minimum log level filtering
66+
- **⚙️ Device Management**: Inspect and interact with connected devices
6667
- **📄 Configuration Viewer**: View and analyze merged configuration files
6768
- **📦 Version Information**: Check loaded assemblies and versions
69+
- **🔀 Routing**: Visual signal routing diagram between devices and tie lines
70+
- **📱 Mobile Control**: Mobile control interface management
71+
- **🗺️ API Paths**: Browse all available REST API routes on the processor
6872
- **🏷️ Type Registry**: Browse supported device types and their properties
6973

74+
## Multi-Application Support
75+
76+
The app supports up to 10 simultaneous PepperDash Essentials program slots (`app01` through `app10`). After logging in, available program slots are automatically discovered and populated in the application selector dropdown in the top navigation bar. Navigating between app slots does not require re-authentication.
77+
7078
## System Requirements
7179

7280
- Modern web browser (Chrome, Firefox, Safari, Edge)

docs/explanation/architecture.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,13 @@ The web application serves several specific roles within this ecosystem:
7878

7979
**State Management Strategy**:
8080
- **RTK Query**: Server state management and caching
81-
- **URL-based filters**: Filter state persisted in URL parameters
82-
- **Local component state**: UI-specific state like modals and selections
81+
- **Redux Toolkit**: Client state management for authentication, debug console filters, and UI state
82+
- `auth` slice: global authentication state and available app slot list
83+
- `debugConsole` slice: per-device minimum log level, checked device filters, and search text
84+
- `websocket` slice: WebSocket connection state and received log messages
85+
- `commonUi` slice: shared UI state such as the active room ID
86+
- **Local component state**: Transient UI state such as modals, drawer open/close, and form inputs
87+
- Filter state lives in Redux (not URL parameters) so selections are preserved when navigating between routes
8388

8489
### API Layer (RESTful Services)
8590

@@ -194,10 +199,20 @@ Framework Logging ──► Message Buffer ──► WebSocket ──► Client
194199

195200
### Authentication Model
196201

197-
**Processor-Based Security**:
198-
The web app leverages the processor's built-in security system:
202+
**Application-Level Authentication**:
203+
The web app implements its own credential-based authentication flow on top of the processor's built-in security:
199204

200-
- **No Independent Authentication**: Web app doesn't implement its own user system
205+
- **Login Form**: Users provide a username and password before accessing any app data
206+
- **Credential Validation**: Credentials are submitted to the processor via `POST /:appId/api/loginCredentials`
207+
- **Server-Side Single Auth**: The backend has one shared authentication mechanism regardless of which `appId` is used in the request
208+
- **Global Session**: A successful login with any app slot authenticates the session for all running app slots
209+
- **Redux Auth State**: `isAuthenticated` boolean and `availableApps` list are stored in Redux in-memory (resets on page reload)
210+
- **Route Protection**: A `RequireAuth` layout route wraps all `/:appId/*` sub-routes; unauthenticated requests are redirected to `/:appId/login`
211+
212+
**App Slot Discovery**:
213+
After credentials are validated, the application probes all 10 possible slots (`app01``app10`) in parallel using `Promise.allSettled`. Slots that respond successfully are stored as `availableApps` and populate the app selector dropdown in the top navigation bar.
214+
215+
**No Independent Authentication**: Web app doesn't implement its own persistent user system
201216
- **Processor Integration**: Uses whatever authentication the processor has configured
202217
- **Session Management**: Relies on processor's session handling
203218

docs/explanation/debug-console-design.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ The console presents information in layers, allowing users to start broad and na
2525
```
2626
All System Messages
2727
↓ (Filter by Device)
28-
Device-Specific Messages
29-
↓ (Filter by Level)
30-
Problem-Level Messages
28+
Device-Specific Messages
29+
↓ (Set Per-Device Minimum Level)
30+
Severity-Filtered Device Messages
3131
↓ (Text Search)
3232
Specific Event Messages
3333
↓ (Click for Details)
@@ -65,9 +65,10 @@ Complete Message Information
6565

6666
**Why Client-Side**:
6767
- **Responsive Filtering**: Filter changes apply instantly to existing messages
68-
- **Rich Interaction**: Complex filter combinations without server round-trips
68+
- **Rich Interaction**: Complex filter combinations (including per-device levels) without server round-trips
6969
- **Historical Analysis**: Can re-filter previously received messages
7070
- **Reduced Server Load**: Filtering computation happens in user's browser
71+
- **Persistent Across Navigation**: Filter state stored in Redux survives route changes within the same session
7172

7273
**Trade-offs Accepted**:
7374
- **Bandwidth Usage**: All messages transmitted even if filtered out
@@ -101,18 +102,17 @@ Messages use structured logging with both human-readable text and machine-readab
101102
### Filter Interface Design
102103

103104
**Multiple Filter Types**:
104-
The console provides three distinct filtering mechanisms:
105-
1. **Device Selection**: Who generated the message?
106-
2. **Log Level Selection**: How important is the message?
107-
3. **Text Search**: What specific content are you looking for?
108-
109-
**Why Multiple Types**:
110-
- **Different Mental Models**: Users think about problems in different ways
111-
- **Complementary Filtering**: Different filters answer different questions
112-
- **Flexible Workflow**: Users can apply filters in any order that makes sense
113-
114-
**Filter Combination Logic**:
115-
All filters use AND logic (all conditions must match)
105+
The console provides two distinct filtering mechanisms:
106+
1. **Device Selection with Per-Device Minimum Level**: Which devices to show, and what minimum severity to require per device
107+
2. **Text Search**: What specific content are you looking for?
108+
109+
**Per-Device Minimum Log Level**:
110+
Each device in the filter list can have its own minimum log level threshold, independent of the server-side global minimum. When a device is checked in the Devices dropdown, it defaults to `Information`. A nested level dropdown next to each checked device allows selecting a higher threshold (e.g. `Warning` or `Error`) to reduce noise from that specific device while keeping other devices at a lower threshold.
111+
112+
**Why Per-Device Rather Than Global-Only**:
113+
- **Precision**: A busy device generating many `Information` messages can be silenced at `Warning` while other devices remain visible at `Information`
114+
- **Context Preservation**: Keeps the context of multiple devices without overwhelming the view with one device's verbose output
115+
- **Flexible Workflow**: Useful when one device is suspected of issues and you want high verbosity from it, but low noise from everything else
116116

117117
**Why AND Logic**:
118118
- **Intuitive**: Matches mental model of "show me messages that are X AND Y AND Z"

docs/explanation/security.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,34 +90,21 @@ Web interface could be overwhelmed by requests:
9090

9191
### Authentication Model
9292

93-
**Certificate-Based Authentication**:
94-
The system relies on the processor's built-in authentication:
95-
- Client certificates validate user identity
96-
- Self-signed certificates common in internal deployments
97-
- Certificate trust requires explicit user acceptance
98-
- Certificate revocation through processor management
93+
**Credential-Based Authentication**:
94+
The web app implements a credential-based login flow that gates access to all application features:
95+
96+
- **Login Form**: Before any processor data is accessible, users must provide a username and password
97+
- **API Validation**: Credentials are submitted to `POST /cws/:appId/api/loginCredentials` on the processor
98+
- **Shared Authentication**: The processor backend uses a single authentication mechanism for all program slots — a successful login with any `appId` authenticates the entire session
99+
- **Global Session State**: Authentication state (`isAuthenticated: boolean`) is stored in Redux. A `RequireAuth` layout route protects all `/:appId/*` sub-routes and redirects unauthenticated users to the login page
100+
- **In-Memory Only**: The authentication state is not persisted to `localStorage` or cookies. Reloading the page requires re-authentication, providing natural session expiry
101+
- **App Discovery at Login**: After validating credentials, all 10 possible program slots are probed in parallel. Only slots that respond successfully are shown in the application selector
99102

100103
**Session Management**:
101-
Web sessions are managed securely:
102-
- Session tokens generated using cryptographically secure random numbers
103-
- Session data stored server-side, not in cookies
104-
- Automatic session expiration after inactivity
105-
- Session invalidation on logout or timeout
106-
107-
### Authorization Framework
108-
109-
**Role-Based Access Control**:
110-
Access is controlled through processor-level permissions:
111-
- **System Administrator**: Full access to all features and data
112-
- **Operator**: Read access to operational data and controls
113-
- **Viewer**: Read-only access to status and configuration information
114-
- **Guest**: Minimal access to basic system information
115-
116-
**Permission Inheritance**:
117-
Permissions are inherited from the processor's user management:
118-
- Web app does not maintain separate user database
119-
- Authorization decisions delegated to Essentials framework
120-
- Consistent access control across all system interfaces
104+
Web sessions are managed through the Redux store:
105+
- Session exists for the lifetime of the browser tab
106+
- Logging out (or reloading) resets all auth state
107+
- No session tokens are stored client-side beyond the duration of the session
121108

122109
## Data Protection
123110

docs/how-to/filter-debug-messages.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,33 @@
88

99
**For immediate results:**
1010
1. **Device filter**: Click "Devices" dropdown → Select specific devices
11-
2. **Log level filter**: Click "Log Level" dropdown → Select "Warning" and "Error" only
11+
2. **Per-device level**: Once a device is checked, use its inline level dropdown to set a minimum severity
1212
3. **Search box**: Type keywords related to your issue
13-
4. **Clear all**: Click "Clear" button to reset
13+
4. **Clear all**: Click "Clear Filters" button to reset all filters
14+
15+
## Understanding the Filter Controls
16+
17+
### Device Filter and Per-Device Minimum Level
18+
19+
The Devices dropdown combines two capabilities:
20+
21+
- **Checkbox per device**: Check a device to include its messages in the view
22+
- **Level dropdown per device**: When checked, each device gets an inline level dropdown defaulting to `Information`
23+
24+
**To show only warnings and above from a specific device**:
25+
1. Click the **Devices** dropdown
26+
2. Check the device
27+
3. Click its inline level dropdown and select **Warning**
28+
4. Messages from that device below `Warning` are now hidden
29+
30+
Multiple devices can each have different thresholds. For example:
31+
- `Display-Room1``Error` (only show errors from this noisy device)
32+
- `Codec-Main``Information` (show all normal activity)
33+
- Global → `Warning` (only warnings from system-level messages)
34+
35+
### Text Search
36+
37+
Type keywords in the search box to find messages whose rendered text, template, timestamp, or device key contains the term(s).
1438

1539
## Effective Search Strategies
1640

docs/reference/api-endpoints.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,42 @@
22

33
**Complete technical reference for all REST API endpoints used by the PepperDash Essentials Web Config App.**
44

5-
All API endpoints are accessed through the base path `/cws/app01/api` on the processor's HTTPS port (443).
5+
All API endpoints are accessed through the base path `/cws/:appId/api` where `:appId` is the program slot identifier (e.g. `app01` through `app10`).
66

77
## Base Configuration
88

9-
**Base URL**: `https://[processor-ip]/cws/app01/api`
9+
**Base URL**: `https://[processor-ip]/cws/:appId/api`
1010
**Protocol**: HTTPS only
11-
**Authentication**: None (uses processor's built-in web authentication)
11+
**Authentication**: Credential-based via `POST /loginCredentials` (see below)
1212
**Content-Type**: `application/json` for POST requests
1313
**Response Format**: JSON
1414

15+
## Authentication Endpoints
16+
17+
### Set Login Credentials
18+
**Purpose**: Authenticate with the processor. The backend uses a single shared authentication mechanism for all program slots.
19+
20+
```http
21+
POST /loginCredentials
22+
```
23+
24+
**Request Body**:
25+
```json
26+
{
27+
"username": "admin",
28+
"password": "yourpassword"
29+
}
30+
```
31+
32+
**Response**: `200 OK` (empty body) on success
33+
34+
**Notes**:
35+
- A successful response with any `appId` authenticates the session for all running slots
36+
- The app probes all 10 slots in parallel after initial auth to discover which are running
37+
- A `4xx` or network error indicates invalid credentials or that the slot is not running
38+
39+
---
40+
1541
## System Information Endpoints
1642

1743
### Get Versions
@@ -46,6 +72,42 @@ GET /versions
4672

4773
---
4874

75+
### Get API Paths
76+
**Purpose**: Retrieve all available REST API routes registered on the processor
77+
78+
```http
79+
GET /apiPaths
80+
```
81+
82+
**Response**:
83+
```json
84+
{
85+
"url": "https://192.168.1.100/cws/app01",
86+
"routes": [
87+
{
88+
"Name": "getDevices",
89+
"Url": "app01/api/devices",
90+
"DataTokens": { "Name": "getDevices" },
91+
"RouteHandler": null
92+
}
93+
]
94+
}
95+
```
96+
97+
**Response Fields**:
98+
- `url` (string): Base URL of the processor web server for this app slot
99+
- `routes` (array): List of route objects
100+
- `Name` (string): Route name
101+
- `Url` (string): Route URL relative to the base
102+
- `DataTokens.Name` (string): Data token name when present
103+
104+
**Usage**: Displayed on the API Paths page; routes are sorted alphabetically and shown with clickable URLs
105+
106+
**Error Conditions**:
107+
- `500`: Server error if route information cannot be retrieved
108+
109+
---
110+
49111
### Get Device Types
50112
**Purpose**: Retrieve all available device types supported by current plugins
51113

docs/reference/log-levels.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,41 @@
3737
- **Filtered out**: None
3838
- **Use case**: Deep debugging, code-level analysis
3939

40-
## Message Classification
40+
## Client-Side Filtering
41+
42+
### Per-Device Minimum Log Level Filter
43+
44+
Each device checked in the Debug Console Devices dropdown has its own minimum log level threshold. Messages from that device are only shown if they meet or exceed that device's threshold.
45+
46+
**Default**: `Information` when a device is first checked
47+
48+
**Severity comparison**: `LOG_LEVEL_ORDER[message.Level] >= LOG_LEVEL_ORDER[deviceMinLevel]`
49+
50+
where `LOG_LEVEL_ORDER` is:
51+
52+
| Level | Order Value |
53+
|-------|-------------|
54+
| Verbose | 0 |
55+
| Debug | 1 |
56+
| Information | 2 |
57+
| Warning | 3 |
58+
| Error | 4 |
59+
| Fatal | 5 |
60+
61+
**Example**: Device set to `Warning` — shows Warning, Error, Fatal; hides Information, Debug, Verbose
62+
63+
**State**: Stored in Redux `debugConsole.deviceLevels` as `Record<deviceId, levelName>`; persists across navigation within the session
64+
65+
### Filter Combination Logic
66+
67+
All client-side filters use AND logic:
68+
- **Device filter**: Message key must match a checked device (or `Global`)
69+
- **Per-device minimum level**: Message severity must meet the device's threshold
70+
- **Text search**: All search terms must appear somewhere in the message fields
71+
72+
### Server-Side Minimum Log Level
73+
74+
The **Minimum Log Level** dropdown in the Debug Console session panel sets the server-side floor for all messages the processor sends to the client. Messages below this level are never transmitted, regardless of the client-side per-device settings. This controls what the processor captures and streams, while per-device levels control what the client displays after receipt.
4175

4276
### System-Level Messages
4377

0 commit comments

Comments
 (0)