Skip to content

Latest commit

 

History

History
170 lines (142 loc) · 7.14 KB

File metadata and controls

170 lines (142 loc) · 7.14 KB

UI Update Summary

✅ UI Has Been Fully Updated

The dashboard has been comprehensively updated to reflect all the new OCPI 2.2.1 simulator features.

📋 What's New in the UI

1. Statistics Overview Dashboard

  • Real-time counters for: Tokens, Sessions, CDRs, Commands
  • Auto-refreshes every 5 seconds
  • Visual status indicator (online/offline)

2. Enhanced Configuration Panel

  • ✅ CPO API URL
  • ✅ Bootstrap Token (Token A)
  • NEW: Party ID (3-letter code)
  • NEW: Country Code (2-letter code)

3. Discovery & Credentials Section

  • POST Credentials (Handshake)
  • GET Credentials
  • NEW: PUT Credentials (Token Rotation)
  • GET Versions
  • NEW: GET Details
  • GET Locations
  • Get Tariffs

4. Token Management Section (NEW)

  • Register Token: Full token creation with:
    • UID, Contract ID
    • Type selector (RFID, APP_USER, OTHER)
    • Whitelist selector (ALLOWED, ALWAYS, ALLOWED_OFFLINE, NEVER)
    • Valid checkbox
  • Update Token: Enable/Disable tokens
  • Query Token: Retrieve token details

5. Commands Section (NEW)

  • START_SESSION Command: Full command with:
    • Location ID, EVSE UID
    • Connector ID, Token UID
  • STOP_SESSION Command: Stop by Session ID
  • Unsupported commands shown as disabled (UNLOCK_CONNECTOR, RESERVE_NOW)

6. Sessions & CDRs Section

  • GET All Sessions
  • Get Session by ID
  • GET All CDRs
  • Get CDR by ID

7. Enhanced Logs & State Viewer

  • Tabs Interface: Switch between Logs and State view
  • Colored Logs:
    • 🟢 Success messages (green)
    • 🔵 Info messages (blue)
    • 🔴 Error messages (red)
  • State Viewer: View complete simulator state including all data
  • Clear Logs button
  • Auto-scroll to latest entries

🎨 UI Improvements

Feature Before After
Layout 2-column basic 3-column responsive grid
Stats None Real-time dashboard counters
Config 2 fields 4 fields (party_id, country_code)
Token Management ❌ Missing ✅ Full CRUD operations
Commands ❌ Basic ✅ Full command support
State Viewing ❌ Missing ✅ Complete state inspector
Log Styling Plain text Colored, categorized entries
Auto-refresh ❌ No ✅ Stats every 5 seconds
Tabs ❌ No ✅ Logs/State tabs

🚀 New UI API Endpoints

Configuration

  • GET /ui/config - Get current config (with party_id, country_code)
  • POST /ui/config - Update config

Discovery & Credentials

  • POST /ui/actions/credentials - Credentials exchange
  • POST /ui/actions/credentials/get - Get credentials
  • POST /ui/actions/credentials/rotate - Token rotation
  • POST /ui/actions/versions - Get versions
  • POST /ui/actions/details - Get details
  • POST /ui/actions/locations - Get locations
  • POST /ui/actions/tariffs - Get tariffs

Token Management

  • POST /ui/actions/tokens/register - Register new token
  • POST /ui/actions/tokens/update - Update token
  • POST /ui/actions/tokens/get - Get token details

Commands

  • POST /ui/actions/commands/start_session - START_SESSION command
  • POST /ui/actions/commands/stop_session - STOP_SESSION command

Sessions & CDRs

  • POST /ui/actions/sessions - Get all sessions
  • POST /ui/actions/sessions/get - Get session by ID
  • POST /ui/actions/cdrs - Get all CDRs
  • POST /ui/actions/cdrs/get - Get CDR by ID

State Viewing

  • GET /ui/state - Get complete simulator state
  • GET /ui/state/tokens - Get all tokens
  • GET /ui/state/sessions - Get all sessions
  • GET /ui/state/cdrs - Get all CDRs
  • GET /ui/state/commands - Get all commands

📱 Responsive Design

The new UI is fully responsive with:

  • 3-column grid layout for desktop
  • Collapses gracefully on smaller screens
  • Clean, modern design with consistent styling
  • Visual feedback for all actions
  • Color-coded log entries for easy scanning

🔧 Technical Improvements

  1. Better Error Handling: All API calls have proper error handling
  2. Loading States: Visual feedback during API calls
  3. Form Validation: Required field checks before API calls
  4. State Management: Cleaner state updates and refresh logic
  5. Performance: Efficient DOM updates for logs

📸 Screenshot Preview

┌─────────────────────────────────────────────────────────────┐
│  OCPI 2.2.1 EMSP Simulator Dashboard                        │
│  ┌─────┐ Status: Connected  [🔄 Refresh] [🗑️ Clear Logs] │
│  │ ●   │                                                    │
│  └─────┘                                                    │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐           │
│  │ Tokens  │ │Sessions │ │  CDRs   │ │Commands │           │
│  │   12    │ │   5     │ │   8     │ │   3     │           │
│  └─────────┘ └─────────┘ └─────────┘ └─────────┘           │
├──────────┬──────────┬───────────────────────────────────────┤
│ ⚙️ Config│🔍 Disc. │🎫 Token Management                   │
│ CPO URL  │POST Cred│ [Register Token Form]                 │
│ Bootstrap│GET Cred│ [Update Token Form]                  │
│ Party ID │PUT Cred│ [Query Token Form]                   │
│ Country  │Versions│                                        │
│ [Save]   │Details │                                        │
│          │Locations│🎮 Commands                            │
│          │Tariffs │[START_SESSION Form]                   │
│          │         │[STOP_SESSION Form]                    │
├──────────┴──────────┴───────────────────────────────────────┤
│ 📋 Logs │ 💾 State                                        │
│ [colored log output with timestamps]                       │
│ [View State]                                               │
└─────────────────────────────────────────────────────────────┘

✅ Verification

All UI updates have been verified:

  • ✅ UI routes compile without errors
  • ✅ All new endpoints implemented
  • ✅ Configuration fields added
  • ✅ Token management fully functional
  • ✅ Commands fully functional
  • ✅ State viewer working
  • ✅ Auto-refresh implemented

The UI is now fully aligned with all the OCPI 2.2.1 simulator features and provides a comprehensive testing interface!