51 Commits

Author SHA1 Message Date
agessaman
c6a7355b3c Enhance multibyte path statistics and UI in web viewer
- Added calculations for contacts and incoming packets with multibyte path evidence over the last 7 days in `app.py`, improving data accuracy.
- Introduced new methods for handling multibyte path chunks and counting packets from JSON data, enhancing backend functionality.
- Updated `contacts.html` and `index.html` templates to display multibyte path encoding badges and tooltips, improving user interface clarity.
- Enhanced CSS for path encoding badges to differentiate between multibyte and one-byte paths, ensuring better visual representation.

These changes improve the overall user experience and data representation in the Bot Data Viewer.
2026-04-03 20:27:00 -07:00
agessaman
f829c9e30b Update JSON placeholders in feeds.html and mesh.html for improved readability
- Changed single quotes to HTML entities in JSON placeholders within the feeds.html file to ensure proper rendering.
- Updated the assignment of PREFIX_HEX_CHARS in mesh.html to parse the value as an integer, enhancing type safety and clarity.

These changes enhance the user interface and code maintainability in the web viewer templates.
2026-04-03 11:36:33 -07:00
agessaman
4685ea734c Enhance contacts UI with mobile-friendly toolbar and search functionality
- Introduced a responsive toolbar for filtering and searching contacts, improving usability on mobile devices.
- Added a dropdown for timespan selection, allowing users to filter contacts based on different timeframes.
- Updated styles to ensure consistent alignment and height for toolbar elements, enhancing the overall appearance and functionality.

These changes improve the user experience for managing contacts in the web viewer.
2026-03-29 17:29:49 -07:00
agessaman
da2e39c6b9 Enhance mobile contact management UI and functionality
- Introduced a mobile-friendly layout for the contacts section, including a new mobile stack for displaying contact cards.
- Added sorting options for contacts on mobile devices, allowing users to sort by various criteria such as name, device type, and distance.
- Implemented a select-all checkbox for mobile view to improve user interaction with contact selection.
- Updated event listeners to handle changes in selection and sorting, ensuring a seamless experience across devices.

These changes improve usability and accessibility for mobile users in the web viewer.
2026-03-29 17:13:01 -07:00
agessaman
ae52be4d2b Enhance logging and UI elements in web viewer
- Added a function to strip ANSI color codes from log lines for better display in SocketIO web clients, improving log readability.
- Implemented dark mode styles for dropdown menus and other UI components to enhance user experience in dark theme.
- Updated the contacts template to include a new overflow menu for additional actions, improving accessibility and usability.
- Enhanced the login page with a more visually appealing layout and improved theme handling to prevent flash of unstyled content.
- Refined log level toggles in the logs template for better user interaction and visibility of log levels.

These changes improve the overall functionality and aesthetics of the web viewer.
2026-03-29 16:56:01 -07:00
agessaman
a2a121b4e7 Enhance API request headers across multiple templates
- Added 'X-Requested-With' header to various API requests in channel_operations.js, cache.html, config.html, contacts.html, feeds.html, greeter.html, mesh.html, radio.html, and other templates to improve request handling and prevent potential issues with cross-origin requests.
- Ensured consistent header usage across all relevant fetch calls to enhance security and compatibility.

These changes improve the robustness of API interactions within the web viewer.
2026-03-29 15:45:42 -07:00
agessaman
3a9f7103dc Update TODOs, enhance database management, and implement CSRF protection in web viewer
- Updated TODO.md with the latest status and coverage metrics.
- Added date and datetime adapters for SQLite in db_manager.py to improve date handling.
- Refactored repeater_manager.py to ensure atomic database operations within transactions, enhancing data integrity.
- Implemented CSRF protection and security headers in web_viewer/app.py to safeguard against cross-origin requests and improve response security.
- Enforced authentication for non-loopback interface binding in web_viewer/integration.py to prevent unauthorized access.

