@peers-app/peers-ui 0.27.3 → 0.27.4
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/dist/screens/network-viewer/network-viewer-ipc.d.ts +3 -1
- package/dist/screens/network-viewer/network-viewer-ipc.js +6 -0
- package/dist/screens/network-viewer/sync-recovery.js +103 -1
- package/dist/screens/variables/variable-details.js +2 -1
- package/dist/tabs-layout/network-status-indicator.js +26 -12
- package/dist/tabs-layout/use-network-status.d.ts +6 -1
- package/dist/tabs-layout/use-network-status.js +27 -4
- package/package.json +9 -3
- package/.claude/settings.local.json +0 -34
- package/.github/README.md +0 -52
- package/.github/workflows/delete-all-artifacts.yml +0 -49
- package/.github/workflows/publish.yml +0 -51
- package/babel.config.js +0 -7
- package/biome.json +0 -198
- package/dist/app-updates/app-updates-consumer.test.d.ts +0 -1
- package/dist/app-updates/app-updates-consumer.test.js +0 -56
- package/dist/app-updates/app-updates-settings.test.d.ts +0 -1
- package/dist/app-updates/app-updates-settings.test.js +0 -93
- package/dist/app-updates/remote-app-update-panel.test.d.ts +0 -1
- package/dist/app-updates/remote-app-update-panel.test.js +0 -165
- package/dist/components/access-level-field.test.d.ts +0 -1
- package/dist/components/access-level-field.test.js +0 -28
- package/dist/components/message-logs/tool-access-approval-card.test.d.ts +0 -1
- package/dist/components/message-logs/tool-access-approval-card.test.js +0 -102
- package/dist/components/responsive-section-nav.test.d.ts +0 -1
- package/dist/components/responsive-section-nav.test.js +0 -45
- package/dist/globals-hash.test.d.ts +0 -1
- package/dist/globals-hash.test.js +0 -16
- package/dist/hooks/use-observable-state.test.d.ts +0 -1
- package/dist/hooks/use-observable-state.test.js +0 -64
- package/dist/hooks/use-observable.test.d.ts +0 -1
- package/dist/hooks/use-observable.test.js +0 -191
- package/dist/hooks/use-rows.test.d.ts +0 -1
- package/dist/hooks/use-rows.test.js +0 -175
- package/dist/hooks/use-tool.test.d.ts +0 -1
- package/dist/hooks/use-tool.test.js +0 -190
- package/dist/host-shell/host-shell-consumer.test.d.ts +0 -1
- package/dist/host-shell/host-shell-consumer.test.js +0 -28
- package/dist/root-layout/root-layout-host.test.d.ts +0 -1
- package/dist/root-layout/root-layout-host.test.js +0 -86
- package/dist/screens/account/account-screen.test.d.ts +0 -1
- package/dist/screens/account/account-screen.test.js +0 -51
- package/dist/screens/assistants/assistant-config.test.d.ts +0 -1
- package/dist/screens/assistants/assistant-config.test.js +0 -57
- package/dist/screens/contacts/contact-list.test.d.ts +0 -1
- package/dist/screens/contacts/contact-list.test.js +0 -48
- package/dist/screens/device-pairing/device-pairing.test.d.ts +0 -1
- package/dist/screens/device-pairing/device-pairing.test.js +0 -119
- package/dist/screens/devices/devices-list.test.d.ts +0 -1
- package/dist/screens/devices/devices-list.test.js +0 -53
- package/dist/screens/groups/group-list.test.d.ts +0 -1
- package/dist/screens/groups/group-list.test.js +0 -38
- package/dist/screens/identity/identity-routes.test.d.ts +0 -1
- package/dist/screens/identity/identity-routes.test.js +0 -51
- package/dist/screens/identity/identity-screen.test.d.ts +0 -1
- package/dist/screens/identity/identity-screen.test.js +0 -103
- package/dist/screens/invites/accept-invite.test.d.ts +0 -1
- package/dist/screens/invites/accept-invite.test.js +0 -103
- package/dist/screens/invites/activity-view.test.d.ts +0 -1
- package/dist/screens/invites/activity-view.test.js +0 -108
- package/dist/screens/invites/invite-classify.test.d.ts +0 -1
- package/dist/screens/invites/invite-classify.test.js +0 -115
- package/dist/screens/network-viewer/network-viewer-ipc.test.d.ts +0 -1
- package/dist/screens/network-viewer/network-viewer-ipc.test.js +0 -61
- package/dist/screens/network-viewer/network-viewer.section.test.d.ts +0 -1
- package/dist/screens/network-viewer/network-viewer.section.test.js +0 -63
- package/dist/screens/network-viewer/sync-recovery.test.d.ts +0 -1
- package/dist/screens/network-viewer/sync-recovery.test.js +0 -104
- package/dist/screens/packages/package-helpers.test.d.ts +0 -1
- package/dist/screens/packages/package-helpers.test.js +0 -53
- package/dist/screens/packages/package-runtime-status.test.d.ts +0 -1
- package/dist/screens/packages/package-runtime-status.test.js +0 -50
- package/dist/screens/packages/packages-ipc.test.d.ts +0 -1
- package/dist/screens/packages/packages-ipc.test.js +0 -43
- package/dist/screens/settings/settings-page.test.d.ts +0 -1
- package/dist/screens/settings/settings-page.test.js +0 -19
- package/dist/screens/tools/tool-access-ipc.test.d.ts +0 -1
- package/dist/screens/tools/tool-access-ipc.test.js +0 -40
- package/dist/screens/tools/tool-catalog-ipc.test.d.ts +0 -1
- package/dist/screens/tools/tool-catalog-ipc.test.js +0 -52
- package/dist/tabs-layout/network-status-indicator.test.d.ts +0 -1
- package/dist/tabs-layout/network-status-indicator.test.js +0 -665
- package/dist/tabs-layout/tabs-state.test.d.ts +0 -1
- package/dist/tabs-layout/tabs-state.test.js +0 -110
- package/dist/tabs-layout/use-network-status.test.d.ts +0 -1
- package/dist/tabs-layout/use-network-status.test.js +0 -45
- package/dist/ui-router/ui-loader.test.d.ts +0 -1
- package/dist/ui-router/ui-loader.test.js +0 -91
- package/jest.config.js +0 -25
- package/release-guard.js +0 -10
- package/src/app-updates/app-update-controls.tsx +0 -73
- package/src/app-updates/app-updates-consumer.test.ts +0 -83
- package/src/app-updates/app-updates-consumer.ts +0 -121
- package/src/app-updates/app-updates-settings.test.tsx +0 -109
- package/src/app-updates/app-updates-settings.tsx +0 -136
- package/src/app-updates/remote-app-update-panel.test.tsx +0 -205
- package/src/app-updates/remote-app-update-panel.tsx +0 -210
- package/src/app-updates/use-app-update-status.ts +0 -16
- package/src/command-palette/command-palette-ui.tsx +0 -564
- package/src/command-palette/command-palette.ts +0 -242
- package/src/components/access-level-field.test.tsx +0 -32
- package/src/components/access-level-field.tsx +0 -68
- package/src/components/checkbox.tsx +0 -25
- package/src/components/group-switcher.tsx +0 -526
- package/src/components/input-date.tsx +0 -29
- package/src/components/input-number.tsx +0 -83
- package/src/components/input.tsx +0 -25
- package/src/components/inverse-lazy-list.tsx +0 -107
- package/src/components/io-schema-values.tsx +0 -103
- package/src/components/io-schema.tsx +0 -259
- package/src/components/lazy-list.tsx +0 -115
- package/src/components/list-screen.tsx +0 -126
- package/src/components/loading-indicator.tsx +0 -7
- package/src/components/markdown-editor/autolink-plugin.tsx +0 -29
- package/src/components/markdown-editor/editor-inline.tsx +0 -9
- package/src/components/markdown-editor/editor.tsx +0 -158
- package/src/components/markdown-editor/markdown-plugin.tsx +0 -202
- package/src/components/markdown-editor/mention-node.ts +0 -204
- package/src/components/markdown-editor/mentions-plugin.tsx +0 -354
- package/src/components/markdown-editor/move-line-plugin.tsx +0 -186
- package/src/components/markdown-editor/select-line-boundary-plugin.tsx +0 -95
- package/src/components/markdown-editor/theme.ts +0 -46
- package/src/components/markdown-editor/toolbar.tsx +0 -269
- package/src/components/markdown-with-mentions.tsx +0 -198
- package/src/components/message-logs/message-logs.tsx +0 -523
- package/src/components/message-logs/tool-access-approval-card.test.tsx +0 -127
- package/src/components/message-logs/tool-access-approval-card.tsx +0 -178
- package/src/components/messages/avatar.tsx +0 -171
- package/src/components/messages/channel-message-list.tsx +0 -189
- package/src/components/messages/channel-view.tsx +0 -92
- package/src/components/messages/message-compose.tsx +0 -192
- package/src/components/messages/message-display.tsx +0 -231
- package/src/components/messages/thread-message-list.tsx +0 -135
- package/src/components/qr-scanner.tsx +0 -180
- package/src/components/responsive-section-nav.test.tsx +0 -88
- package/src/components/responsive-section-nav.tsx +0 -92
- package/src/components/router.tsx +0 -175
- package/src/components/save-button.tsx +0 -134
- package/src/components/sortable-list.tsx +0 -130
- package/src/components/tabs.tsx +0 -76
- package/src/components/tooltip.tsx +0 -43
- package/src/components/trust-level-badge.tsx +0 -44
- package/src/components/trust-level-dropdown.tsx +0 -136
- package/src/components/typeahead.tsx +0 -357
- package/src/globals-hash.test.ts +0 -19
- package/src/globals.tsx +0 -226
- package/src/hooks/index.ts +0 -8
- package/src/hooks/use-host-contract.ts +0 -75
- package/src/hooks/use-observable-state.test.tsx +0 -101
- package/src/hooks/use-observable-state.ts +0 -29
- package/src/hooks/use-observable.test.tsx +0 -258
- package/src/hooks/use-observable.ts +0 -67
- package/src/hooks/use-on-screen.ts +0 -24
- package/src/hooks/use-promise.ts +0 -34
- package/src/hooks/use-rows.test.tsx +0 -196
- package/src/hooks/use-rows.ts +0 -120
- package/src/hooks/use-subscription.ts +0 -24
- package/src/hooks/use-tool.test.tsx +0 -225
- package/src/hooks/use-tool.ts +0 -116
- package/src/host-shell/host-shell-consumer.test.ts +0 -32
- package/src/host-shell/host-shell-consumer.ts +0 -53
- package/src/index.tsx +0 -42
- package/src/mention-configs.ts +0 -185
- package/src/operator-console/operator-console-state.ts +0 -119
- package/src/operator-console/operator-console.tsx +0 -233
- package/src/peers-services-registration.ts +0 -6
- package/src/root-layout/global-overlays.ts +0 -50
- package/src/root-layout/layout-picker.tsx +0 -47
- package/src/root-layout/layouts/full-screen-layout.tsx +0 -144
- package/src/root-layout/layouts/tabs-with-console-layout.tsx +0 -260
- package/src/root-layout/root-layout-host.test.tsx +0 -108
- package/src/root-layout/root-layout-host.tsx +0 -147
- package/src/root-layout/root-layout-registry.ts +0 -51
- package/src/root-layout/root-layout-state.ts +0 -55
- package/src/root-layout/root-layout.ts +0 -32
- package/src/screens/account/account-screen.test.tsx +0 -65
- package/src/screens/account/account-screen.tsx +0 -942
- package/src/screens/assistants/assistant-config.test.tsx +0 -54
- package/src/screens/assistants/assistant-config.tsx +0 -121
- package/src/screens/assistants/assistant-details.tsx +0 -89
- package/src/screens/assistants/assistant-info.tsx +0 -66
- package/src/screens/assistants/assistant-list.tsx +0 -145
- package/src/screens/assistants/assistant-tools.tsx +0 -82
- package/src/screens/console-logs/console-logs-list.tsx +0 -374
- package/src/screens/console-logs/log-display.tsx +0 -137
- package/src/screens/console-logs/log-filters.tsx +0 -64
- package/src/screens/console-logs/mobile-log-card.tsx +0 -161
- package/src/screens/console-logs/resizable-table-header.tsx +0 -110
- package/src/screens/contacts/contact-details.tsx +0 -123
- package/src/screens/contacts/contact-list.test.tsx +0 -59
- package/src/screens/contacts/contact-list.tsx +0 -286
- package/src/screens/contacts/index.ts +0 -2
- package/src/screens/data-explorer/data-explorer.tsx +0 -633
- package/src/screens/data-explorer/index.ts +0 -6
- package/src/screens/data-explorer/query-executor.tsx +0 -520
- package/src/screens/device-pairing/device-pairing.test.tsx +0 -143
- package/src/screens/device-pairing/device-pairing.tsx +0 -461
- package/src/screens/device-pairing/identity-ipc.ts +0 -25
- package/src/screens/device-pairing/index.ts +0 -2
- package/src/screens/device-pairing/use-device-pairing-state.ts +0 -15
- package/src/screens/devices/devices-list.test.tsx +0 -68
- package/src/screens/devices/devices-list.tsx +0 -365
- package/src/screens/devices/index.ts +0 -1
- package/src/screens/groups/group-details.tsx +0 -160
- package/src/screens/groups/group-invite-panel.tsx +0 -311
- package/src/screens/groups/group-list.test.tsx +0 -44
- package/src/screens/groups/group-list.tsx +0 -317
- package/src/screens/groups/group-members.tsx +0 -343
- package/src/screens/groups/index.ts +0 -3
- package/src/screens/identity/identity-routes.test.ts +0 -70
- package/src/screens/identity/identity-routes.ts +0 -301
- package/src/screens/identity/identity-screen.test.tsx +0 -138
- package/src/screens/identity/identity-screen.tsx +0 -282
- package/src/screens/identity/index.ts +0 -2
- package/src/screens/identity/invite-contact-panel.tsx +0 -45
- package/src/screens/identity/profile-invite.tsx +0 -93
- package/src/screens/invites/accept-invite.test.tsx +0 -115
- package/src/screens/invites/accept-invite.tsx +0 -318
- package/src/screens/invites/activity-view.test.tsx +0 -127
- package/src/screens/invites/activity-view.tsx +0 -162
- package/src/screens/invites/index.ts +0 -6
- package/src/screens/invites/invite-capture.ts +0 -104
- package/src/screens/invites/invite-classify.test.ts +0 -129
- package/src/screens/invites/invite-share.tsx +0 -104
- package/src/screens/invites/invites-ipc.ts +0 -25
- package/src/screens/invites/pending-invites-list.tsx +0 -256
- package/src/screens/network-viewer/connection-troubleshooter.tsx +0 -395
- package/src/screens/network-viewer/cpu-usage-graph.tsx +0 -294
- package/src/screens/network-viewer/device-details-modal.tsx +0 -339
- package/src/screens/network-viewer/group-details-modal.tsx +0 -421
- package/src/screens/network-viewer/index.ts +0 -8
- package/src/screens/network-viewer/network-viewer-ipc.test.ts +0 -72
- package/src/screens/network-viewer/network-viewer-ipc.ts +0 -39
- package/src/screens/network-viewer/network-viewer-section.ts +0 -12
- package/src/screens/network-viewer/network-viewer.section.test.tsx +0 -68
- package/src/screens/network-viewer/network-viewer.tsx +0 -708
- package/src/screens/network-viewer/remote-logs-panel.tsx +0 -190
- package/src/screens/network-viewer/sync-recovery.test.tsx +0 -114
- package/src/screens/network-viewer/sync-recovery.tsx +0 -461
- package/src/screens/network-viewer/usage-graph.tsx +0 -455
- package/src/screens/packages/local-folder-grants-panel.tsx +0 -290
- package/src/screens/packages/local-folders-ipc.ts +0 -28
- package/src/screens/packages/package-details.tsx +0 -166
- package/src/screens/packages/package-helpers.test.ts +0 -57
- package/src/screens/packages/package-helpers.ts +0 -137
- package/src/screens/packages/package-info.tsx +0 -354
- package/src/screens/packages/package-list.tsx +0 -519
- package/src/screens/packages/package-network-panel.tsx +0 -82
- package/src/screens/packages/package-new-local.tsx +0 -100
- package/src/screens/packages/package-runtime-status.test.tsx +0 -58
- package/src/screens/packages/package-runtime-status.tsx +0 -68
- package/src/screens/packages/package-versions.tsx +0 -298
- package/src/screens/packages/packages-ipc.test.ts +0 -47
- package/src/screens/packages/packages-ipc.ts +0 -125
- package/src/screens/peer-types/peer-type-details.tsx +0 -172
- package/src/screens/peer-types/peer-type-list.tsx +0 -64
- package/src/screens/search/global-search.tsx +0 -406
- package/src/screens/settings/color-mode-dropdown.tsx +0 -82
- package/src/screens/settings/settings-page.test.tsx +0 -24
- package/src/screens/settings/settings-page.tsx +0 -426
- package/src/screens/setup-user.tsx +0 -355
- package/src/screens/tools/tool-access-ipc.test.ts +0 -55
- package/src/screens/tools/tool-access-ipc.ts +0 -27
- package/src/screens/tools/tool-catalog-ipc.test.ts +0 -52
- package/src/screens/tools/tool-catalog-ipc.ts +0 -51
- package/src/screens/tools/tool-details.tsx +0 -52
- package/src/screens/tools/tool-info.tsx +0 -45
- package/src/screens/tools/tool-list.tsx +0 -106
- package/src/screens/tools/tool-schema.tsx +0 -44
- package/src/screens/tools/tool-test-details.tsx +0 -89
- package/src/screens/tools/tool-test-list.tsx +0 -73
- package/src/screens/variables/variable-details.tsx +0 -289
- package/src/screens/variables/variable-list.tsx +0 -110
- package/src/screens/welcome-modal.tsx +0 -294
- package/src/screens/workflows/workflow-details.tsx +0 -115
- package/src/screens/workflows/workflow-info.tsx +0 -22
- package/src/screens/workflows/workflow-instructions.tsx +0 -134
- package/src/screens/workflows/workflow-list.tsx +0 -117
- package/src/setupTests.ts +0 -38
- package/src/system-apps/assistants.app.ts +0 -7
- package/src/system-apps/console-logs.app.ts +0 -7
- package/src/system-apps/data-explorer.app.ts +0 -8
- package/src/system-apps/identity.app.ts +0 -9
- package/src/system-apps/index.ts +0 -77
- package/src/system-apps/mobile-settings.app.ts +0 -7
- package/src/system-apps/network-viewer.app.ts +0 -8
- package/src/system-apps/packages.app.ts +0 -7
- package/src/system-apps/search.app.ts +0 -8
- package/src/system-apps/settings.app.ts +0 -7
- package/src/system-apps/threads.app.ts +0 -7
- package/src/system-apps/tools.app.ts +0 -7
- package/src/system-apps/types.app.ts +0 -7
- package/src/system-apps/variables.app.ts +0 -7
- package/src/system-apps/workflows.app.ts +0 -7
- package/src/tabs-layout/network-status-indicator.test.tsx +0 -799
- package/src/tabs-layout/network-status-indicator.tsx +0 -756
- package/src/tabs-layout/tabs-layout.tsx +0 -857
- package/src/tabs-layout/tabs-state.test.ts +0 -152
- package/src/tabs-layout/tabs-state.ts +0 -587
- package/src/tabs-layout/use-network-status.test.tsx +0 -58
- package/src/tabs-layout/use-network-status.ts +0 -68
- package/src/ui-defaults/index.ts +0 -2
- package/src/ui-defaults/list-screen.tsx +0 -94
- package/src/ui-defaults/markdown-field.tsx +0 -87
- package/src/ui-router/routes-loader.ts +0 -193
- package/src/ui-router/ui-loader.test.tsx +0 -108
- package/src/ui-router/ui-loader.tsx +0 -606
- package/src/utils.ts +0 -95
- package/tsconfig.json +0 -18
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { type INetworkDeviceDetails, TrustLevel } from "@peers-app/peers-sdk";
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
|
-
import { RemoteAppUpdatePanel } from "../../app-updates/remote-app-update-panel";
|
|
4
|
-
import { LoadingIndicator } from "../../components/loading-indicator";
|
|
5
|
-
import { TrustLevelBadge } from "../../components/trust-level-badge";
|
|
6
|
-
import { getNetworkControlConsumer, getNetworkDiagnosticsConsumer } from "./network-viewer-ipc";
|
|
7
|
-
import { RemoteLogsPanel } from "./remote-logs-panel";
|
|
8
|
-
|
|
9
|
-
/** Format bytes to human-readable string (KB, MB, GB) */
|
|
10
|
-
function formatBytes(bytes: number): string {
|
|
11
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
12
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
13
|
-
if (bytes < 1024 * 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
14
|
-
return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GB`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Format transfer rate to human-readable string (KB/s or MB/s) */
|
|
18
|
-
function formatRate(mbps: number | undefined): string {
|
|
19
|
-
if (mbps === undefined || mbps === 0) return "0 KB/s";
|
|
20
|
-
// Show KB/s if less than 0.1 MB/s (100 KB/s)
|
|
21
|
-
if (mbps < 0.1) {
|
|
22
|
-
const kbps = mbps * 1024;
|
|
23
|
-
return `${kbps.toFixed(1)} KB/s`;
|
|
24
|
-
}
|
|
25
|
-
return `${mbps.toFixed(2)} MB/s`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface IDeviceDetailsModalProps {
|
|
29
|
-
deviceId: string;
|
|
30
|
-
onClose: () => void;
|
|
31
|
-
onDisconnect?: () => void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Show connection, sync, topology, and provider-authorized remote-log diagnostics for one device. */
|
|
35
|
-
export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceDetailsModalProps) {
|
|
36
|
-
const [device, setDevice] = useState<INetworkDeviceDetails | null>(null);
|
|
37
|
-
const [loading, setLoading] = useState(true);
|
|
38
|
-
const [notFound, setNotFound] = useState(false);
|
|
39
|
-
|
|
40
|
-
const loadData = useCallback(async () => {
|
|
41
|
-
try {
|
|
42
|
-
const diagnostics = await getNetworkDiagnosticsConsumer();
|
|
43
|
-
const { device: deviceData } = await diagnostics.tools.getDeviceDetails({ deviceId });
|
|
44
|
-
|
|
45
|
-
if (!deviceData) {
|
|
46
|
-
setNotFound(true);
|
|
47
|
-
} else {
|
|
48
|
-
setDevice(deviceData);
|
|
49
|
-
setNotFound(false);
|
|
50
|
-
}
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error("Error loading device details:", error);
|
|
53
|
-
setNotFound(true);
|
|
54
|
-
} finally {
|
|
55
|
-
setLoading(false);
|
|
56
|
-
}
|
|
57
|
-
}, [deviceId]);
|
|
58
|
-
|
|
59
|
-
const handleDisconnect = async () => {
|
|
60
|
-
if (!confirm("Are you sure you want to disconnect from this device?")) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
const control = await getNetworkControlConsumer();
|
|
66
|
-
const result = await control.tools.disconnectDevice({ deviceId });
|
|
67
|
-
if (!result.success) {
|
|
68
|
-
alert(result.message);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
onDisconnect?.();
|
|
72
|
-
onClose();
|
|
73
|
-
} catch (error) {
|
|
74
|
-
console.error("Error disconnecting device:", error);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
loadData();
|
|
80
|
-
// Auto-refresh every 5 seconds
|
|
81
|
-
const interval = setInterval(loadData, 5000);
|
|
82
|
-
return () => clearInterval(interval);
|
|
83
|
-
}, [loadData]);
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<div
|
|
87
|
-
className="position-fixed top-0 start-0 w-100 h-100 d-flex align-items-start justify-content-center"
|
|
88
|
-
style={{
|
|
89
|
-
backgroundColor: "rgba(0,0,0,0.5)",
|
|
90
|
-
zIndex: 1050,
|
|
91
|
-
overflowY: "auto",
|
|
92
|
-
paddingTop: "2rem",
|
|
93
|
-
paddingBottom: "2rem",
|
|
94
|
-
}}
|
|
95
|
-
onClick={onClose}
|
|
96
|
-
>
|
|
97
|
-
<div
|
|
98
|
-
className="card"
|
|
99
|
-
style={{ maxWidth: "900px", width: "90%", maxHeight: "90vh" }}
|
|
100
|
-
onClick={(e) => e.stopPropagation()}
|
|
101
|
-
>
|
|
102
|
-
{/* Header */}
|
|
103
|
-
<div className="card-header d-flex justify-content-between align-items-center">
|
|
104
|
-
<div>
|
|
105
|
-
<h5 className="mb-0">
|
|
106
|
-
{loading ? "Loading..." : device?.userName || device?.userId || "Device Details"}
|
|
107
|
-
</h5>
|
|
108
|
-
{device?.userName && (
|
|
109
|
-
<small className="text-muted">
|
|
110
|
-
<code>{device.userId}</code>
|
|
111
|
-
</small>
|
|
112
|
-
)}
|
|
113
|
-
</div>
|
|
114
|
-
<div>
|
|
115
|
-
{device && (
|
|
116
|
-
<button className="btn btn-sm btn-danger me-2" onClick={handleDisconnect}>
|
|
117
|
-
<i className="bi bi-x-circle"></i> Disconnect
|
|
118
|
-
</button>
|
|
119
|
-
)}
|
|
120
|
-
<button className="btn-close" onClick={onClose} aria-label="Close"></button>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
{/* Body */}
|
|
125
|
-
<div className="card-body" style={{ overflowY: "auto", maxHeight: "calc(90vh - 120px)" }}>
|
|
126
|
-
{loading && <LoadingIndicator />}
|
|
127
|
-
|
|
128
|
-
{!loading && (notFound || !device) && (
|
|
129
|
-
<div className="alert alert-warning">
|
|
130
|
-
Device not found or connection has been closed.
|
|
131
|
-
</div>
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
{!loading && device && (
|
|
135
|
-
<>
|
|
136
|
-
{/* Connection Info */}
|
|
137
|
-
<div className="mb-4">
|
|
138
|
-
<h6 className="border-bottom pb-2 mb-3">Connection Information</h6>
|
|
139
|
-
<div className="row">
|
|
140
|
-
{device.deviceName && (
|
|
141
|
-
<div className="col-md-6 mb-3">
|
|
142
|
-
<strong>Device Name:</strong>
|
|
143
|
-
<br />
|
|
144
|
-
<span>{device.deviceName}</span>
|
|
145
|
-
</div>
|
|
146
|
-
)}
|
|
147
|
-
<div className="col-md-6 mb-3">
|
|
148
|
-
<strong>Device ID:</strong>
|
|
149
|
-
<br />
|
|
150
|
-
<code className="text-muted small">{device.deviceId}</code>
|
|
151
|
-
</div>
|
|
152
|
-
<div className="col-md-6 mb-3">
|
|
153
|
-
<strong>Connection State:</strong>
|
|
154
|
-
<br />
|
|
155
|
-
<span className="badge bg-success">{device.connectionState}</span>
|
|
156
|
-
</div>
|
|
157
|
-
<div className="col-md-6 mb-3">
|
|
158
|
-
<strong>User Trust:</strong>
|
|
159
|
-
<br />
|
|
160
|
-
<TrustLevelBadge level={device.userTrustLevel || TrustLevel.Unknown} />
|
|
161
|
-
</div>
|
|
162
|
-
<div className="col-md-6 mb-3">
|
|
163
|
-
<strong>Device Trust:</strong>
|
|
164
|
-
<br />
|
|
165
|
-
<TrustLevelBadge level={device.deviceTrustLevel || TrustLevel.Unknown} />
|
|
166
|
-
</div>
|
|
167
|
-
<div className="col-md-6 mb-3">
|
|
168
|
-
<strong>Path Type:</strong>
|
|
169
|
-
<br />
|
|
170
|
-
<span
|
|
171
|
-
className={`badge bg-${device.pathType === "direct" ? "success" : "info"}`}
|
|
172
|
-
>
|
|
173
|
-
{device.pathType}
|
|
174
|
-
</span>
|
|
175
|
-
</div>
|
|
176
|
-
{device.throughDeviceIds && device.throughDeviceIds.length > 0 && (
|
|
177
|
-
<div className="col-md-12 mb-3">
|
|
178
|
-
<strong>Path:</strong>
|
|
179
|
-
<br />
|
|
180
|
-
<small className="text-muted">{device.throughDeviceIds.join(" → ")}</small>
|
|
181
|
-
</div>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
{/* Throughput Stats */}
|
|
187
|
-
<div className="mb-4">
|
|
188
|
-
<h6 className="border-bottom pb-2 mb-3">Throughput</h6>
|
|
189
|
-
<div className="row">
|
|
190
|
-
<div className="col-md-6 mb-3">
|
|
191
|
-
<strong>Send Rate:</strong>
|
|
192
|
-
<br />
|
|
193
|
-
<span className="text-success">↑ {formatRate(device.sendRateMBps)}</span>
|
|
194
|
-
</div>
|
|
195
|
-
<div className="col-md-6 mb-3">
|
|
196
|
-
<strong>Receive Rate:</strong>
|
|
197
|
-
<br />
|
|
198
|
-
<span className="text-primary">↓ {formatRate(device.receiveRateMBps)}</span>
|
|
199
|
-
</div>
|
|
200
|
-
<div className="col-md-6 mb-3">
|
|
201
|
-
<strong>Total Sent:</strong>
|
|
202
|
-
<br />
|
|
203
|
-
<span>{formatBytes(device.bytesSent || 0)}</span>
|
|
204
|
-
</div>
|
|
205
|
-
<div className="col-md-6 mb-3">
|
|
206
|
-
<strong>Total Received:</strong>
|
|
207
|
-
<br />
|
|
208
|
-
<span>{formatBytes(device.bytesReceived || 0)}</span>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
|
|
213
|
-
{device.canReadRemoteLogs && <RemoteLogsPanel deviceId={device.deviceId} />}
|
|
214
|
-
{device.canReadRemoteLogs && (
|
|
215
|
-
<div className="mb-4">
|
|
216
|
-
<RemoteAppUpdatePanel deviceId={device.deviceId} deviceName={device.deviceName} />
|
|
217
|
-
</div>
|
|
218
|
-
)}
|
|
219
|
-
|
|
220
|
-
{/* Shared Groups */}
|
|
221
|
-
{device.sharedGroups.length > 0 && (
|
|
222
|
-
<div className="mb-4">
|
|
223
|
-
<h6 className="border-bottom pb-2 mb-3">
|
|
224
|
-
Shared Groups ({device.sharedGroups.length})
|
|
225
|
-
</h6>
|
|
226
|
-
<div className="table-responsive">
|
|
227
|
-
<table className="table table-sm table-hover">
|
|
228
|
-
<thead>
|
|
229
|
-
<tr>
|
|
230
|
-
<th>Group ID</th>
|
|
231
|
-
<th>Role</th>
|
|
232
|
-
<th>Sync Status</th>
|
|
233
|
-
</tr>
|
|
234
|
-
</thead>
|
|
235
|
-
<tbody>
|
|
236
|
-
{device.sharedGroups.map((groupId) => {
|
|
237
|
-
const syncStats = device.syncStatsByGroup[groupId];
|
|
238
|
-
const role = device.roles[groupId];
|
|
239
|
-
return (
|
|
240
|
-
<tr key={groupId}>
|
|
241
|
-
<td>
|
|
242
|
-
<code className="text-muted small">{groupId}</code>
|
|
243
|
-
</td>
|
|
244
|
-
<td>{role != null ? String(role) : "N/A"}</td>
|
|
245
|
-
<td>
|
|
246
|
-
{syncStats ? (
|
|
247
|
-
<>
|
|
248
|
-
{syncStats.isPreferred && (
|
|
249
|
-
<span className="badge bg-primary me-2">Preferred</span>
|
|
250
|
-
)}
|
|
251
|
-
<small className="text-muted">
|
|
252
|
-
{new Date(syncStats.lastSyncTime).toLocaleString()}
|
|
253
|
-
</small>
|
|
254
|
-
</>
|
|
255
|
-
) : (
|
|
256
|
-
<span className="text-muted">-</span>
|
|
257
|
-
)}
|
|
258
|
-
</td>
|
|
259
|
-
</tr>
|
|
260
|
-
);
|
|
261
|
-
})}
|
|
262
|
-
</tbody>
|
|
263
|
-
</table>
|
|
264
|
-
</div>
|
|
265
|
-
</div>
|
|
266
|
-
)}
|
|
267
|
-
|
|
268
|
-
{/* Remote Network Info */}
|
|
269
|
-
{device.networkInfo && (
|
|
270
|
-
<div className="mb-4">
|
|
271
|
-
<h6 className="border-bottom pb-2 mb-3">Remote Device Network Info</h6>
|
|
272
|
-
<div className="row mb-3">
|
|
273
|
-
<div className="col-md-3 mb-3">
|
|
274
|
-
<strong>CPU Usage:</strong>
|
|
275
|
-
<br />
|
|
276
|
-
<span className="h5">{device.networkInfo.cpuPercent.toFixed(1)}%</span>
|
|
277
|
-
</div>
|
|
278
|
-
<div className="col-md-3 mb-3">
|
|
279
|
-
<strong>Memory Usage:</strong>
|
|
280
|
-
<br />
|
|
281
|
-
<span className="h5">{device.networkInfo.memPercent.toFixed(1)}%</span>
|
|
282
|
-
</div>
|
|
283
|
-
<div className="col-md-3 mb-3">
|
|
284
|
-
<strong>Connection Slots:</strong>
|
|
285
|
-
<br />
|
|
286
|
-
<span className="h5">{device.networkInfo.connectionSlotsAvailable}</span>
|
|
287
|
-
</div>
|
|
288
|
-
<div className="col-md-3 mb-3">
|
|
289
|
-
<strong>Total Connections:</strong>
|
|
290
|
-
<br />
|
|
291
|
-
<span className="h5">{device.networkInfo.connections.length}</span>
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
|
|
295
|
-
{device.networkInfo.preferredDeviceIds.length > 0 && (
|
|
296
|
-
<div className="mb-3">
|
|
297
|
-
<strong>Preferred Devices:</strong>
|
|
298
|
-
<ul className="list-unstyled mt-2 ms-3">
|
|
299
|
-
{device.networkInfo.preferredDeviceIds.map((prefDeviceId) => (
|
|
300
|
-
<li key={prefDeviceId}>
|
|
301
|
-
<code className="text-muted small">{prefDeviceId}</code>
|
|
302
|
-
</li>
|
|
303
|
-
))}
|
|
304
|
-
</ul>
|
|
305
|
-
</div>
|
|
306
|
-
)}
|
|
307
|
-
|
|
308
|
-
{device.networkInfo.connections.length > 0 && (
|
|
309
|
-
<div>
|
|
310
|
-
<strong>Remote Connections ({device.networkInfo.connections.length}):</strong>
|
|
311
|
-
<div className="table-responsive mt-2">
|
|
312
|
-
<table className="table table-sm table-hover">
|
|
313
|
-
<thead>
|
|
314
|
-
<tr>
|
|
315
|
-
<th>Device ID</th>
|
|
316
|
-
</tr>
|
|
317
|
-
</thead>
|
|
318
|
-
<tbody>
|
|
319
|
-
{device.networkInfo.connections.map((conn, idx: number) => (
|
|
320
|
-
<tr key={idx}>
|
|
321
|
-
<td>
|
|
322
|
-
<code className="text-muted small">{conn.deviceId}</code>
|
|
323
|
-
</td>
|
|
324
|
-
</tr>
|
|
325
|
-
))}
|
|
326
|
-
</tbody>
|
|
327
|
-
</table>
|
|
328
|
-
</div>
|
|
329
|
-
</div>
|
|
330
|
-
)}
|
|
331
|
-
</div>
|
|
332
|
-
)}
|
|
333
|
-
</>
|
|
334
|
-
)}
|
|
335
|
-
</div>
|
|
336
|
-
</div>
|
|
337
|
-
</div>
|
|
338
|
-
);
|
|
339
|
-
}
|