Skip to content

Commit

Permalink
Merge pull request #341 from kube-HPC/release2_6_p3
Browse files Browse the repository at this point in the history
Release2_6_p3
  • Loading branch information
RonShvarz authored Nov 29, 2023
2 parents e62e557 + 2be81b1 commit 6a82129
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simulator",
"version": "2.6.28",
"version": "2.6.29",
"description": "The Hkube Dashboard",
"private": true,
"homepage": ".",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const InputNumberSwitch = forwardRef(
},
ref
) => {
const [disabled, setDisabled] = useState(value > 0);
const [disabled, setDisabled] = useState(!(value > 0));
const [numberValue, setNumberValue] = useState(value);

// Handle the switch change event
Expand Down
7 changes: 6 additions & 1 deletion src/Routes/Tables/Algorithms/AlgorithmsQueryTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const AlgorithmsQueryTable = ({ onSubmit, algorithmsList }) => {

useEffect(() => {
if (instanceFilters.algorithms.qAlgorithmName === null) {
form.resetFields();
const qAlgorithmNameValue = form.getFieldValue('qAlgorithmName');
if (qAlgorithmNameValue !== '') {
form.resetFields();
}

setTimeout(() => {
SubmitForm(null);
}, 100);
Expand Down Expand Up @@ -74,6 +78,7 @@ const AlgorithmsQueryTable = ({ onSubmit, algorithmsList }) => {
filterOption={(inputValue, option) =>
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
autoFocus
allowClear
onSearch={submitDebounced}
onSelect={SubmitForm}
Expand Down
23 changes: 14 additions & 9 deletions src/Routes/Tables/Algorithms/columns.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import { WarningOutlined } from '@ant-design/icons';
import { Tag } from 'antd';
import { Tag, Tooltip, Typography } from 'antd';
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 AlgorithmActions from './AlgorithmActions.react';
import AlgorithmBuildStats from './AlgorithmBuildStats.react';
Expand All @@ -18,7 +19,11 @@ const Memory = mem => <Tag>{mem || 'No Memory Specified'}</Tag>;
const Cpu = cpu => <Tag>{cpu || 'No CPU Assigned'}</Tag>;
const Image = algorithmImage =>
algorithmImage ? (
<Ellipsis copyable text={algorithmImage} length={50} />
<Tooltip title={algorithmImage}>
<Typography.Text onClick={() => copyToClipboard(algorithmImage)}>
{algorithmImage}
</Typography.Text>
</Tooltip>
) : (
<Tag>No Image</Tag>
);
Expand All @@ -39,9 +44,8 @@ const renderAction = (_, record) => <AlgorithmActions record={record} />;
const sortByName = (a, b) => sorter(a.name, b.name);
const filterByImage = (value, record) => record.algorithmImage.includes(value);
const sortByImage = (a, b) => sorter(a.algorithmImage, b.algorithmImage);
const sortByMinHotWorkers = (a, b) => sorter(a.workerImage, b.workerImage);
const sortByMinHotWorkers = (a, b) => sorter(a.minHotWorkers, b.minHotWorkers);
const sortByLastModified = (a, b) => sorter(a.modified, b.modified);

export default [
{
width: '12%',
Expand All @@ -52,6 +56,7 @@ export default [
render: Name,
},
{
width: '40%',
title: 'Algorithm Image',
dataIndex: ['algorithmImage'],
key: 'algorithmImage',
Expand All @@ -60,28 +65,28 @@ export default [
render: Image,
},
{
width: '10%',
width: '7%',
title: 'Builds Stats',
dataIndex: ['buildStats'],
key: 'builds',
render: BuildStats,
},
{
width: '10%',
width: '5%',
title: 'CPU',
dataIndex: ['cpu'],
key: 'cpu',
render: Cpu,
},
{
width: '10%',
width: '5%',
title: 'Mem',
dataIndex: ['mem'],
key: 'mem',
render: Memory,
},
{
width: '10%',
width: '7%',
title: 'Min Hot Workers',
dataIndex: ['minHotWorkers'],
key: 'minHotWorkers',
Expand All @@ -97,7 +102,7 @@ export default [
render: LastModified,
},
{
width: '20%',
width: '14%',
title: 'Action',
dataIndex: ['action'],
key: 'action',
Expand Down
1 change: 1 addition & 0 deletions src/Routes/Tables/Jobs/QueryTable/QueryForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const QueryForm = ({ onSubmit, params, zoomDate }) => {
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
allowClear
autoFocus
onSearch={SubmitForm}
onSelect={SubmitForm}
onClear={SubmitForm}
Expand Down
6 changes: 5 additions & 1 deletion src/Routes/Tables/Pipelines/PipelinesQueryTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const PipelinesQueryTable = ({ onSubmit, pipelinesList }) => {

useEffect(() => {
if (instanceFilters.pipelines.qPipelineName === null) {
form.resetFields();
const qqPipelineNameValue = form.getFieldValue('qPipelineName');
if (qqPipelineNameValue !== '') {
form.resetFields();
}
setTimeout(() => {
SubmitForm(null);
}, 100);
Expand Down Expand Up @@ -72,6 +75,7 @@ const PipelinesQueryTable = ({ onSubmit, pipelinesList }) => {
filterOption={(inputValue, option) =>
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
autoFocus
allowClear
onSearch={submitDebounced}
onSelect={SubmitForm}
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ const useWizard = (
);

const setForm = useCallback(() => {
setValuesState(getFormattedFormValues());
setTimeout(() => {
setValuesState(getFormattedFormValues());
}, 100);
}, [getFormattedFormValues, setValuesState]);

return {
Expand Down

0 comments on commit 6a82129

Please sign in to comment.