Skip to content

Commit

Permalink
Merge pull request #972 from hpcc-systems/yadhap/Unreachable-label-on-JM
Browse files Browse the repository at this point in the history
Added cluster unreachable label on JM table, if a cluster for a JM is…
  • Loading branch information
FancMa01 authored Dec 9, 2024
2 parents 7d306b9 + c4ab172 commit a29b51c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Table, Tooltip, Popconfirm, message, Popover } from 'antd';
import React, { useState, useEffect } from 'react';
import { Table, Tooltip, Popconfirm, message, Popover, Tag } from 'antd';
import {
EyeOutlined,
EditOutlined,
Expand All @@ -10,6 +10,7 @@ import {
PauseCircleOutlined,
CopyOutlined,
DownOutlined,
WarningFilled,
} from '@ant-design/icons';
import { Link } from 'react-router-dom';
import { useSelector } from 'react-redux';
Expand Down Expand Up @@ -41,7 +42,10 @@ const JobMonitoringTable = ({
domains,
allProductCategories,
filteringJobs,
clusters,
}) => {
// States
const [unreachableClusters, setUnreachableClusters] = useState([]);
//Redux
const {
applicationReducer: {
Expand All @@ -54,6 +58,14 @@ const JobMonitoringTable = ({
(integration) => integration.name === 'ASR' && integration.application_id === applicationId
);

// Cluster that is not able to establish connection
useEffect(() => {
if (clusters.length > 0) {
const ids = clusters.filter((c) => c.reachabilityInfo && c.reachabilityInfo.reachable === false).map((c) => c.id);
setUnreachableClusters(ids);
}
}, [clusters]);

// Columns for the table
const columns = [
{
Expand Down Expand Up @@ -182,6 +194,18 @@ const JobMonitoringTable = ({
</>
),
},
{
key: (_, record) => record.id,
width: 80,
render: (_, record) => {
return unreachableClusters.includes(record.clusterId) ? (
<Tag color="black">
<WarningFilled style={{ color: 'yellow', fontSize: '0.8rem', marginRight: '5px' }} />
Cluster not reachable
</Tag>
) : null;
},
},
];

// If ASR integration on add couple asr specific columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ function JobMonitoring() {
productCategories={productCategories}
allProductCategories={allProductCategories}
filteringJobs={filteringJobs}
clusters={clusters}
/>
{displayMonitoringDetailsModal && (
<MonitoringDetailsModal
Expand Down

0 comments on commit a29b51c

Please sign in to comment.