Skip to content

Commit

Permalink
Merge pull request #377 from kube-HPC/add-isSatisfied
Browse files Browse the repository at this point in the history
add isSatisfied
  • Loading branch information
zivglik authored Jul 25, 2024
2 parents 95a6f35 + 1c0b3b0 commit ea05104
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Routes/Tables/Algorithms/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ import Moment from 'react-moment';
import { Ellipsis } from 'components/common';
import { sorter } from 'utils/stringHelper';
import { copyToClipboard } from 'utils';
import { errorsCode } from '@hkube/consts';
import { COLOR_PIPELINE_STATUS } from 'styles/colors';
import { pipelineStatuses as PIPELINE_STATUS, errorsCode } from '@hkube/consts';
import AlgorithmActions from './AlgorithmActions.react';
import AlgorithmBuildStats from './AlgorithmBuildStats.react';

const { FAILED } = PIPELINE_STATUS;
const LastModified = timestamp => (
<Tag>
<Moment format="DD/MM/YY HH:mm:ss">{+timestamp}</Moment>
</Tag>
);
const HotWorkers = minHotWorkers => <Tag>{minHotWorkers}</Tag>;
// eslint-disable-next-line react/prop-types, no-unused-vars
const HotWorkers = ({ minHotWorkers, isSatisfied }) => (
<Tag
title={!isSatisfied ? 'isSatisfied' : null}
color={!isSatisfied ? COLOR_PIPELINE_STATUS[FAILED] : ''}>
{minHotWorkers}
</Tag>
);
const Memory = mem => <Tag>{mem || 'No Memory Specified'}</Tag>;
const Cpu = cpu => <Tag>{cpu || 'No CPU Assigned'}</Tag>;
const Image = algorithmImage =>
Expand Down Expand Up @@ -88,7 +97,6 @@ export default [
{
width: '7%',
title: 'Min Hot Workers',
dataIndex: ['minHotWorkers'],
key: 'minHotWorkers',
sorter: sortByMinHotWorkers,
render: HotWorkers,
Expand Down
2 changes: 2 additions & 0 deletions src/graphql/queries/algorithms-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ALGORITHMS_QUERY = gql`
gpu
mem
minHotWorkers
isSatisfied
modified
reservedMemory
type
Expand Down Expand Up @@ -52,6 +53,7 @@ const ALGORITHMS_QUERY = gql`
stopped
}
}
algorithmsCount
}
}
Expand Down

0 comments on commit ea05104

Please sign in to comment.