fix: cluster filter do not work in dashboard
This commit is contained in:
@@ -71,6 +71,7 @@ const ClusterCreate = () => {
|
||||
provider: ProviderValueMap.Docker
|
||||
} as ClusterFormData);
|
||||
const [formValues, setFormValues] = useState<Record<string, any>>({});
|
||||
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
|
||||
|
||||
const formRefs: Record<string, any> = {
|
||||
[moduleMap.BasicForm]: useRef<any>(null),
|
||||
@@ -273,8 +274,10 @@ const ClusterCreate = () => {
|
||||
...extraData,
|
||||
...(typeof values === 'object' ? values : {})
|
||||
};
|
||||
setSubmitLoading(true);
|
||||
const res = await createCluster({ data });
|
||||
const info = await queryClusterToken({ id: res.id });
|
||||
setSubmitLoading(false);
|
||||
setRegistrationInfo({
|
||||
...info,
|
||||
cluster_id: res.id
|
||||
@@ -318,6 +321,7 @@ const ClusterCreate = () => {
|
||||
onNext={onNext}
|
||||
handleCancel={handleCancel}
|
||||
handleSubmit={handleSubmit}
|
||||
loading={submitLoading}
|
||||
showButtons={showButtons}
|
||||
/>
|
||||
]}
|
||||
|
||||
@@ -20,10 +20,18 @@ interface FooterButtonsProps {
|
||||
handleCancel: () => void;
|
||||
handleSubmit: () => void;
|
||||
showButtons: Record<string, boolean>;
|
||||
loading?: boolean;
|
||||
}
|
||||
|
||||
const FooterButtons: React.FC<FooterButtonsProps> = (props) => {
|
||||
const { onPrevious, onNext, handleCancel, handleSubmit, showButtons } = props;
|
||||
const {
|
||||
onPrevious,
|
||||
onNext,
|
||||
handleCancel,
|
||||
handleSubmit,
|
||||
showButtons,
|
||||
loading
|
||||
} = props;
|
||||
const intl = useIntl();
|
||||
const handleOnNext = () => {
|
||||
onNext();
|
||||
@@ -52,6 +60,7 @@ const FooterButtons: React.FC<FooterButtonsProps> = (props) => {
|
||||
type="primary"
|
||||
onClick={handleSubmit}
|
||||
style={{ minWidth: 88 }}
|
||||
loading={loading}
|
||||
>
|
||||
{intl.formatMessage({ id: 'common.button.save' })}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user