feat: add dynamic tray menu with connection status, transfer metrics, and toggle action

Add TrayState struct to track menu items for status, received/sent bytes, and connection toggle. Add format_data_size helper to convert bytes to human-readable units (B, KB, MB, GB, TB). Add current_metrics, update_tray_menu, refresh_tray_menu, and toggle_tray_connection functions to manage tray state. Update tray menu to include status, received, sent, and toggle items. Call refresh_tray_menu after enroll_device
This commit is contained in:
2026-03-18 08:45:06 +01:00
parent a87a4664be
commit cb79bdafbd
4 changed files with 162 additions and 18 deletions

View File

@@ -52,7 +52,7 @@ function currentProfileLabel(state: EnrollmentState | null) {
function formatDataSize(bytes: number) {
if (!bytes) {
return "0 MB";
return "0 B";
}
const units = ["B", "KB", "MB", "GB", "TB"];