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

chore(topology): check for jvmId in notifications from Cryostat #1152

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/app/Topology/Entity/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ export const getExpandedResourceDetails = (
export const getConnectUrlFromEvent = (event: NotificationMessage): string | undefined => {
return event.message.target || event.message.targetId;
};
export const getJvmIdFromEvent = (event: NotificationMessage): string | undefined => {
return event.message.jvmId;
};

export const useResources = <R = ResourceTypes,>(
targetNode: TargetNode,
Expand Down Expand Up @@ -344,8 +347,13 @@ export const useResources = <R = ResourceTypes,>(
)
.subscribe(([targetNode, event]) => {
const extractedUrl = getConnectUrlFromEvent(event);
const extractedJvmId = getJvmIdFromEvent(event);
const isOwned = isOwnedResource(resourceType);
if (!isOwned || (extractedUrl && extractedUrl === targetNode.target.connectUrl)) {
if (
!isOwned ||
(extractedUrl && extractedUrl === targetNode.target.connectUrl) ||
(extractedJvmId && extractedJvmId === targetNode.target.jvmId)
) {
setLoading(true);
setResources((old) => {
// Avoid accessing state directly, which
Expand Down
Loading