@peers-app/peers-ui 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +8 -5
- package/babel.config.js +4 -4
- package/biome.json +191 -0
- package/dist/command-palette/command-palette-ui.d.ts +1 -2
- package/dist/command-palette/command-palette-ui.js +175 -244
- package/dist/command-palette/command-palette.js +65 -64
- package/dist/components/chat-overlay.d.ts +2 -2
- package/dist/components/chat-overlay.js +160 -217
- package/dist/components/checkbox.d.ts +5 -4
- package/dist/components/checkbox.js +4 -7
- package/dist/components/group-switcher.d.ts +1 -2
- package/dist/components/group-switcher.js +119 -159
- package/dist/components/input-date.d.ts +3 -3
- package/dist/components/input-date.js +6 -6
- package/dist/components/input-number.d.ts +7 -6
- package/dist/components/input-number.js +25 -20
- package/dist/components/input.d.ts +5 -4
- package/dist/components/input.js +4 -7
- package/dist/components/inverse-lazy-list.d.ts +3 -3
- package/dist/components/inverse-lazy-list.js +13 -47
- package/dist/components/io-schema-values.d.ts +5 -6
- package/dist/components/io-schema-values.js +28 -65
- package/dist/components/io-schema.d.ts +4 -5
- package/dist/components/io-schema.js +42 -79
- package/dist/components/lazy-list.d.ts +3 -3
- package/dist/components/lazy-list.js +38 -58
- package/dist/components/list-screen.d.ts +3 -8
- package/dist/components/list-screen.js +28 -23
- package/dist/components/loading-indicator.d.ts +1 -2
- package/dist/components/loading-indicator.js +2 -6
- package/dist/components/markdown-editor/autolink-plugin.js +5 -8
- package/dist/components/markdown-editor/editor-inline.d.ts +2 -3
- package/dist/components/markdown-editor/editor-inline.js +2 -6
- package/dist/components/markdown-editor/editor.d.ts +6 -6
- package/dist/components/markdown-editor/editor.js +9 -19
- package/dist/components/markdown-editor/markdown-plugin.d.ts +1 -1
- package/dist/components/markdown-editor/markdown-plugin.js +20 -21
- package/dist/components/markdown-editor/mention-node.d.ts +2 -2
- package/dist/components/markdown-editor/mention-node.js +24 -24
- package/dist/components/markdown-editor/mentions-plugin.d.ts +2 -2
- package/dist/components/markdown-editor/mentions-plugin.js +61 -62
- package/dist/components/markdown-editor/theme.js +28 -28
- package/dist/components/markdown-editor/toolbar.d.ts +2 -3
- package/dist/components/markdown-editor/toolbar.js +32 -49
- package/dist/components/markdown-with-mentions.d.ts +1 -1
- package/dist/components/markdown-with-mentions.js +43 -43
- package/dist/components/message-logs/message-logs.d.ts +1 -2
- package/dist/components/message-logs/message-logs.js +91 -116
- package/dist/components/messages/avatar.d.ts +3 -4
- package/dist/components/messages/avatar.js +37 -46
- package/dist/components/messages/channel-message-list.d.ts +5 -6
- package/dist/components/messages/channel-message-list.js +34 -34
- package/dist/components/messages/channel-view.d.ts +1 -2
- package/dist/components/messages/channel-view.js +23 -57
- package/dist/components/messages/message-compose.d.ts +3 -4
- package/dist/components/messages/message-compose.js +27 -38
- package/dist/components/messages/message-display.d.ts +2 -3
- package/dist/components/messages/message-display.js +42 -95
- package/dist/components/messages/thread-message-list.d.ts +4 -5
- package/dist/components/messages/thread-message-list.js +29 -29
- package/dist/components/router.d.ts +1 -2
- package/dist/components/router.js +58 -66
- package/dist/components/save-button.d.ts +3 -3
- package/dist/components/save-button.js +23 -33
- package/dist/components/sortable-list.d.ts +11 -12
- package/dist/components/sortable-list.js +42 -22
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +16 -47
- package/dist/components/tooltip.d.ts +4 -4
- package/dist/components/tooltip.js +4 -9
- package/dist/components/trust-level-badge.d.ts +2 -3
- package/dist/components/trust-level-badge.js +16 -16
- package/dist/components/trust-level-dropdown.d.ts +3 -4
- package/dist/components/trust-level-dropdown.js +32 -55
- package/dist/components/typeahead.d.ts +3 -3
- package/dist/components/typeahead.js +48 -89
- package/dist/components/voice-indicator.d.ts +2 -2
- package/dist/components/voice-indicator.js +93 -106
- package/dist/components/voice-subscribe-events.d.ts +32 -0
- package/dist/components/voice-subscribe-events.js +2 -0
- package/dist/globals.d.ts +3 -5
- package/dist/globals.js +22 -33
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +22 -12
- package/dist/hooks.test.js +129 -145
- package/dist/index.d.ts +9 -8
- package/dist/index.js +13 -12
- package/dist/mention-configs.d.ts +2 -2
- package/dist/mention-configs.js +55 -42
- package/dist/screens/assistants/assistant-config.d.ts +2 -3
- package/dist/screens/assistants/assistant-config.js +9 -22
- package/dist/screens/assistants/assistant-details.d.ts +1 -2
- package/dist/screens/assistants/assistant-details.js +13 -28
- package/dist/screens/assistants/assistant-info.d.ts +2 -3
- package/dist/screens/assistants/assistant-info.js +3 -17
- package/dist/screens/assistants/assistant-list.d.ts +1 -2
- package/dist/screens/assistants/assistant-list.js +15 -56
- package/dist/screens/assistants/assistant-tools.d.ts +2 -3
- package/dist/screens/assistants/assistant-tools.js +10 -24
- package/dist/screens/console-logs/console-logs-list.d.ts +1 -2
- package/dist/screens/console-logs/console-logs-list.js +130 -134
- package/dist/screens/console-logs/log-display.d.ts +2 -3
- package/dist/screens/console-logs/log-display.js +40 -42
- package/dist/screens/console-logs/log-filters.d.ts +1 -2
- package/dist/screens/console-logs/log-filters.js +2 -24
- package/dist/screens/console-logs/mobile-log-card.d.ts +2 -3
- package/dist/screens/console-logs/mobile-log-card.js +64 -67
- package/dist/screens/console-logs/resizable-table-header.d.ts +1 -2
- package/dist/screens/console-logs/resizable-table-header.js +31 -67
- package/dist/screens/contacts/contact-details.d.ts +1 -2
- package/dist/screens/contacts/contact-details.js +16 -46
- package/dist/screens/contacts/contact-list.d.ts +1 -2
- package/dist/screens/contacts/contact-list.js +44 -103
- package/dist/screens/contacts/index.d.ts +4 -4
- package/dist/screens/contacts/index.js +1 -1
- package/dist/screens/contacts/user-connect.d.ts +1 -2
- package/dist/screens/contacts/user-connect.js +85 -186
- package/dist/screens/data-explorer/data-explorer.d.ts +1 -2
- package/dist/screens/data-explorer/data-explorer.js +61 -181
- package/dist/screens/data-explorer/index.d.ts +2 -2
- package/dist/screens/data-explorer/query-executor.d.ts +1 -2
- package/dist/screens/data-explorer/query-executor.js +56 -166
- package/dist/screens/groups/group-details.d.ts +1 -2
- package/dist/screens/groups/group-details.js +27 -122
- package/dist/screens/groups/group-invite-listener.d.ts +2 -3
- package/dist/screens/groups/group-invite-listener.js +8 -104
- package/dist/screens/groups/group-list.d.ts +1 -2
- package/dist/screens/groups/group-list.js +56 -133
- package/dist/screens/groups/group-members.d.ts +2 -3
- package/dist/screens/groups/group-members.js +62 -132
- package/dist/screens/groups/index.d.ts +4 -4
- package/dist/screens/groups/index.js +1 -1
- package/dist/screens/join-group/index.d.ts +2 -2
- package/dist/screens/join-group/join-group.d.ts +1 -2
- package/dist/screens/join-group/join-group.js +9 -109
- package/dist/screens/network-viewer/connection-troubleshooter.d.ts +2 -3
- package/dist/screens/network-viewer/connection-troubleshooter.js +89 -193
- package/dist/screens/network-viewer/cpu-usage-graph.d.ts +1 -2
- package/dist/screens/network-viewer/cpu-usage-graph.js +60 -99
- package/dist/screens/network-viewer/device-details-modal.d.ts +1 -2
- package/dist/screens/network-viewer/device-details-modal.js +25 -177
- package/dist/screens/network-viewer/group-details-modal.d.ts +1 -2
- package/dist/screens/network-viewer/group-details-modal.js +31 -142
- package/dist/screens/network-viewer/index.d.ts +4 -4
- package/dist/screens/network-viewer/index.js +3 -3
- package/dist/screens/network-viewer/network-viewer-ipc.d.ts +22 -0
- package/dist/screens/network-viewer/network-viewer-ipc.js +6 -0
- package/dist/screens/network-viewer/network-viewer.d.ts +1 -2
- package/dist/screens/network-viewer/network-viewer.js +91 -296
- package/dist/screens/network-viewer/usage-graph.d.ts +1 -2
- package/dist/screens/network-viewer/usage-graph.js +78 -110
- package/dist/screens/packages/package-details.d.ts +1 -2
- package/dist/screens/packages/package-details.js +35 -41
- package/dist/screens/packages/package-info.d.ts +2 -2
- package/dist/screens/packages/package-info.js +33 -86
- package/dist/screens/packages/package-list.d.ts +1 -2
- package/dist/screens/packages/package-list.js +42 -106
- package/dist/screens/packages/package-new-local.d.ts +1 -2
- package/dist/screens/packages/package-new-local.js +13 -19
- package/dist/screens/packages/package-versions.d.ts +2 -3
- package/dist/screens/packages/package-versions.js +29 -96
- package/dist/screens/peer-types/peer-type-details.d.ts +3 -4
- package/dist/screens/peer-types/peer-type-details.js +26 -78
- package/dist/screens/peer-types/peer-type-list.d.ts +1 -2
- package/dist/screens/peer-types/peer-type-list.js +13 -24
- package/dist/screens/search/global-search.d.ts +1 -2
- package/dist/screens/search/global-search.js +104 -182
- package/dist/screens/settings/color-mode-dropdown.d.ts +3 -4
- package/dist/screens/settings/color-mode-dropdown.js +18 -37
- package/dist/screens/settings/settings-page.d.ts +1 -1
- package/dist/screens/settings/settings-page.js +86 -213
- package/dist/screens/settings/voice-settings-agent.d.ts +1 -1
- package/dist/screens/settings/voice-settings-agent.js +7 -44
- package/dist/screens/settings/voice-settings-api-keys.d.ts +2 -2
- package/dist/screens/settings/voice-settings-api-keys.js +2 -29
- package/dist/screens/settings/voice-settings-output.d.ts +2 -2
- package/dist/screens/settings/voice-settings-output.js +2 -40
- package/dist/screens/settings/voice-settings-providers.d.ts +2 -2
- package/dist/screens/settings/voice-settings-providers.js +2 -19
- package/dist/screens/settings/voice-settings-types.d.ts +4 -4
- package/dist/screens/settings/voice-settings-types.js +31 -31
- package/dist/screens/settings/voice-settings-wake-word.d.ts +2 -2
- package/dist/screens/settings/voice-settings-wake-word.js +2 -33
- package/dist/screens/settings/voice-settings.d.ts +1 -1
- package/dist/screens/settings/voice-settings.js +35 -112
- package/dist/screens/setup-user.d.ts +1 -2
- package/dist/screens/setup-user.js +38 -116
- package/dist/screens/tools/tool-code.d.ts +2 -3
- package/dist/screens/tools/tool-code.js +9 -13
- package/dist/screens/tools/tool-details.d.ts +1 -2
- package/dist/screens/tools/tool-details.js +26 -39
- package/dist/screens/tools/tool-info.d.ts +2 -3
- package/dist/screens/tools/tool-info.js +9 -48
- package/dist/screens/tools/tool-list.d.ts +1 -2
- package/dist/screens/tools/tool-list.js +33 -65
- package/dist/screens/tools/tool-schema.d.ts +2 -3
- package/dist/screens/tools/tool-schema.js +2 -13
- package/dist/screens/tools/tool-test-details.d.ts +1 -2
- package/dist/screens/tools/tool-test-details.js +12 -28
- package/dist/screens/tools/tool-test-list.d.ts +1 -2
- package/dist/screens/tools/tool-test-list.js +17 -56
- package/dist/screens/variables/variable-details.d.ts +1 -2
- package/dist/screens/variables/variable-details.js +19 -86
- package/dist/screens/variables/variable-list.d.ts +1 -2
- package/dist/screens/variables/variable-list.js +16 -27
- package/dist/screens/welcome-modal.d.ts +1 -2
- package/dist/screens/welcome-modal.js +44 -111
- package/dist/screens/workflows/workflow-details.d.ts +1 -2
- package/dist/screens/workflows/workflow-details.js +17 -31
- package/dist/screens/workflows/workflow-info.d.ts +2 -3
- package/dist/screens/workflows/workflow-info.js +2 -9
- package/dist/screens/workflows/workflow-instructions.d.ts +2 -3
- package/dist/screens/workflows/workflow-instructions.js +23 -55
- package/dist/screens/workflows/workflow-list.d.ts +1 -2
- package/dist/screens/workflows/workflow-list.js +23 -62
- package/dist/setupTests.d.ts +1 -1
- package/dist/setupTests.js +10 -11
- package/dist/system-apps/assistants.app.d.ts +1 -1
- package/dist/system-apps/assistants.app.js +3 -3
- package/dist/system-apps/console-logs.app.d.ts +1 -1
- package/dist/system-apps/console-logs.app.js +3 -3
- package/dist/system-apps/contacts.app.d.ts +1 -1
- package/dist/system-apps/contacts.app.js +4 -4
- package/dist/system-apps/data-explorer.app.d.ts +1 -1
- package/dist/system-apps/data-explorer.app.js +4 -4
- package/dist/system-apps/groups.app.d.ts +1 -1
- package/dist/system-apps/groups.app.js +4 -4
- package/dist/system-apps/index.d.ts +17 -17
- package/dist/system-apps/index.js +52 -52
- package/dist/system-apps/join-group.app.d.ts +1 -1
- package/dist/system-apps/join-group.app.js +4 -4
- package/dist/system-apps/mobile-settings.app.d.ts +1 -1
- package/dist/system-apps/mobile-settings.app.js +3 -3
- package/dist/system-apps/network-viewer.app.d.ts +1 -1
- package/dist/system-apps/network-viewer.app.js +4 -4
- package/dist/system-apps/packages.app.d.ts +1 -1
- package/dist/system-apps/packages.app.js +3 -3
- package/dist/system-apps/search.app.d.ts +1 -1
- package/dist/system-apps/search.app.js +4 -4
- package/dist/system-apps/settings.app.d.ts +1 -1
- package/dist/system-apps/settings.app.js +3 -3
- package/dist/system-apps/threads.app.d.ts +1 -1
- package/dist/system-apps/threads.app.js +3 -3
- package/dist/system-apps/tools.app.d.ts +1 -1
- package/dist/system-apps/tools.app.js +3 -3
- package/dist/system-apps/types.app.d.ts +1 -1
- package/dist/system-apps/types.app.js +3 -3
- package/dist/system-apps/variables.app.d.ts +1 -1
- package/dist/system-apps/variables.app.js +3 -3
- package/dist/system-apps/workflows.app.d.ts +1 -1
- package/dist/system-apps/workflows.app.js +3 -3
- package/dist/tabs-layout/tabs-layout.d.ts +2 -3
- package/dist/tabs-layout/tabs-layout.js +215 -246
- package/dist/tabs-layout/tabs-state.d.ts +2 -2
- package/dist/tabs-layout/tabs-state.js +73 -61
- package/dist/ui-defaults/index.d.ts +2 -2
- package/dist/ui-defaults/list-screen.d.ts +2 -3
- package/dist/ui-defaults/list-screen.js +33 -37
- package/dist/ui-defaults/markdown-field.js +24 -56
- package/dist/ui-router/routes-loader.d.ts +1 -1
- package/dist/ui-router/routes-loader.js +17 -13
- package/dist/ui-router/ui-loader.d.ts +6 -6
- package/dist/ui-router/ui-loader.js +172 -268
- package/dist/utils.js +49 -39
- package/jest.config.js +16 -16
- package/package.json +16 -14
- package/src/command-palette/command-palette-ui.tsx +261 -237
- package/src/command-palette/command-palette.ts +81 -78
- package/src/components/chat-overlay.tsx +366 -261
- package/src/components/checkbox.tsx +15 -12
- package/src/components/group-switcher.tsx +150 -105
- package/src/components/input-date.tsx +17 -16
- package/src/components/input-number.tsx +47 -31
- package/src/components/input.tsx +15 -12
- package/src/components/inverse-lazy-list.tsx +14 -13
- package/src/components/io-schema-values.tsx +51 -69
- package/src/components/io-schema.tsx +94 -69
- package/src/components/lazy-list.tsx +51 -34
- package/src/components/list-screen.tsx +51 -35
- package/src/components/loading-indicator.tsx +2 -4
- package/src/components/markdown-editor/autolink-plugin.tsx +4 -11
- package/src/components/markdown-editor/editor-inline.tsx +3 -4
- package/src/components/markdown-editor/editor.tsx +53 -51
- package/src/components/markdown-editor/markdown-plugin.tsx +48 -40
- package/src/components/markdown-editor/mention-node.ts +39 -38
- package/src/components/markdown-editor/mentions-plugin.tsx +99 -101
- package/src/components/markdown-editor/theme.ts +28 -29
- package/src/components/markdown-editor/toolbar.tsx +53 -47
- package/src/components/markdown-with-mentions.tsx +56 -46
- package/src/components/message-logs/message-logs.tsx +225 -165
- package/src/components/messages/avatar.tsx +70 -52
- package/src/components/messages/channel-message-list.tsx +80 -68
- package/src/components/messages/channel-view.tsx +34 -33
- package/src/components/messages/message-compose.tsx +84 -67
- package/src/components/messages/message-display.tsx +103 -89
- package/src/components/messages/thread-message-list.tsx +53 -44
- package/src/components/router.tsx +42 -43
- package/src/components/save-button.tsx +43 -39
- package/src/components/sortable-list.tsx +77 -49
- package/src/components/tabs.tsx +31 -31
- package/src/components/tooltip.tsx +21 -28
- package/src/components/trust-level-badge.tsx +15 -11
- package/src/components/trust-level-dropdown.tsx +49 -19
- package/src/components/typeahead.tsx +57 -59
- package/src/components/voice-indicator.tsx +158 -141
- package/src/components/voice-subscribe-events.ts +20 -0
- package/src/globals.tsx +42 -40
- package/src/hooks.test.tsx +141 -134
- package/src/hooks.ts +80 -48
- package/src/index.tsx +17 -10
- package/src/mention-configs.ts +122 -68
- package/src/screens/assistants/assistant-config.tsx +28 -18
- package/src/screens/assistants/assistant-details.tsx +35 -36
- package/src/screens/assistants/assistant-info.tsx +16 -11
- package/src/screens/assistants/assistant-list.tsx +37 -34
- package/src/screens/assistants/assistant-tools.tsx +41 -20
- package/src/screens/console-logs/console-logs-list.tsx +173 -140
- package/src/screens/console-logs/log-display.tsx +65 -38
- package/src/screens/console-logs/log-filters.tsx +4 -3
- package/src/screens/console-logs/mobile-log-card.tsx +78 -71
- package/src/screens/console-logs/resizable-table-header.tsx +29 -21
- package/src/screens/contacts/contact-details.tsx +29 -30
- package/src/screens/contacts/contact-list.tsx +71 -60
- package/src/screens/contacts/index.ts +5 -5
- package/src/screens/contacts/user-connect.tsx +177 -171
- package/src/screens/data-explorer/data-explorer.tsx +134 -98
- package/src/screens/data-explorer/index.ts +2 -3
- package/src/screens/data-explorer/query-executor.tsx +90 -80
- package/src/screens/groups/group-details.tsx +120 -101
- package/src/screens/groups/group-invite-listener.tsx +34 -37
- package/src/screens/groups/group-list.tsx +119 -103
- package/src/screens/groups/group-members.tsx +225 -164
- package/src/screens/groups/index.ts +5 -6
- package/src/screens/join-group/index.ts +2 -2
- package/src/screens/join-group/join-group.tsx +41 -39
- package/src/screens/network-viewer/connection-troubleshooter.tsx +145 -104
- package/src/screens/network-viewer/cpu-usage-graph.tsx +39 -43
- package/src/screens/network-viewer/device-details-modal.tsx +46 -59
- package/src/screens/network-viewer/group-details-modal.tsx +68 -49
- package/src/screens/network-viewer/index.ts +4 -5
- package/src/screens/network-viewer/network-viewer-ipc.ts +23 -0
- package/src/screens/network-viewer/network-viewer.tsx +261 -236
- package/src/screens/network-viewer/usage-graph.tsx +57 -49
- package/src/screens/packages/package-details.tsx +43 -35
- package/src/screens/packages/package-info.tsx +107 -66
- package/src/screens/packages/package-list.tsx +175 -98
- package/src/screens/packages/package-new-local.tsx +28 -26
- package/src/screens/packages/package-versions.tsx +102 -77
- package/src/screens/peer-types/peer-type-details.tsx +60 -50
- package/src/screens/peer-types/peer-type-list.tsx +20 -30
- package/src/screens/search/global-search.tsx +153 -137
- package/src/screens/settings/color-mode-dropdown.tsx +52 -35
- package/src/screens/settings/settings-page.tsx +215 -141
- package/src/screens/settings/voice-settings-agent.tsx +13 -12
- package/src/screens/settings/voice-settings-api-keys.tsx +14 -12
- package/src/screens/settings/voice-settings-output.tsx +12 -11
- package/src/screens/settings/voice-settings-providers.tsx +7 -3
- package/src/screens/settings/voice-settings-types.ts +52 -49
- package/src/screens/settings/voice-settings-wake-word.tsx +25 -9
- package/src/screens/settings/voice-settings.tsx +66 -43
- package/src/screens/setup-user.tsx +88 -41
- package/src/screens/tools/tool-code.tsx +12 -17
- package/src/screens/tools/tool-details.tsx +28 -28
- package/src/screens/tools/tool-info.tsx +14 -19
- package/src/screens/tools/tool-list.tsx +58 -40
- package/src/screens/tools/tool-schema.tsx +16 -9
- package/src/screens/tools/tool-test-details.tsx +11 -22
- package/src/screens/tools/tool-test-list.tsx +29 -30
- package/src/screens/variables/variable-details.tsx +63 -51
- package/src/screens/variables/variable-list.tsx +29 -30
- package/src/screens/welcome-modal.tsx +68 -48
- package/src/screens/workflows/workflow-details.tsx +40 -30
- package/src/screens/workflows/workflow-info.tsx +4 -11
- package/src/screens/workflows/workflow-instructions.tsx +35 -28
- package/src/screens/workflows/workflow-list.tsx +50 -40
- package/src/setupTests.ts +14 -13
- package/src/system-apps/assistants.app.ts +5 -5
- package/src/system-apps/console-logs.app.ts +4 -4
- package/src/system-apps/contacts.app.ts +6 -6
- package/src/system-apps/data-explorer.app.ts +5 -5
- package/src/system-apps/groups.app.ts +6 -6
- package/src/system-apps/index.ts +49 -49
- package/src/system-apps/join-group.app.ts +5 -5
- package/src/system-apps/mobile-settings.app.ts +4 -5
- package/src/system-apps/network-viewer.app.ts +5 -5
- package/src/system-apps/packages.app.ts +5 -5
- package/src/system-apps/search.app.ts +6 -6
- package/src/system-apps/settings.app.ts +5 -5
- package/src/system-apps/threads.app.ts +5 -5
- package/src/system-apps/tools.app.ts +5 -5
- package/src/system-apps/types.app.ts +5 -5
- package/src/system-apps/variables.app.ts +5 -5
- package/src/system-apps/workflows.app.ts +5 -5
- package/src/tabs-layout/tabs-layout.tsx +345 -254
- package/src/tabs-layout/tabs-state.ts +100 -81
- package/src/ui-defaults/index.ts +2 -3
- package/src/ui-defaults/list-screen.tsx +45 -40
- package/src/ui-defaults/markdown-field.tsx +22 -26
- package/src/ui-router/routes-loader.ts +40 -24
- package/src/ui-router/ui-loader.tsx +312 -214
- package/src/utils.ts +68 -81
- package/tsconfig.json +5 -10
- package/dist/components/input-datetime.d.ts +0 -7
- package/dist/components/input-datetime.js +0 -35
- package/dist/components/lazy-sortable-list.d.ts +0 -29
- package/dist/components/lazy-sortable-list.js +0 -12
- package/dist/components/left-bar.d.ts +0 -5
- package/dist/components/left-bar.js +0 -207
- package/dist/components/main-content-container.d.ts +0 -2
- package/dist/components/main-content-container.js +0 -92
- package/dist/components/messages/thread-view.d.ts +0 -6
- package/dist/components/messages/thread-view.js +0 -174
- package/dist/components/off-canvas.d.ts +0 -13
- package/dist/components/off-canvas.js +0 -89
- package/dist/components/text-list-editor.tsx/text-list-editor.d.ts +0 -6
- package/dist/components/text-list-editor.tsx/text-list-editor.js +0 -13
- package/dist/components/top-bar.d.ts +0 -2
- package/dist/components/top-bar.js +0 -51
- package/dist/components/typeahead/mentions-plugin.d.ts +0 -7
- package/dist/components/typeahead/mentions-plugin.js +0 -203
- package/dist/components/typeahead/typeahead-editor.d.ts +0 -15
- package/dist/components/typeahead/typeahead-editor.js +0 -134
- package/dist/components/typeahead/typeahead.d.ts +0 -12
- package/dist/components/typeahead/typeahead.js +0 -94
- package/dist/screens/profile.d.ts +0 -2
- package/dist/screens/profile.js +0 -76
- package/src/components/input-datetime.tsx +0 -41
- package/src/components/lazy-sortable-list.tsx +0 -51
- package/src/components/left-bar.tsx +0 -322
- package/src/components/main-content-container.tsx +0 -79
- package/src/components/messages/thread-view.tsx +0 -214
- package/src/components/off-canvas.tsx +0 -83
- package/src/components/text-list-editor.tsx/text-list-editor.tsx +0 -13
- package/src/components/top-bar.tsx +0 -119
- package/src/components/typeahead/mentions-plugin.tsx +0 -265
- package/src/components/typeahead/typeahead-editor.tsx +0 -140
- package/src/components/typeahead/typeahead.tsx +0 -77
- package/src/screens/profile.tsx +0 -75
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { LoadingIndicator } from
|
|
4
|
-
import { TrustLevelBadge } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { TrustLevel } from "@peers-app/peers-sdk";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { LoadingIndicator } from "../../components/loading-indicator";
|
|
4
|
+
import { TrustLevelBadge } from "../../components/trust-level-badge";
|
|
5
|
+
import { isDesktop } from "../../globals";
|
|
6
|
+
import { registerInternalPeersUI } from "../../ui-router/ui-loader";
|
|
7
|
+
import { ConnectionTroubleshooter } from "./connection-troubleshooter";
|
|
8
|
+
import { DeviceDetailsModal } from "./device-details-modal";
|
|
9
|
+
import { GroupDetailsModal } from "./group-details-modal";
|
|
10
|
+
import { getNetworkViewerApi } from "./network-viewer-ipc";
|
|
11
|
+
import { UsageGraph } from "./usage-graph";
|
|
11
12
|
|
|
12
13
|
/** Format bytes to human-readable string (KB, MB, GB) */
|
|
13
14
|
function formatBytes(bytes: number): string {
|
|
@@ -19,7 +20,7 @@ function formatBytes(bytes: number): string {
|
|
|
19
20
|
|
|
20
21
|
/** Format transfer rate to human-readable string (KB/s or MB/s) */
|
|
21
22
|
function formatRate(mbps: number | undefined): string {
|
|
22
|
-
if (mbps === undefined || mbps === 0) return
|
|
23
|
+
if (mbps === undefined || mbps === 0) return "0 KB/s";
|
|
23
24
|
// Show KB/s if less than 0.1 MB/s (100 KB/s)
|
|
24
25
|
if (mbps < 0.1) {
|
|
25
26
|
const kbps = mbps * 1024;
|
|
@@ -54,10 +55,10 @@ interface IConnectionInfo {
|
|
|
54
55
|
deviceName?: string;
|
|
55
56
|
userTrustLevel: number;
|
|
56
57
|
deviceTrustLevel: number;
|
|
57
|
-
connectionState:
|
|
58
|
+
connectionState: "connected" | "syncing" | "idle";
|
|
58
59
|
sharedGroups: string[];
|
|
59
|
-
roles:
|
|
60
|
-
pathType:
|
|
60
|
+
roles: Record<string, unknown>;
|
|
61
|
+
pathType: "direct" | "indirect" | "unknown";
|
|
61
62
|
throughDeviceIds?: string[];
|
|
62
63
|
latencyMs: number;
|
|
63
64
|
errorRate: number;
|
|
@@ -110,12 +111,12 @@ export function NetworkViewerList() {
|
|
|
110
111
|
const [connecting, setConnecting] = useState<Set<string>>(new Set());
|
|
111
112
|
const [showTroubleshooter, setShowTroubleshooter] = useState(false);
|
|
112
113
|
|
|
113
|
-
const loadData = async () => {
|
|
114
|
+
const loadData = useCallback(async () => {
|
|
114
115
|
try {
|
|
115
|
-
if (!isDesktop) return;
|
|
116
|
-
const api = (
|
|
116
|
+
if (!isDesktop()) return;
|
|
117
|
+
const api = getNetworkViewerApi();
|
|
117
118
|
if (!api) {
|
|
118
|
-
console.warn(
|
|
119
|
+
console.warn("Network Viewer API not available");
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -123,48 +124,48 @@ export function NetworkViewerList() {
|
|
|
123
124
|
api.getOverview(),
|
|
124
125
|
api.getConnections(),
|
|
125
126
|
api.getGroupSyncStatus(),
|
|
126
|
-
api.getDisconnectedDevices()
|
|
127
|
+
api.getDisconnectedDevices(),
|
|
127
128
|
]);
|
|
128
129
|
|
|
129
|
-
setOverview(overviewData);
|
|
130
|
-
setConnections(connectionsData);
|
|
131
|
-
setGroupSyncInfo(groupSyncData);
|
|
132
|
-
setDisconnectedDevices(disconnectedData);
|
|
130
|
+
setOverview(overviewData as INetworkOverview);
|
|
131
|
+
setConnections(connectionsData as IConnectionInfo[]);
|
|
132
|
+
setGroupSyncInfo(groupSyncData as IGroupSyncInfo[]);
|
|
133
|
+
setDisconnectedDevices(disconnectedData as IDisconnectedDevice[]);
|
|
133
134
|
} catch (error) {
|
|
134
|
-
console.error(
|
|
135
|
+
console.error("Error loading network data:", error);
|
|
135
136
|
} finally {
|
|
136
137
|
setLoading(false);
|
|
137
138
|
}
|
|
138
|
-
};
|
|
139
|
+
}, []);
|
|
139
140
|
|
|
140
141
|
const handleRefresh = async () => {
|
|
141
142
|
setRefreshing(true);
|
|
142
143
|
try {
|
|
143
|
-
const api = (
|
|
144
|
+
const api = getNetworkViewerApi();
|
|
144
145
|
if (api) {
|
|
145
146
|
await api.refreshNetworkInfo();
|
|
146
147
|
await loadData();
|
|
147
148
|
}
|
|
148
149
|
} catch (error) {
|
|
149
|
-
console.error(
|
|
150
|
+
console.error("Error refreshing network info:", error);
|
|
150
151
|
} finally {
|
|
151
152
|
setRefreshing(false);
|
|
152
153
|
}
|
|
153
154
|
};
|
|
154
155
|
|
|
155
156
|
const handleDisconnect = async (deviceId: string) => {
|
|
156
|
-
if (!confirm(
|
|
157
|
+
if (!confirm("Are you sure you want to disconnect from this device?")) {
|
|
157
158
|
return;
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
try {
|
|
161
|
-
const api = (
|
|
162
|
+
const api = getNetworkViewerApi();
|
|
162
163
|
if (api) {
|
|
163
164
|
await api.disconnectDevice(deviceId);
|
|
164
165
|
await loadData();
|
|
165
166
|
}
|
|
166
167
|
} catch (error) {
|
|
167
|
-
console.error(
|
|
168
|
+
console.error("Error disconnecting device:", error);
|
|
168
169
|
}
|
|
169
170
|
};
|
|
170
171
|
|
|
@@ -174,9 +175,9 @@ export function NetworkViewerList() {
|
|
|
174
175
|
|
|
175
176
|
const handleConnectToDevice = async (deviceId: string) => {
|
|
176
177
|
try {
|
|
177
|
-
const api = (
|
|
178
|
+
const api = getNetworkViewerApi();
|
|
178
179
|
if (api) {
|
|
179
|
-
setConnecting(prev => new Set(prev).add(deviceId));
|
|
180
|
+
setConnecting((prev) => new Set(prev).add(deviceId));
|
|
180
181
|
const result = await api.connectToDevice(deviceId);
|
|
181
182
|
if (result.success) {
|
|
182
183
|
// Refresh data to see if connection was established
|
|
@@ -186,10 +187,10 @@ export function NetworkViewerList() {
|
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
} catch (error) {
|
|
189
|
-
console.error(
|
|
190
|
-
alert(
|
|
190
|
+
console.error("Error connecting to device:", error);
|
|
191
|
+
alert("Error connecting to device");
|
|
191
192
|
} finally {
|
|
192
|
-
setConnecting(prev => {
|
|
193
|
+
setConnecting((prev) => {
|
|
193
194
|
const newSet = new Set(prev);
|
|
194
195
|
newSet.delete(deviceId);
|
|
195
196
|
return newSet;
|
|
@@ -199,7 +200,7 @@ export function NetworkViewerList() {
|
|
|
199
200
|
|
|
200
201
|
const handleDeleteDevice = async (deviceId: string) => {
|
|
201
202
|
try {
|
|
202
|
-
const api = (
|
|
203
|
+
const api = getNetworkViewerApi();
|
|
203
204
|
if (api) {
|
|
204
205
|
const result = await api.deleteDevice(deviceId);
|
|
205
206
|
if (result.success) {
|
|
@@ -210,8 +211,8 @@ export function NetworkViewerList() {
|
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
} catch (error) {
|
|
213
|
-
console.error(
|
|
214
|
-
alert(
|
|
214
|
+
console.error("Error deleting device:", error);
|
|
215
|
+
alert("Error deleting device");
|
|
215
216
|
}
|
|
216
217
|
};
|
|
217
218
|
|
|
@@ -220,13 +221,13 @@ export function NetworkViewerList() {
|
|
|
220
221
|
// Auto-refresh every 5 seconds
|
|
221
222
|
const interval = setInterval(loadData, 5000);
|
|
222
223
|
return () => clearInterval(interval);
|
|
223
|
-
}, []);
|
|
224
|
+
}, [loadData]);
|
|
224
225
|
|
|
225
226
|
if (loading) {
|
|
226
227
|
return <LoadingIndicator />;
|
|
227
228
|
}
|
|
228
229
|
|
|
229
|
-
if (!isDesktop) {
|
|
230
|
+
if (!isDesktop()) {
|
|
230
231
|
return (
|
|
231
232
|
<div className="container-fluid p-4">
|
|
232
233
|
<div className="alert alert-info">
|
|
@@ -239,9 +240,7 @@ export function NetworkViewerList() {
|
|
|
239
240
|
if (!overview) {
|
|
240
241
|
return (
|
|
241
242
|
<div className="container-fluid p-4">
|
|
242
|
-
<div className="alert alert-warning">
|
|
243
|
-
Unable to load network information.
|
|
244
|
-
</div>
|
|
243
|
+
<div className="alert alert-warning">Unable to load network information.</div>
|
|
245
244
|
</div>
|
|
246
245
|
);
|
|
247
246
|
}
|
|
@@ -263,13 +262,9 @@ export function NetworkViewerList() {
|
|
|
263
262
|
<i className="bi bi-stethoscope me-1"></i>
|
|
264
263
|
Troubleshoot
|
|
265
264
|
</button>
|
|
266
|
-
<button
|
|
267
|
-
className=
|
|
268
|
-
|
|
269
|
-
disabled={refreshing}
|
|
270
|
-
>
|
|
271
|
-
<i className={`bi bi-arrow-clockwise ${refreshing ? 'spin' : ''}`}></i>
|
|
272
|
-
{refreshing ? ' Refreshing...' : ' Refresh'}
|
|
265
|
+
<button className="btn btn-sm btn-primary" onClick={handleRefresh} disabled={refreshing}>
|
|
266
|
+
<i className={`bi bi-arrow-clockwise ${refreshing ? "spin" : ""}`}></i>
|
|
267
|
+
{refreshing ? " Refreshing..." : " Refresh"}
|
|
273
268
|
</button>
|
|
274
269
|
</div>
|
|
275
270
|
</div>
|
|
@@ -280,11 +275,11 @@ export function NetworkViewerList() {
|
|
|
280
275
|
<h5 className="card-title">Local Device</h5>
|
|
281
276
|
<div className="row">
|
|
282
277
|
<div className="col-md-6">
|
|
283
|
-
<strong>Device ID:</strong>{
|
|
278
|
+
<strong>Device ID:</strong>{" "}
|
|
284
279
|
<code className="text-muted small">{overview.localDeviceId}</code>
|
|
285
280
|
</div>
|
|
286
281
|
<div className="col-md-6">
|
|
287
|
-
<strong>User ID:</strong>{
|
|
282
|
+
<strong>User ID:</strong>{" "}
|
|
288
283
|
<code className="text-muted small">{overview.localUserId}</code>
|
|
289
284
|
</div>
|
|
290
285
|
</div>
|
|
@@ -293,25 +288,24 @@ export function NetworkViewerList() {
|
|
|
293
288
|
|
|
294
289
|
{/* Device info - group count, connection, cpu, memory */}
|
|
295
290
|
<div className="row mb-4">
|
|
296
|
-
|
|
297
291
|
<div className="col-md-4">
|
|
298
|
-
<div className="card" style={{ height: "100%"}}>
|
|
292
|
+
<div className="card" style={{ height: "100%" }}>
|
|
299
293
|
<div className="card-body p-2">
|
|
300
294
|
<UsageGraph
|
|
301
295
|
label="Connections"
|
|
302
296
|
fetchUsage={async () => {
|
|
303
|
-
const api = (
|
|
297
|
+
const api = getNetworkViewerApi();
|
|
304
298
|
if (!api) return 0;
|
|
305
|
-
const data = await api.getOverview();
|
|
299
|
+
const data = (await api.getOverview()) as INetworkOverview;
|
|
306
300
|
return data.totalConnections;
|
|
307
301
|
}}
|
|
308
302
|
durationMinutes={5}
|
|
309
303
|
updateInterval={5000}
|
|
310
304
|
color="rgba(111, 66, 193, 1)"
|
|
311
305
|
colorZones={[
|
|
312
|
-
{ maxValue: 1, color:
|
|
313
|
-
{ maxValue: 2, color:
|
|
314
|
-
{ maxValue: overview?.maxConnections || 30, color:
|
|
306
|
+
{ maxValue: 1, color: "rgba(220, 53, 69, 1)" },
|
|
307
|
+
{ maxValue: 2, color: "rgba(255, 193, 7, 1)" },
|
|
308
|
+
{ maxValue: overview?.maxConnections || 30, color: "rgba(111, 66, 193, 1)" },
|
|
315
309
|
]}
|
|
316
310
|
minValue={0}
|
|
317
311
|
maxValue={overview?.maxConnections || 30}
|
|
@@ -320,54 +314,54 @@ export function NetworkViewerList() {
|
|
|
320
314
|
</div>
|
|
321
315
|
</div>
|
|
322
316
|
</div>
|
|
323
|
-
|
|
317
|
+
|
|
324
318
|
<div className="col-md-4">
|
|
325
|
-
<div className="card" style={{ height: "100%"}}>
|
|
319
|
+
<div className="card" style={{ height: "100%" }}>
|
|
326
320
|
<div className="card-body p-2">
|
|
327
321
|
<UsageGraph
|
|
328
322
|
label="CPU"
|
|
329
323
|
fetchUsage={async () => {
|
|
330
|
-
const api = (
|
|
324
|
+
const api = getNetworkViewerApi();
|
|
331
325
|
if (!api) return 0;
|
|
332
|
-
const data = await api.getOverview();
|
|
326
|
+
const data = (await api.getOverview()) as INetworkOverview;
|
|
333
327
|
return data.cpuPercent;
|
|
334
328
|
}}
|
|
335
329
|
durationMinutes={5}
|
|
336
330
|
updateInterval={5000}
|
|
337
331
|
color="rgba(13, 110, 253, 1)"
|
|
338
332
|
colorZones={[
|
|
339
|
-
{ maxValue: 60, color:
|
|
340
|
-
{ maxValue: 80, color:
|
|
341
|
-
{ maxValue: Infinity, color:
|
|
333
|
+
{ maxValue: 60, color: "rgba(13, 110, 253, 1)" },
|
|
334
|
+
{ maxValue: 80, color: "rgba(255, 193, 7, 1)" },
|
|
335
|
+
{ maxValue: Infinity, color: "rgba(220, 53, 69, 1)" },
|
|
342
336
|
]}
|
|
343
337
|
/>
|
|
344
338
|
</div>
|
|
345
339
|
</div>
|
|
346
340
|
</div>
|
|
347
341
|
<div className="col-md-4">
|
|
348
|
-
<div className="card" style={{ height: "100%"}}>
|
|
342
|
+
<div className="card" style={{ height: "100%" }}>
|
|
349
343
|
<div className="card-body p-2">
|
|
350
344
|
<UsageGraph
|
|
351
345
|
label="Memory"
|
|
352
346
|
fetchUsage={async () => {
|
|
353
|
-
const api = (
|
|
347
|
+
const api = getNetworkViewerApi();
|
|
354
348
|
if (!api) return 0;
|
|
355
|
-
const data = await api.getOverview();
|
|
349
|
+
const data = (await api.getOverview()) as INetworkOverview;
|
|
356
350
|
return data.memPercent;
|
|
357
351
|
}}
|
|
358
352
|
durationMinutes={5}
|
|
359
353
|
updateInterval={5000}
|
|
360
354
|
color="rgba(25, 135, 84, 1)"
|
|
361
355
|
colorZones={[
|
|
362
|
-
{ maxValue: 60, color:
|
|
363
|
-
{ maxValue: 80, color:
|
|
364
|
-
{ maxValue: Infinity, color:
|
|
356
|
+
{ maxValue: 60, color: "rgba(25, 135, 84, 1)" },
|
|
357
|
+
{ maxValue: 80, color: "rgba(255, 193, 7, 1)" },
|
|
358
|
+
{ maxValue: Infinity, color: "rgba(220, 53, 69, 1)" },
|
|
365
359
|
]}
|
|
366
360
|
/>
|
|
367
361
|
</div>
|
|
368
362
|
</div>
|
|
369
363
|
</div>
|
|
370
|
-
</div>
|
|
364
|
+
</div>
|
|
371
365
|
|
|
372
366
|
{/* Connections List */}
|
|
373
367
|
<div className="card mb-4">
|
|
@@ -396,36 +390,38 @@ export function NetworkViewerList() {
|
|
|
396
390
|
</tr>
|
|
397
391
|
</thead>
|
|
398
392
|
<tbody>
|
|
399
|
-
{connections.map(conn => {
|
|
393
|
+
{connections.map((conn) => {
|
|
400
394
|
return (
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
395
|
+
<tr key={conn.deviceId}>
|
|
396
|
+
<td>
|
|
397
|
+
{conn.userName || conn.userId}
|
|
398
|
+
{!conn.userName && (
|
|
399
|
+
<>
|
|
400
|
+
<br />
|
|
401
|
+
<small className="text-muted">{conn.userId}</small>
|
|
402
|
+
</>
|
|
403
|
+
)}
|
|
404
|
+
</td>
|
|
405
|
+
<td>
|
|
406
|
+
<TrustLevelBadge level={conn.userTrustLevel || TrustLevel.Unknown} />
|
|
407
|
+
</td>
|
|
408
|
+
<td>
|
|
409
|
+
<TrustLevelBadge level={conn.deviceTrustLevel || TrustLevel.Unknown} />
|
|
410
|
+
</td>
|
|
411
|
+
<td>
|
|
412
|
+
{conn.deviceName ? (
|
|
413
|
+
<>
|
|
414
|
+
<span className="small">{conn.deviceName}</span>
|
|
415
|
+
<br />
|
|
416
|
+
<code className="text-muted small" style={{ fontSize: ".7em" }}>
|
|
417
|
+
{conn.deviceId}
|
|
418
|
+
</code>
|
|
419
|
+
</>
|
|
420
|
+
) : (
|
|
421
|
+
<code className="text-muted small">{conn.deviceId}</code>
|
|
422
|
+
)}
|
|
423
|
+
</td>
|
|
424
|
+
{/* <td>
|
|
429
425
|
<span
|
|
430
426
|
className={`badge bg-${
|
|
431
427
|
conn.pathType === 'direct' ? 'success' : 'info'
|
|
@@ -434,66 +430,79 @@ export function NetworkViewerList() {
|
|
|
434
430
|
{conn.pathType}
|
|
435
431
|
</span>
|
|
436
432
|
</td> */}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
</
|
|
476
|
-
|
|
477
|
-
|
|
433
|
+
<td>
|
|
434
|
+
<span className={`badge bg-${conn.isServer ? "secondary" : "primary"}`}>
|
|
435
|
+
{conn.isServer ? "Receiver" : "Initiator"}
|
|
436
|
+
</span>
|
|
437
|
+
</td>
|
|
438
|
+
<td>
|
|
439
|
+
{conn.connectionAddress ? (
|
|
440
|
+
<small className="text-muted">{conn.connectionAddress}</small>
|
|
441
|
+
) : (
|
|
442
|
+
<span className="text-muted">-</span>
|
|
443
|
+
)}
|
|
444
|
+
</td>
|
|
445
|
+
<td>{conn.sharedGroups.length}</td>
|
|
446
|
+
<td>
|
|
447
|
+
<span
|
|
448
|
+
className={`badge bg-${
|
|
449
|
+
conn.latencyMs < 200
|
|
450
|
+
? "success"
|
|
451
|
+
: conn.latencyMs < 600
|
|
452
|
+
? "warning"
|
|
453
|
+
: "danger"
|
|
454
|
+
}`}
|
|
455
|
+
>
|
|
456
|
+
{Math.round(conn.latencyMs)}ms
|
|
457
|
+
</span>
|
|
458
|
+
</td>
|
|
459
|
+
<td>
|
|
460
|
+
<span
|
|
461
|
+
className={`badge bg-${
|
|
462
|
+
conn.errorRate < 0.05
|
|
463
|
+
? "success"
|
|
464
|
+
: conn.errorRate < 0.2
|
|
465
|
+
? "warning"
|
|
466
|
+
: "danger"
|
|
467
|
+
}`}
|
|
468
|
+
>
|
|
469
|
+
{(conn.errorRate * 100).toFixed(1)}%
|
|
470
|
+
</span>
|
|
471
|
+
</td>
|
|
472
|
+
<td>
|
|
473
|
+
<small>
|
|
474
|
+
<span className="text-success">↑{formatRate(conn.sendRateMBps)}</span>
|
|
475
|
+
{" / "}
|
|
476
|
+
<span className="text-primary">
|
|
477
|
+
↓{formatRate(conn.receiveRateMBps)}
|
|
478
|
+
</span>
|
|
479
|
+
</small>
|
|
480
|
+
<br />
|
|
481
|
+
<small className="text-muted">
|
|
482
|
+
{formatBytes(conn.bytesSent || 0)} /{" "}
|
|
483
|
+
{formatBytes(conn.bytesReceived || 0)}
|
|
484
|
+
</small>
|
|
485
|
+
</td>
|
|
486
|
+
{/* <td>
|
|
478
487
|
<span className="badge bg-success">{conn.connectionState}</span>
|
|
479
488
|
</td> */}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
489
|
+
<td>
|
|
490
|
+
<button
|
|
491
|
+
className="btn btn-sm btn-outline-primary me-2"
|
|
492
|
+
onClick={() => handleViewDetails(conn.deviceId)}
|
|
493
|
+
title="View Details"
|
|
494
|
+
>
|
|
495
|
+
<i className="bi bi-info-circle"></i>
|
|
496
|
+
</button>
|
|
497
|
+
<button
|
|
498
|
+
className="btn btn-sm btn-outline-danger"
|
|
499
|
+
onClick={() => handleDisconnect(conn.deviceId)}
|
|
500
|
+
title="Disconnect"
|
|
501
|
+
>
|
|
502
|
+
<i className="bi bi-x-circle"></i>
|
|
503
|
+
</button>
|
|
504
|
+
</td>
|
|
505
|
+
</tr>
|
|
497
506
|
);
|
|
498
507
|
})}
|
|
499
508
|
</tbody>
|
|
@@ -522,7 +531,7 @@ export function NetworkViewerList() {
|
|
|
522
531
|
</tr>
|
|
523
532
|
</thead>
|
|
524
533
|
<tbody>
|
|
525
|
-
{groupSyncInfo.map(group => (
|
|
534
|
+
{groupSyncInfo.map((group) => (
|
|
526
535
|
<tr key={group.groupId}>
|
|
527
536
|
<td>
|
|
528
537
|
<strong>{group.groupName}</strong>
|
|
@@ -533,33 +542,48 @@ export function NetworkViewerList() {
|
|
|
533
542
|
{group.connectedDevices.length > 0 ? (
|
|
534
543
|
<div>
|
|
535
544
|
<span className="badge bg-success mb-1">
|
|
536
|
-
{group.connectedDevices.length} device
|
|
545
|
+
{group.connectedDevices.length} device
|
|
546
|
+
{group.connectedDevices.length !== 1 ? "s" : ""}
|
|
537
547
|
</span>
|
|
538
548
|
<div className="mt-2">
|
|
539
549
|
{group.connectedDevices.map((device, idx) => (
|
|
540
550
|
<div key={device.deviceId} className="mb-2">
|
|
541
551
|
<small>
|
|
542
552
|
<code className="text-muted">{device.deviceId}</code>
|
|
543
|
-
{device.closed &&
|
|
553
|
+
{device.closed && (
|
|
554
|
+
<span className="badge bg-danger ms-2">Closed</span>
|
|
555
|
+
)}
|
|
544
556
|
</small>
|
|
545
557
|
<div className="d-flex gap-2 mt-1">
|
|
546
|
-
<span
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
558
|
+
<span
|
|
559
|
+
className={`badge bg-${
|
|
560
|
+
device.latencyMs < 200
|
|
561
|
+
? "success"
|
|
562
|
+
: device.latencyMs < 600
|
|
563
|
+
? "warning"
|
|
564
|
+
: "danger"
|
|
565
|
+
}`}
|
|
566
|
+
>
|
|
550
567
|
{Math.round(device.latencyMs)}ms
|
|
551
568
|
</span>
|
|
552
|
-
<span
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
569
|
+
<span
|
|
570
|
+
className={`badge bg-${
|
|
571
|
+
device.errorRate < 0.05
|
|
572
|
+
? "success"
|
|
573
|
+
: device.errorRate < 0.2
|
|
574
|
+
? "warning"
|
|
575
|
+
: "danger"
|
|
576
|
+
}`}
|
|
577
|
+
>
|
|
556
578
|
{(device.errorRate * 100).toFixed(1)}% errors
|
|
557
579
|
</span>
|
|
558
580
|
<span className="badge bg-info">
|
|
559
581
|
Last: {new Date(device.timestampLastApplied).toLocaleString()}
|
|
560
582
|
</span>
|
|
561
583
|
</div>
|
|
562
|
-
{idx < group.connectedDevices.length - 1 &&
|
|
584
|
+
{idx < group.connectedDevices.length - 1 && (
|
|
585
|
+
<hr className="my-2" />
|
|
586
|
+
)}
|
|
563
587
|
</div>
|
|
564
588
|
))}
|
|
565
589
|
</div>
|
|
@@ -575,9 +599,11 @@ export function NetworkViewerList() {
|
|
|
575
599
|
{group.preferredDeviceIds.length} preferred
|
|
576
600
|
</span>
|
|
577
601
|
<div>
|
|
578
|
-
{group.preferredDeviceIds.map(deviceId => (
|
|
602
|
+
{group.preferredDeviceIds.map((deviceId) => (
|
|
579
603
|
<div key={deviceId}>
|
|
580
|
-
<small
|
|
604
|
+
<small>
|
|
605
|
+
<code className="text-muted">{deviceId}</code>
|
|
606
|
+
</small>
|
|
581
607
|
</div>
|
|
582
608
|
))}
|
|
583
609
|
</div>
|
|
@@ -590,7 +616,7 @@ export function NetworkViewerList() {
|
|
|
590
616
|
<small>
|
|
591
617
|
{group.lastSyncTimestamp > 0
|
|
592
618
|
? new Date(group.lastSyncTimestamp).toLocaleString()
|
|
593
|
-
:
|
|
619
|
+
: "Never"}
|
|
594
620
|
</small>
|
|
595
621
|
</td>
|
|
596
622
|
<td>
|
|
@@ -634,60 +660,62 @@ export function NetworkViewerList() {
|
|
|
634
660
|
<tbody>
|
|
635
661
|
{disconnectedDevices
|
|
636
662
|
.sort((a, b) => new Date(b.lastSeen).getTime() - new Date(a.lastSeen).getTime())
|
|
637
|
-
.map(device => (
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
<>
|
|
643
|
-
<br />
|
|
644
|
-
<small className="text-muted">{device.userId}</small>
|
|
645
|
-
</>
|
|
646
|
-
)}
|
|
647
|
-
</td>
|
|
648
|
-
<td>
|
|
649
|
-
<TrustLevelBadge level={device.trustLevel || TrustLevel.Unknown} />
|
|
650
|
-
</td>
|
|
651
|
-
<td>
|
|
652
|
-
<code className="text-muted small">{device.deviceId}</code>
|
|
653
|
-
</td>
|
|
654
|
-
<td>
|
|
655
|
-
{device.name || <span className="text-muted">-</span>}
|
|
656
|
-
</td>
|
|
657
|
-
<td>
|
|
658
|
-
<small>{new Date(device.firstSeen).toLocaleString()}</small>
|
|
659
|
-
</td>
|
|
660
|
-
<td>
|
|
661
|
-
<small>{new Date(device.lastSeen).toLocaleString()}</small>
|
|
662
|
-
</td>
|
|
663
|
-
<td>
|
|
664
|
-
<button
|
|
665
|
-
className="btn btn-sm btn-outline-success me-2"
|
|
666
|
-
onClick={() => handleConnectToDevice(device.deviceId)}
|
|
667
|
-
disabled={connecting.has(device.deviceId)}
|
|
668
|
-
title="Connect to device"
|
|
669
|
-
>
|
|
670
|
-
{connecting.has(device.deviceId) ? (
|
|
663
|
+
.map((device) => (
|
|
664
|
+
<tr key={device.deviceId}>
|
|
665
|
+
<td>
|
|
666
|
+
{device.userName || device.userId}
|
|
667
|
+
{!device.userName && (
|
|
671
668
|
<>
|
|
672
|
-
<
|
|
673
|
-
|
|
674
|
-
</>
|
|
675
|
-
) : (
|
|
676
|
-
<>
|
|
677
|
-
<i className="bi bi-arrow-right-circle"></i> Connect
|
|
669
|
+
<br />
|
|
670
|
+
<small className="text-muted">{device.userId}</small>
|
|
678
671
|
</>
|
|
679
672
|
)}
|
|
680
|
-
</
|
|
681
|
-
<
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
</
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
673
|
+
</td>
|
|
674
|
+
<td>
|
|
675
|
+
<TrustLevelBadge level={device.trustLevel || TrustLevel.Unknown} />
|
|
676
|
+
</td>
|
|
677
|
+
<td>
|
|
678
|
+
<code className="text-muted small">{device.deviceId}</code>
|
|
679
|
+
</td>
|
|
680
|
+
<td>{device.name || <span className="text-muted">-</span>}</td>
|
|
681
|
+
<td>
|
|
682
|
+
<small>{new Date(device.firstSeen).toLocaleString()}</small>
|
|
683
|
+
</td>
|
|
684
|
+
<td>
|
|
685
|
+
<small>{new Date(device.lastSeen).toLocaleString()}</small>
|
|
686
|
+
</td>
|
|
687
|
+
<td>
|
|
688
|
+
<button
|
|
689
|
+
className="btn btn-sm btn-outline-success me-2"
|
|
690
|
+
onClick={() => handleConnectToDevice(device.deviceId)}
|
|
691
|
+
disabled={connecting.has(device.deviceId)}
|
|
692
|
+
title="Connect to device"
|
|
693
|
+
>
|
|
694
|
+
{connecting.has(device.deviceId) ? (
|
|
695
|
+
<>
|
|
696
|
+
<span
|
|
697
|
+
className="spinner-border spinner-border-sm me-1"
|
|
698
|
+
role="status"
|
|
699
|
+
aria-hidden="true"
|
|
700
|
+
></span>
|
|
701
|
+
Connecting...
|
|
702
|
+
</>
|
|
703
|
+
) : (
|
|
704
|
+
<>
|
|
705
|
+
<i className="bi bi-arrow-right-circle"></i> Connect
|
|
706
|
+
</>
|
|
707
|
+
)}
|
|
708
|
+
</button>
|
|
709
|
+
<button
|
|
710
|
+
className="btn btn-sm btn-outline-danger"
|
|
711
|
+
onClick={() => handleDeleteDevice(device.deviceId)}
|
|
712
|
+
title="Forget this device"
|
|
713
|
+
>
|
|
714
|
+
<i className="bi bi-trash"></i>
|
|
715
|
+
</button>
|
|
716
|
+
</td>
|
|
717
|
+
</tr>
|
|
718
|
+
))}
|
|
691
719
|
</tbody>
|
|
692
720
|
</table>
|
|
693
721
|
</div>
|
|
@@ -706,23 +734,20 @@ export function NetworkViewerList() {
|
|
|
706
734
|
|
|
707
735
|
{/* Group Details Modal */}
|
|
708
736
|
{selectedGroupId && (
|
|
709
|
-
<GroupDetailsModal
|
|
710
|
-
groupId={selectedGroupId}
|
|
711
|
-
onClose={() => setSelectedGroupId(null)}
|
|
712
|
-
/>
|
|
737
|
+
<GroupDetailsModal groupId={selectedGroupId} onClose={() => setSelectedGroupId(null)} />
|
|
713
738
|
)}
|
|
714
739
|
</div>
|
|
715
740
|
);
|
|
716
741
|
}
|
|
717
742
|
|
|
718
743
|
registerInternalPeersUI({
|
|
719
|
-
peersUIId:
|
|
744
|
+
peersUIId: "network-viewer-list-ui",
|
|
720
745
|
component: NetworkViewerList,
|
|
721
746
|
routes: [
|
|
722
747
|
{
|
|
723
|
-
isMatch: (_props, context) => context.path ===
|
|
724
|
-
uiCategory:
|
|
725
|
-
priority: 2
|
|
726
|
-
}
|
|
727
|
-
]
|
|
748
|
+
isMatch: (_props, context) => context.path === "network-viewer",
|
|
749
|
+
uiCategory: "screen",
|
|
750
|
+
priority: 2,
|
|
751
|
+
},
|
|
752
|
+
],
|
|
728
753
|
});
|