Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(desktop): sync traffic packets to message table #1791

Merged
merged 4 commits into from
Oct 31, 2024
Merged

Conversation

ysfscream
Copy link
Member

@ysfscream ysfscream commented Oct 30, 2024

This pull request includes significant changes to the traffic monitoring and metrics handling functionalities. The most important changes include adding new methods for traffic data retrieval and processing, updating the traffic monitoring UI, and refactoring utility functions for consistency and improved functionality.

Traffic Data Retrieval and Processing:

  • src/database/services/MessageService.ts: Added a new method getTrafficMessagesByConnection to retrieve traffic messages for a connection within a specified time range. This method processes and returns metrics data containing received and sent bytes.

Traffic Monitoring UI Enhancements:

  • src/views/viewer/TrafficMonitor.vue: Enhanced the traffic monitoring component to load and display traffic messages for the last 24 hours. Introduced methods to handle message storage and subscription to message queues. [1] [2]

Utility Functions Refactoring:

  • src/utils/systemTopic.ts: Refactored the getTrafficMetrics function to accept a default metrics model and updated the logic to use the message's creation time as the label.
  • src/utils/time.ts: Added a new method getDateBefore to get the date before a specified number of minutes. This method is used to calculate the start time for traffic data retrieval.

UI Components Update:

Localization and Text Updates:

  • src/lang/viewer.ts: Updated localization strings to provide more detailed descriptions for traffic monitoring tooltips and labels.

@ysfscream ysfscream added enhancement New feature or request feature This pr is a feature desktop MQTTX Desktop labels Oct 30, 2024
@ysfscream ysfscream added this to the v1.11.1 milestone Oct 30, 2024
@ysfscream ysfscream self-assigned this Oct 30, 2024
@Red-Asuka Red-Asuka merged commit c089173 into main Oct 31, 2024
4 checks passed
@Red-Asuka Red-Asuka deleted the ysf/desktop branch October 31, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop enhancement New feature or request feature This pr is a feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants