fix: register cluster modal
This commit is contained in:
@@ -72,6 +72,7 @@ const Credentials: React.FC = () => {
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [registerClusterStatus, setRegisterClusterStatus] = useState<{
|
const [registerClusterStatus, setRegisterClusterStatus] = useState<{
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
provider: ProviderType;
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
token: string;
|
token: string;
|
||||||
image: string;
|
image: string;
|
||||||
@@ -80,6 +81,7 @@ const Credentials: React.FC = () => {
|
|||||||
};
|
};
|
||||||
}>({
|
}>({
|
||||||
open: false,
|
open: false,
|
||||||
|
provider: null,
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
token: '',
|
token: '',
|
||||||
image: '',
|
image: '',
|
||||||
@@ -224,6 +226,7 @@ const Credentials: React.FC = () => {
|
|||||||
const info = await queryClusterToken({ id: row.id });
|
const info = await queryClusterToken({ id: row.id });
|
||||||
setRegisterClusterStatus({
|
setRegisterClusterStatus({
|
||||||
open: true,
|
open: true,
|
||||||
|
provider: row.provider as ProviderType,
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
...info,
|
...info,
|
||||||
cluster_id: row.id
|
cluster_id: row.id
|
||||||
@@ -410,10 +413,12 @@ const Credentials: React.FC = () => {
|
|||||||
<RegisterCluster
|
<RegisterCluster
|
||||||
title={intl.formatMessage({ id: 'clusters.button.register' })}
|
title={intl.formatMessage({ id: 'clusters.button.register' })}
|
||||||
open={registerClusterStatus.open}
|
open={registerClusterStatus.open}
|
||||||
|
provider={registerClusterStatus.provider}
|
||||||
registrationInfo={registerClusterStatus.registrationInfo}
|
registrationInfo={registerClusterStatus.registrationInfo}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setRegisterClusterStatus({
|
setRegisterClusterStatus({
|
||||||
open: false,
|
open: false,
|
||||||
|
provider: null,
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
token: '',
|
token: '',
|
||||||
image: '',
|
image: '',
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ const Container = styled.div`
|
|||||||
.command-info {
|
.command-info {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
// font-weight: 500;
|
|
||||||
color: var(--ant-color-text-secondary);
|
color: var(--ant-color-text-secondary);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import ScrollerModal from '@/components/scroller-modal/index';
|
import ScrollerModal from '@/components/scroller-modal/index';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import RegisterClusterInner from './register-cluster-inner';
|
import { ProviderType } from '../config';
|
||||||
|
import AddWorkerStep from './add-worker-step';
|
||||||
|
|
||||||
type AddModalProps = {
|
type AddModalProps = {
|
||||||
title: string;
|
title: string;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
provider: ProviderType;
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
token: string;
|
token: string;
|
||||||
image: string;
|
image: string;
|
||||||
@@ -16,6 +18,7 @@ type AddModalProps = {
|
|||||||
const AddCluster: React.FC<AddModalProps> = ({
|
const AddCluster: React.FC<AddModalProps> = ({
|
||||||
title,
|
title,
|
||||||
open,
|
open,
|
||||||
|
provider,
|
||||||
registrationInfo,
|
registrationInfo,
|
||||||
onCancel
|
onCancel
|
||||||
}) => {
|
}) => {
|
||||||
@@ -32,10 +35,10 @@ const AddCluster: React.FC<AddModalProps> = ({
|
|||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
width={600}
|
width={860}
|
||||||
footer={false}
|
footer={false}
|
||||||
>
|
>
|
||||||
<RegisterClusterInner registrationInfo={registrationInfo} />
|
<AddWorkerStep registrationInfo={registrationInfo} provider={provider} />
|
||||||
</ScrollerModal>
|
</ScrollerModal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user