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

Update name algo by unsheduled reason #379

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
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
39 changes: 18 additions & 21 deletions src/Routes/Tables/Algorithms/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,17 @@ import Moment from 'react-moment';
import { Ellipsis } from 'components/common';
import { sorter } from 'utils/stringHelper';
import { copyToClipboard } from 'utils';
import { COLOR_PIPELINE_STATUS } from 'styles/colors';
import { pipelineStatuses as PIPELINE_STATUS, errorsCode } from '@hkube/consts';
import { 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>
);
// 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 HotWorkers = ({ minHotWorkers }) => <Tag>{minHotWorkers}</Tag>;
const Memory = mem => <Tag>{mem || 'No Memory Specified'}</Tag>;
const Cpu = cpu => <Tag>{cpu || 'No CPU Assigned'}</Tag>;
const Image = algorithmImage =>
Expand All @@ -36,17 +28,22 @@ const Image = algorithmImage =>
) : (
<Tag>No Image</Tag>
);
const Name = (name, record) => (
<Ellipsis>
{name}{' '}
{record?.errors?.includes(errorsCode.NOT_LAST_VERSION_ALGORITHM) && (
<WarningOutlined
title="Warning : Set algorithm's current version to the newly built"
style={{ color: 'red', fontSize: '15px' }}
/>
)}
</Ellipsis>
);
const Name = (name, record) =>
record?.unscheduledReason ? (
<Tooltip title={record?.unscheduledReason}>
<Typography style={{ color: 'red' }}>{name}</Typography>
</Tooltip>
) : (
<Ellipsis>
{name}{' '}
{record?.errors?.includes(errorsCode.NOT_LAST_VERSION_ALGORITHM) && (
<WarningOutlined
title="Warning : Set algorithm's current version to the newly built"
style={{ color: 'red', fontSize: '15px' }}
/>
)}
</Ellipsis>
);
const BuildStats = builds => <AlgorithmBuildStats builds={builds} />;
const renderAction = (_, record) => <AlgorithmActions record={record} />;

Expand Down
2 changes: 1 addition & 1 deletion src/graphql/queries/algorithms-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const ALGORITHMS_QUERY = gql`
env
gpu
mem
unscheduledReason
minHotWorkers
isSatisfied
modified
reservedMemory
type
Expand Down
Loading