Skip to content

Commit

Permalink
fix dropmenu disable and Parameters search in clusterDetail
Browse files Browse the repository at this point in the history
  • Loading branch information
TianWuwt committed Dec 25, 2024
1 parent 0f2d339 commit cd09566
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions ui/src/pages/Cluster/Detail/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ const ClusterOverview: React.FC = () => {
<Button
onClick={handleAddZone}
disabled={
clusterDetail?.status === 'operating' ||
clusterDetail?.status === 'failed'
!isEmpty(clusterDetail) && clusterDetail?.status !== 'running'
}
type="text"
>
Expand All @@ -174,8 +173,7 @@ const ClusterOverview: React.FC = () => {
<Button
type="text"
disabled={
clusterDetail?.status === 'operating' ||
clusterDetail?.status === 'failed'
!isEmpty(clusterDetail) && clusterDetail?.status !== 'running'
}
onClick={handleUpgrade}
>
Expand Down Expand Up @@ -442,10 +440,7 @@ const ClusterOverview: React.FC = () => {
),
dataIndex: 'accordance',
width: 100,
render: (text: boolean, record: any) => {
if (!record?.controlParameter) {
return '-';
}
render: (text: boolean) => {
const tagColor = text ? 'green' : 'gold';
const tagContent = text
? intl.formatMessage({
Expand Down Expand Up @@ -641,30 +636,32 @@ const ClusterOverview: React.FC = () => {
const newParametersData = getNewData(
listOBClusterParameters?.data,
);

if (name) {
if (name !== undefined) {
setParametersData(
newParametersData?.filter((item) =>
item.name?.includes(name),
),
);
}
if (controlParameter) {
if (controlParameter !== undefined) {
setParametersData(
newParametersData?.filter(
(item) =>
item.controlParameter === controlParameter,
),
);
}
if (accordance) {
if (accordance !== undefined) {
setParametersData(
newParametersData?.filter(
(item) => item.accordance === accordance,
),
);
}
if (!!name && !!controlParameter) {
if (
name !== undefined &&
controlParameter !== undefined
) {
setParametersData(
newParametersData?.filter(
(item) =>
Expand All @@ -673,7 +670,7 @@ const ClusterOverview: React.FC = () => {
),
);
}
if (!!name && !!accordance) {
if (name !== undefined && accordance !== undefined) {
setParametersData(
newParametersData?.filter(
(item) =>
Expand All @@ -682,7 +679,11 @@ const ClusterOverview: React.FC = () => {
),
);
}
if (!!name && !!controlParameter && !!accordance) {
if (
name !== undefined &&
controlParameter !== undefined &&
accordance !== undefined
) {
setParametersData(
newParametersData?.filter(
(item) =>
Expand Down

0 comments on commit cd09566

Please sign in to comment.