From 422bc0d020dac333ce2b12b7c51acbc91769f842 Mon Sep 17 00:00:00 2001 From: Ming Wang Date: Wed, 4 Oct 2023 15:32:39 -0400 Subject: [PATCH] ArchiveRecordingCreated --- src/app/Agent/AgentLiveProbes.tsx | 2 +- src/app/RecordingMetadata/BulkEditLabels.tsx | 2 +- src/app/Recordings/ActiveRecordingsTable.tsx | 8 ++++---- src/app/Recordings/ArchivedRecordingsTable.tsx | 6 +++--- src/app/Topology/Entity/utils.tsx | 8 ++++++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/app/Agent/AgentLiveProbes.tsx b/src/app/Agent/AgentLiveProbes.tsx index 9b2f01d1ea..3830319866 100644 --- a/src/app/Agent/AgentLiveProbes.tsx +++ b/src/app/Agent/AgentLiveProbes.tsx @@ -210,7 +210,7 @@ export const AgentLiveProbes: React.FC = (_) => { context.target.target(), context.notificationChannel.messages(NotificationCategory.ProbeTemplateApplied), ]).subscribe(([currentTarget, e]) => { - if (currentTarget?.connectUrl != e.message.targetId && currentTarget?.jvmId != e.message.jvmId) { + if (currentTarget?.jvmId != e.message.jvmId) { return; } setProbes((old) => { diff --git a/src/app/RecordingMetadata/BulkEditLabels.tsx b/src/app/RecordingMetadata/BulkEditLabels.tsx index e47f92a3fa..b3717bbd26 100644 --- a/src/app/RecordingMetadata/BulkEditLabels.tsx +++ b/src/app/RecordingMetadata/BulkEditLabels.tsx @@ -246,7 +246,7 @@ export const BulkEditLabels: React.FC = ({ ]).subscribe((parts) => { const currentTarget = parts[0]; const event = parts[1]; - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => diff --git a/src/app/Recordings/ActiveRecordingsTable.tsx b/src/app/Recordings/ActiveRecordingsTable.tsx index 9f385e7ab3..cf0f8aa9e8 100644 --- a/src/app/Recordings/ActiveRecordingsTable.tsx +++ b/src/app/Recordings/ActiveRecordingsTable.tsx @@ -251,7 +251,7 @@ export const ActiveRecordingsTable: React.FC = (prop context.notificationChannel.messages(NotificationCategory.SnapshotCreated), ), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => old.concat([event.message.recording])); @@ -268,7 +268,7 @@ export const ActiveRecordingsTable: React.FC = (prop context.notificationChannel.messages(NotificationCategory.SnapshotDeleted), ), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } @@ -284,7 +284,7 @@ export const ActiveRecordingsTable: React.FC = (prop context.target.target(), context.notificationChannel.messages(NotificationCategory.ActiveRecordingStopped), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => { @@ -315,7 +315,7 @@ export const ActiveRecordingsTable: React.FC = (prop context.target.target(), context.notificationChannel.messages(NotificationCategory.RecordingMetadataUpdated), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => diff --git a/src/app/Recordings/ArchivedRecordingsTable.tsx b/src/app/Recordings/ArchivedRecordingsTable.tsx index c2f9a470d7..1fdf3d593c 100644 --- a/src/app/Recordings/ArchivedRecordingsTable.tsx +++ b/src/app/Recordings/ArchivedRecordingsTable.tsx @@ -310,7 +310,7 @@ export const ArchivedRecordingsTable: React.FC = ( context.notificationChannel.messages(NotificationCategory.ActiveRecordingSaved), ), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => @@ -326,7 +326,7 @@ export const ArchivedRecordingsTable: React.FC = ( propsTarget, context.notificationChannel.messages(NotificationCategory.ArchivedRecordingDeleted), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => old.filter((r) => r.name !== event.message.recording.name)); @@ -341,7 +341,7 @@ export const ArchivedRecordingsTable: React.FC = ( propsTarget, context.notificationChannel.messages(NotificationCategory.RecordingMetadataUpdated), ]).subscribe(([currentTarget, event]) => { - if (currentTarget?.connectUrl != event.message.target && currentTarget?.jvmId != event.message.jvmId) { + if (currentTarget?.jvmId != event.message.jvmId) { return; } setRecordings((old) => diff --git a/src/app/Topology/Entity/utils.tsx b/src/app/Topology/Entity/utils.tsx index cc1ee43135..660bba339e 100644 --- a/src/app/Topology/Entity/utils.tsx +++ b/src/app/Topology/Entity/utils.tsx @@ -276,6 +276,10 @@ export const getConnectUrlFromEvent = (event: NotificationMessage): string | und return event.message.target || event.message.targetId; }; +export const getJvmIdFromEvent = (event: NotificationMessage): string | undefined => { + return event.message.jvmId; +}; + export const useResources = ( targetNode: TargetNode, resourceType: TargetOwnedResourceType | TargetRelatedResourceType, @@ -344,9 +348,9 @@ export const useResources = ( ), ) .subscribe(([targetNode, event]) => { - const extractedUrl = getConnectUrlFromEvent(event); + const extractedJvmId = getJvmIdFromEvent(event); const isOwned = isOwnedResource(resourceType); - if (!isOwned || (extractedUrl && extractedUrl === targetNode.target.connectUrl)) { + if (!isOwned || (extractedJvmId && extractedJvmId === targetNode.target.jvmId)) { setLoading(true); setResources((old) => { // Avoid accessing state directly, which