These changes enhance the overall security, reliability, and maintainability of the application.
2026-03-29 15:03:51 -07:00
agessaman
6246a81ab3 Enhance real-time message display and layout in web viewer
- Added new CSS styles for live message metadata badges and layout adjustments for better visual organization.
- Reorganized the HTML structure of the real-time message and packet stream sections for improved responsiveness and clarity.
- Updated JavaScript functions to support new channel key normalization and hashing for enhanced message handling.
- Modified test cases to reflect changes in message entry templates and ensure proper functionality of new features.
2026-03-21 22:07:43 -07:00
agessaman
5a04c1c971 Enhance channel management functionality in web viewer
- Updated `pyproject.toml` to include JavaScript files for the web viewer.
- Added a new script reference in `base.html` for channel operations.
- Improved the channel creation process in `feeds.html` with enhanced UI elements and error handling.
- Refactored channel index retrieval in `radio.html` to utilize a centralized method for better maintainability.
- Implemented asynchronous channel statistics loading to improve responsiveness during channel operations.
2026-03-21 20:44:58 -07:00
agessaman
e0fc2ac75a Enhance filter configuration with new date-based operators
- Introduced `within_days` and `within_weeks` operators for filtering items based on their timestamps, allowing for more dynamic date range conditions.
- Updated documentation in `FEEDS.md` to include examples and usage of the new operators.
- Refactored filter evaluation logic in `FeedManager` and `BotDataViewer` to utilize a shared function for condition checking, improving code maintainability.
- Added unit tests to validate the new date-based filtering functionality.
2026-03-21 20:44:54 -07:00
agessaman
6c1040db60 Refactor web viewer configuration and cache management
- Updated the web viewer documentation to replace the cache data section with a new config panel overview, enhancing clarity on configuration options.
- Removed the legacy cache management route, redirecting to the new configuration panel for better user experience.
- Enhanced the configuration page to include structured settings with categorized topics and database tools, improving navigation and usability.
- Updated tests to reflect changes in cache management and ensure proper functionality of the new configuration routes.
2026-03-21 10:43:25 -07:00
agessaman
116bd74882 Update project configuration and dependencies
- Expanded package data in `pyproject.toml` to include additional static files for the web viewer.
- Removed testing dependencies from `requirements.txt`, noting that they are now included in pyproject extras.
- Updated the base HTML template to reference the manifest from the Flask static folder.
- Modified the build script to exclude `.cursor` files and updated documentation URLs to the correct repository.
- Changed the installation command in the build script to use `requirements.txt` instead of the previous method.
2026-03-19 06:18:29 -07:00
Stacy Olivas
ad77d7b00d fix: BUG-025/026/027/028/029 implementations and ruff/mypy refinements
BUG-025: send_channel_message retry logic on no_event_received
BUG-026: split_text_into_chunks and chunked dispatch in message_handler
BUG-027: test_weekly_on_wrong_day_does_not_run patch uses fake_now
BUG-028: byte_data = b"" initialised before try in decode_meshcore_packet
BUG-029: app.py db_path via self._config_base; realtime.html socket race
  fixed; base.html forceNew removed; ping_timeout 5 to 20s

Additional: ruff and mypy refinements across all modules; discord bridge,
telegram bridge, rate limiter, and service plugin updates
2026-03-17 18:07:19 -07:00
Stacy Olivas
93f73a15a2 feat: web viewer — auth, contact management, live streaming, config, maintenance, and backup
Auth (BUG-001):
- Optional password via web_viewer_password in [Web_Viewer]; /login and
  /logout; Flask session guard on all routes and SocketIO handlers

Contact management and export:
- Star contacts of any type; purge-preview + purge inactive contacts
- GET /api/export/contacts and /api/export/paths: CSV/JSON with time-range

Config tab and maintenance:
- /config page: SMTP, log rotation, DB backup settings in bot_metadata
- Nightly email digest (uptime, contacts, DB size, log errors); SMTP
  timeout=30s; pre-rotation log attachment hook
- GET /api/maintenance/status: Maintenance Status card

DB backup, restore, and purge:
- POST /api/maintenance/backup_now; GET /api/maintenance/list_backups;
  POST /api/maintenance/restore (SQLite magic-byte validation)
- POST /api/maintenance/purge: remove rows older than threshold
- Scheduled backups: daily/weekly/manual with retention pruning
- Config save validates db_backup_dir exists; 400 on missing path

Live streaming and realtime monitoring:
- Live Activity panel: colour-coded SocketIO feed with pause/clear
- capture_channel_message() feeds packet_stream; message_data event
- /realtime page: three independent stream panels; [#channel] prefix
- /logs page: subscribe_logs/log_line; log-tail thread; level colouring
- History replay: last 50/50/200 items on connect
- Werkzeug 3.1 WebSocket fix: _apply_werkzeug_websocket_fix()
- BUG-029: db_path resolved via config_base = Path(config_path).parent;
  stored as self._config_base; dead _get_db_path() removed

Scroll/filter controls and connected agents:
- Scroll-to-top/bottom on Live Activity and all realtime panels
- Type-filter checkboxes (Packets/Commands/Messages) with applyFilters()
- GET /api/connected_clients: agent count clickable; Bootstrap modal
2026-03-17 18:07:18 -07:00
agessaman
6c8151389b Enhance MeshGraph edge promotion logic and update BotDataViewer API
- Updated the MeshGraph class to prevent promoting a 1-byte edge to a 3-byte edge when the existing 1-byte edge lacks public keys, ensuring accurate observation attribution.
- Added a new test case to verify the behavior of edge promotion under specific conditions.
- Modified the BotDataViewer API to return the prefix length dynamically based on the edges, improving data consistency and user experience in the web viewer.
- Enhanced the mesh.html template to support displaying prefix byte counts, providing clearer information on node connections.
2026-03-09 09:43:49 -07:00
agessaman
f57f480c9f Enhance MeshGraph and BotDataViewer for multi-byte support and improved edge handling
- Updated MeshGraph to support multi-resolution storage and node identity, allowing for better handling of 1-byte, 2-byte, and 3-byte edges.
- Implemented logic for merging and promoting edges based on observation counts and specificity.
- Enhanced BotDataViewer API to dynamically adjust prefix length based on configuration, improving data representation.
- Updated mesh.html template to display prefix byte counts, enhancing user experience with clearer information on node connections.
2026-03-06 16:57:57 -08:00
agessaman
a4d1f678cf Enhance path handling in BotDataViewer and ModernContactsManager
- Added support for bytes per hop in the BotDataViewer, allowing for better path data representation.
- Updated the contacts template to display bytes per hop and adjusted path formatting based on this value.
- Improved the decode path functionality to utilize the correct bytes per hop for decoding paths, enhancing overall path handling and user experience.
2026-03-06 10:02:45 -08:00
agessaman
4982ba482d Enhance mesh graph handling for multi-resolution prefix support
- Updated `MeshGraph` to support multi-resolution storage of edges, allowing prefixes of 2, 4, or 6 hex chars without truncation.
- Implemented prefix matching logic to ensure distinct links are maintained and accurately retrieved based on prefix queries.
- Refactored methods in `MessageHandler` and `PathCommand` to accommodate variable prefix lengths during graph lookups.
- Enhanced tests to validate prefix match functionality and edge management in the mesh graph.
2026-03-01 20:42:06 -08:00
Ian Rifkin
36a8a67543 Add transitional support for 2-byte prefixes while keeping legacy 1-byte compatibility
- Update prefix command to accept BOTH legacy 2-char prefixes and
  configured prefix_hex_chars (e.g. 4-char) during firmware transition
- Replace strict length validation with dual-length validation (2 or N)
- Ensure prefix lookups work with either input length via LIKE matching
- Update related SQL prefix extraction to use configured prefix length
- Add fallback handling in path parsing for legacy 2-char route data

Notes:
- This is an interim compatibility change to support mixed networks
  where RF path data is still 1-byte while bot config may be 2-byte.
- Needs additional testing across real multi-hop scenarios and mixed
  bot configurations.
- Translation updates are incomplete: only English strings were updated;
  other translation files still need review.
- Behavior and UX may need refinement after real-world testing.
2026-02-27 23:48:27 -05:00
agessaman
6dcf256c77 Simplify contact removal logic and add versioning to webviewer. 2026-02-19 19:39:32 -08:00
agessaman
c3a196e319 Update mesh and realtime templates for clarity
- Shortened the title in the mesh graph visualization from "Mesh Graph Visualization" to "Mesh Graph" for conciseness.
- Removed the subtitle from the real-time monitoring header to streamline the display.
2026-02-16 16:20:41 -08:00
agessaman
cd028a2160 Refactor NOAA period name handling in WxCommand and enhance bot configuration retrieval
- Replaced the `abbreviate_noaa` method calls with a new `_noaa_period_display_name` method to improve the display of forecast period names, including handling federal holidays.
- Updated the `BotDataViewer` class to include the bot name in the returned configuration dictionary, ensuring consistent naming across the application.
- Made minor adjustments to HTML templates for better layout and added footer links for project visibility.
2026-02-16 16:05:45 -08:00
agessaman
9fc0450727 fix: Improve bot uptime handling in web viewer
- Updated the logic for storing and displaying bot uptime to handle cases where the bot is not running or has no start time in the database, ensuring a more accurate representation of the bot's status.
- Enhanced the updateUptime method to provide clearer feedback when the bot is down, improving user experience.
- Refactored the live uptime counter to only run when valid uptime data is available, preventing unnecessary updates when the bot is inactive.
2026-02-11 21:25:58 -08:00
agessaman
a3dfef4901 feat: Update time filter options and improve UI for starred nodes
- Replaced the "Last 7 Days" option with "Last 48 Hours" and "Last 72 Hours" in both edge and node filters for better granularity.
- Enhanced the layout of the "Show Only Starred" checkbox for improved user experience.
- Introduced filtered node maps for efficient edge drawing, ensuring edges are only drawn between nodes within the selected timeframe.
2026-02-08 09:06:29 -08:00
agessaman
097c5a60dd feat: Implement bulk delete functionality for contacts
- Added a button for bulk deletion of selected contacts, enhancing user experience by allowing multiple contacts to be deleted at once.
- Introduced a checkbox for selecting all contacts on the current page, with corresponding updates to the bulk delete button visibility and count.
- Updated the contacts HTML template to accommodate the new bulk delete feature and improved layout for better usability.
- Enhanced the ModernContactsManager class to manage selected contact IDs and handle bulk delete actions effectively.
2026-02-07 22:08:12 -08:00
agessaman
0d54c702e8 feat: Enhance contact data retrieval with optional time filtering
- Updated the API endpoint to accept an optional query parameter `since` for filtering contact data based on the time frame (24h, 7d, 30d, 90d, or all).
- Modified the `_get_tracking_data` method to implement filtering logic based on the `since` parameter, improving performance by limiting the data retrieved.
- Enhanced the contacts HTML template to include a dropdown for selecting the time frame, with the default set to the last 30 days.
- Implemented local storage functionality to remember the user's selected time frame across sessions.
2026-02-07 21:56:22 -08:00
agessaman
5edf09f28f chore: Update configuration and documentation files
- Added '*.key' to .gitignore to prevent tracking of key files.
- Changed the default database path in config.ini.example from 'bot_data.db' to 'meshcore_bot.db' for clarity.
- Enhanced documentation files with front matter for better rendering and organization, including Discord Bridge, Feed Management, Map Uploader, Packet Capture, Path Command Configuration, Repeater Management Commands, and Weather Service.
2026-02-07 19:14:30 -08:00
agessaman
3c5057d92d feat: Enhance graph view synchronization and node rendering in web viewer
- Added functionality to synchronize the view with the URL hash, allowing direct access to the graph tab.
- Implemented event listeners for hash changes to switch between graph and map views seamlessly.
- Updated the loadData function to conditionally apply filters based on rendering options, improving performance during live updates.
- Enhanced node styling and interaction settings for better visual feedback and user experience in the graph view.
2026-01-30 20:38:36 -08:00
agessaman
ab1fe6d841 feat: Enhance node highlighting and styling in web viewer
- Introduced functionality to store and restore original styles for nodes, allowing for dynamic highlighting and shrinking of non-highlighted nodes.
- Implemented smooth zooming and fade animations for markers in the map view, improving user experience during interactions.
- Refactored node styling logic to ensure connected nodes maintain their size while non-connected nodes are significantly shrunk for better visibility.
- Enhanced the clearing of highlights to restore original styles effectively, ensuring a consistent visual state after interactions.
2026-01-27 22:08:37 -08:00
agessaman
1245ab9ce2 feat: Implement path sorting and rendering enhancements in contacts modal
- Added a new method to sort paths based on length, recency, or frequency, improving user experience in the contacts modal.
- Refactored path rendering logic into a separate method for better maintainability and readability.
- Introduced a dropdown for users to select their preferred sorting method, with the option saved in localStorage for persistence.
- Updated modal content to reflect the sorted paths and ensure accurate display of path data.
2026-01-27 16:13:19 -08:00
agessaman
df8dc8cafb feat: Enhance path selection and observation tracking
- Added new configuration options for path selection presets and proximity methods in config.ini.example, allowing users to customize routing behavior.
- Implemented a new database table for storing observed paths, enabling better tracking of paths from advertisements and messages.
- Updated MessageHandler to store complete paths in the observed_paths table, improving path validation and selection accuracy.
- Enhanced the PathCommand class to utilize new proximity and recency settings, optimizing repeater selection based on user-defined criteria.
- Improved web viewer functionality to display multiple paths for contacts, enhancing user experience and interaction with path data.
2026-01-25 10:12:46 -08:00
agessaman
bd2849655c feat: Enhance mesh graph functionality and path validation
- Added a new mesh graph feature for improved path validation, allowing for enhanced routing accuracy.
- Introduced configuration options for recency decay half-life and graph-based validation settings in config.ini.example.
- Updated the PathCommand class to utilize graph-based selection methods, combining graph and geographic scores for better repeater selection.
- Implemented new methods in MessageHandler to update the mesh graph with advertisement paths and trace packet data.
- Created a new database table for mesh connections to support graph-based path validation.
- Enhanced web viewer integration to display mesh graph updates in real-time, improving user interaction and monitoring capabilities.
2026-01-23 20:26:56 -08:00
agessaman
7984fa3af6 feat: Enhance command messaging with repeat tracking and transmission monitoring
- Updated `send_dm` and `send_channel_message` methods to include an optional `command_id` for tracking message repeats.
- Integrated transmission tracking to record and manage repeat messages, improving message handling and response accuracy.
- Enhanced `capture_command` method in `BotIntegration` to store repeat information for better analysis in the web viewer.
- Added favicon support and improved web viewer templates to display repeat information effectively.
- Implemented JavaScript updates in the web viewer to handle command updates and display repeat counts dynamically.
2026-01-11 20:30:02 -08:00
agessaman
106e7efca8 feat: Add light mode support for modal and UI elements in web viewer
- Implemented comprehensive light mode styles for various components in the web viewer, including modals, segment cards, and tables.
- Enhanced visual consistency by applying theme-based background and text colors across different UI elements.
- Updated styles for header and message content to ensure readability and aesthetic appeal in light mode.
2026-01-10 19:44:24 -08:00
agessaman
ca80924e38 feat: Enhance web viewer functionality and configuration options
- Updated `config.ini.example` to include a new option for additional hashtag channels to decode in the packet stream.
- Modified `BotDataViewer` to retrieve and display additional decode-only channels from the configuration.
- Improved packet handling in `message_handler.py` to capture full packet data for web viewer integration.
- Enhanced the web viewer's JavaScript to support detailed packet analysis and display, including color-coded hex breakdowns and improved user interface elements.
- Added new styles and scripts to the web viewer templates for better visual representation of packet data and improved user experience.
2026-01-10 16:39:07 -08:00
agessaman
f525d2e1d0 Enhance message handling and web viewer with path information support
- Updated MessageHandler to extract and store path information from packet_info and routing_info, improving data tracking.
- Added a new API endpoint in the web viewer for decoding path hex strings to repeater names.
- Enhanced the contacts template to display path information with tooltips, improving user experience.
- Implemented tooltip functionality for path data in the web viewer, allowing users to view detailed repeater information on hover.
2025-12-13 14:41:56 -08:00
agessaman
36b6746550 Enhance channel management and dark mode styling in web viewer. Update BotDataViewer to dynamically retrieve max channel limits from configuration, improving error messages for channel availability. Implement dark mode styles for modals, tables, and other UI elements across multiple templates, ensuring better contrast and readability. Update JavaScript logic in RadioManager to reflect dynamic channel limits and provide user feedback on available slots. 2025-12-06 19:03:55 -08:00
agessaman
183976e899 Add dark mode support across web viewer templates. 2025-12-06 12:35:58 -08:00
agessaman
ff1adf719e Implement bot reply rate calculations for 24-hour, 7-day, and 30-day time windows in the analytics. Update web viewer template to display these new reply rates and adjust JavaScript to handle the updated data structure. 2025-12-06 10:29:55 -08:00
agessaman
c151fba7a5 Enhance configuration and database management for feed and channel operations. Add channel refresh interval setting to config.ini.example, implement feed manager functionality with new database tables for feed subscriptions and activity tracking, and improve greeter command logic with human greeting detection and Levenshtein distance matching for user greetings. Update web viewer to include feed management pages and integrate global template variables for better user experience. 2025-12-06 10:18:12 -08:00
agessaman
4cc9cc4c9c Implement duplicate greeting cleanup and enhance greeter command logic. Add new API endpoints for greeter management and update web viewer to include greeter statistics. Improve error handling and logging for greeted users, ensuring unique entries in the database. 2025-12-02 21:15:40 -08:00
agessaman
71d157a974 Enhance command execution and analytics features. Update CommandManager to allow DM-only commands in public channels to silently ignore errors if the channel is not configured. Refactor BaseCommand to improve execution checks based on channel permissions. In the web viewer, add time window parameters for analytics in the database stats API, and implement Chart.js for visualizing activity trends over the last 30 days. Update dashboard templates to include time window selectors for top users, commands, paths, and channels, improving user experience and data accessibility. 2025-11-30 20:04:20 -08:00
agessaman
b1c39edbb8 Add contact deletion functionality to the API and UI. Implement a new endpoint for deleting contacts, including error handling and logging. Update the contacts management interface to include a delete confirmation modal and handle the deletion process, ensuring proper updates to the displayed contact list and statistics. 2025-11-30 16:37:35 -08:00
agessaman
82aa5ee160 Add greeter command configuration to config.ini.example and implement greeter functionality in message handling. Introduce favorite status management for repeaters, allowing users to toggle favorite status via API. Update path command and test command to incorporate favorite bias in scoring. Enhance database schema to support star status tracking for repeaters and roomservers. 2025-11-25 17:26:40 -08:00
agessaman
f162336d44 updated documentation about placeholders in responses, improvements to path data in webviewer 2025-11-11 20:18:01 -08:00
agessaman
72bc36f081 Enhance geocoding functionality and logging in RepeaterManager and BotDataViewer 2025-11-06 21:38:33 -08:00
agessaman
e114de7947 Implement companion contact purging and configurable recency/proximity weighting
- Added configuration options for companion contact purging, including thresholds for inactivity based on direct messages and advertisements.
- Enhanced the RepeaterManager to support automatic purging of companions when contact limits are exceeded.
- Updated PathCommand to utilize configurable recency/proximity weighting for improved path routing decisions.
- Introduced new commands for purging companions and updated existing commands to handle companion purging logic.
- Added API endpoint for manual geocoding of contacts and improved web viewer functionality for geocoding contacts.
2025-11-06 20:58:52 -08:00
agessaman
acd17621a6 Enhance RepeaterManager with daily advertisement tracking and statistics
- Added a new 'daily_stats' table for tracking daily advertisement statistics.
- Implemented methods to track daily advertisement counts and retrieve statistics over specified date ranges.
- Updated existing advertisement tracking logic to utilize the new daily statistics.
- Modified web viewer to display advertisement metrics using the new daily tracking data.
- Improved path command logic to prioritize database queries over API cache for path decoding.
2025-10-24 22:27:25 -07:00
agessaman
836af3341a - Renamed 'modern_tracking.html' to 'contacts.html' for clarity in web viewer.
- Updated routes in 'app.py' to reflect the new contacts template.
- Enhanced 'sports_command.py' adding support for additional Portland teams
- Improved game data fetching logic to check multiple dates for recent and upcoming games.
2025-10-22 21:49:12 -07:00
agessaman
2b9ee79f23 remove purging template stub 2025-10-21 22:07:50 -07:00