Commit Graph

16 Commits

Author SHA1 Message Date
openhands 5596f6eaf1 Fix duplicate ID issue and modal field population
- Fix duplicate protocol_type ID by renaming mapping-modal field to mapping_protocol_type
- Update populateModalFields to search for fields within modal context instead of globally
- Add debugging to show which fields are found in the modal
- Ensure protocol type and address fields are properly populated from discovery data
2025-11-11 18:34:37 +00:00
openhands add4952e74 Fix JavaScript errors and auto-populate issues
- Fix loadProtocolMappings reference error in dashboard.js by calling loadAllSignals()
- Add debugging to populateModalFields to identify field availability issues
- Ensure protocol mapping tab is activated before auto-populating from discovery
- Add delay to ensure tab content is loaded before attempting auto-population
2025-11-11 17:52:32 +00:00
openhands ece4952330 Fix discovery service integration and JavaScript execution issues
- Add simplified protocol signals table for discovery integration
- Add signal modal for discovery data population
- Fix JavaScript null element reference issues with fallback selectors
- Improve auto-populate function to work with both signal and mapping forms
- Add error handling for missing DOM elements
- Fix global function exposure for discovery integration
- Update template to include discovery-compatible UI elements
2025-11-11 17:35:41 +00:00
openhands 698c114609 Fix discovery scan button integration and add debugging
- Add event binding for discovery scan button
- Implement startDiscoveryScan method with proper UI updates
- Add comprehensive debug logging to track discovery flow
- Fix discovery results container detection
- Improve error handling and user feedback

Now the discovery workflow should work properly:
1. Click 'Start Discovery Scan' button
2. See progress status and results
3. Click 'Use This Signal' to populate form
4. Click 'Apply All as Protocol Signals' to create all
2025-11-09 14:30:50 +00:00
openhands a639e3159a Fix discovery to protocol mapping integration
- Fix global function references between discovery.js and protocol_mapping.js
- Add 'Apply All as Protocol Signals' functionality to discovery results
- Implement bulk signal creation from discovery results
- Add proper CSS styling for discovery results and notifications
- Expose key functions to global scope for cross-script communication
- Improve modal auto-population with better timing and error handling

Now discovery results properly:
- Populate the signal form when clicking 'Use This Signal'
- Create all signals at once when clicking 'Apply All as Protocol Signals'
- Show clear notifications for success/failure
- Refresh the protocol signals display automatically
2025-11-09 14:18:45 +00:00
openhands f0d6aca5ed Complete migration to simplified protocol signals architecture
- Replace complex ID system with intuitive signal name + tags approach
- Update main dashboard protocol mapping interface to use simplified system
- Add comprehensive API endpoints for protocol signals management
- Create simplified configuration manager and data models
- Implement discovery integration with auto-population of signal forms
- Add migration scripts and comprehensive test suite
- Update JavaScript files to use simplified system
- Create modern UI with filtering, tag cloud, and responsive design

Key improvements:
- Human-readable signal names instead of complex IDs
- Flexible tag-based categorization and filtering
- Seamless discovery to signal conversion
- Cleaner architecture with reduced complexity
- Better user experience and maintainability
2025-11-09 13:16:29 +00:00
openhands 04404674ee Fix protocol discovery modal integration and timing issues
- Add robust modal opening with multiple fallback methods
- Implement proper timing waits for modal and dropdown loading
- Add comprehensive logging for debugging
- Fix field population sequence and validation
- Add waitForStationsLoaded method to handle async dropdown loading
- Ensure all form fields are properly populated including mapping_id
- Set default database source based on device name

Co-authored-by: openhands <openhands@all-hands.dev>
2025-11-08 13:23:18 +00:00
openhands 87cc40a802 Fix protocol discovery form prefilling issues
- Update field IDs to match actual form (station_id, equipment_id, data_type_id)
- Add validation methods to check if metadata IDs exist
- Use actual sample metadata IDs instead of hardcoded defaults
- Fix station/equipment/data type dropdown population
- Update Apply All functionality to use real metadata
- Ensure discovery results properly prefill protocol mapping form

Co-authored-by: openhands <openhands@all-hands.dev>
2025-11-08 13:13:56 +00:00
openhands 86e92f6111 Improve protocol mappings UI with human-readable names
- Update displayProtocolMappings to show station/equipment/data type names from tag metadata
- Ensure tag metadata is loaded before displaying protocol mappings
- Update table headers to indicate Name & ID format
- Users now see descriptive names instead of raw IDs in the mappings table

