fix: no clusters tips in adding worker modal

This commit is contained in:
jialin
2026-01-06 17:21:32 +08:00
parent f8ae7680ad
commit 0ba8300959
18 changed files with 91 additions and 63 deletions
@@ -1,13 +1,13 @@
import BaseSelect from '@/components/seal-form/base/select';
import { useIntl } from '@umijs/max';
import { Spin } from 'antd';
import { Spin, Typography } from 'antd';
import { useEffect } from 'react';
import { useAddWorkerContext } from './add-worker-context';
import { StepNamesMap } from './config';
import { AddWorkerStepProps, StepNamesMap } from './config';
import { Title } from './constainers';
import StepCollapse from './step-collapse';
const SelectCluster = () => {
const SelectCluster: React.FC<AddWorkerStepProps> = ({ disabled }) => {
const {
clusterList,
clusterLoading,
@@ -42,6 +42,7 @@ const SelectCluster = () => {
return (
<StepCollapse
disabled={disabled}
name={StepNamesMap.SelectCluster}
title={
<div>
@@ -65,6 +66,11 @@ const SelectCluster = () => {
onChange={onClusterChange}
style={{ width: '100%' }}
/>
{!clusterLoading && !clusterList?.length && (
<Typography.Text type="danger">
{intl.formatMessage({ id: 'clusters.addworker.noClusters' })}
</Typography.Text>
)}
</Spin>
</StepCollapse>
);