Co-authored-by: openhands <openhands@all-hands.dev>
2025-11-08 11:20:04 +00:00
openhands 5a2cdc2324 Complete legacy system removal and tag metadata integration
- Remove legacy configuration classes: PumpStationConfig, PumpConfig, SafetyLimitsConfig
- Update ProtocolMapping model with tag metadata validators
- Replace text inputs with dropdowns in UI templates
- Add tag metadata loading functions to JavaScript
- Remove legacy API endpoints and add tag metadata endpoints
- Update security permissions to remove configure_safety_limits
- Clean up configuration manager and hardware discovery
- All integration tests pass successfully

Co-authored-by: openhands <openhands@all-hands.dev>
2025-11-08 10:31:36 +00:00
openhands d0433f45d2 Fix dashboard JavaScript errors and add favicon
- Fixed syntax error in dashboard.js (missing closing bracket for DOMContentLoaded)
- Added favicon.ico file to static directory
- Added favicon link to dashboard HTML template
- All JavaScript errors should now be resolved
- Dashboard should load without console errors
2025-11-07 07:58:15 +00:00
openhands d21804e3d9 feat: Implement protocol discovery service with auto-discovery capabilities
- Add ProtocolDiscoveryService with network scanning for all protocols
- Create discovery API endpoints for scan management and results
- Implement discovery UI components in dashboard
- Add comprehensive unit tests for discovery functionality
- Integrate discovery with configuration manager for automatic mapping creation
- Support background task execution for long-running discovery scans
- Include discovery status monitoring and recent discoveries endpoints
2025-11-04 10:01:28 +00:00
openhands 48a1a49384 Add comprehensive test suite for protocol mapping functionality
- Created 35 comprehensive tests covering ConfigurationManager, protocol validation, and database integration
- Added unit tests for ConfigurationManager with database persistence
- Added protocol-specific validation tests for all 4 protocols (Modbus TCP, Modbus RTU, OPC UA, REST API)
- Added integration tests for protocol server integration
- Enhanced existing API tests for protocol mapping endpoints
- Fixed database integration issues in ConfigurationManager
- Improved validation logic and error handling
- All tests passing with comprehensive coverage of Phase 1 functionality
2025-11-04 09:14:11 +00:00
openhands 90d3a650b0 feat: Add comprehensive signal overview and dashboard improvements
- Add Signal Overview tab with protocol statistics and signal table
- Fix button visibility issues with improved CSS styling
- Add preconfigured Grafana dashboard with system monitoring
- Add signal export functionality (CSV download)
- Add protocol statistics cards (Modbus, OPC UA, Profinet, REST)
- Add signal filtering and search capabilities
- Update dashboard provisioning for Grafana
- Add mock signal data for demonstration
2025-11-01 12:06:23 +00:00
openhands da82ab5d9f fix: Improve dashboard UI and add SCADA/hardware configuration
- Fix tab visibility issue with white-on-white background
- Add SCADA/Hardware configuration tab with comprehensive settings
- Add Modbus TCP configuration with port, slave ID, and baud rate
- Add OPC UA configuration with security mode options
- Add device mapping interface for SCADA device configuration
- Add SCADA status monitoring with connection details
- Add Prometheus authentication configuration (basic auth)
- Update JavaScript to handle new SCADA functionality
2025-11-01 11:12:12 +00:00
openhands 89a2ed8332 Add interactive dashboard with comprehensive testing
- Implemented web-based dashboard with tab-based interface
- Added configuration management with real-time validation
- Created system status monitoring and log viewing
- Implemented system actions (restart, backup, health checks)
- Added comprehensive test suite with 35 tests (100% passing)
- Integrated dashboard with existing REST API
- Added responsive design for mobile and desktop
- Implemented security validation and warnings
- Created comprehensive documentation

Features:
- Status monitoring with color-coded indicators
- Configuration management with web-based editor
- Real-time log viewing with filtering
- One-click system operations
- Mobile-responsive design
- Security validation for default credentials

Testing:
- 13 model tests for Pydantic data structures
- 8 validation tests for configuration logic
- 8 API endpoint tests for all dashboard routes
- 6 integration tests with REST API
- All 35 tests passing (100% success rate)

Access: http://localhost:8080/dashboard
2025-10-30 07:22:00 +00:00