chore: add runtime in register k8s command
This commit is contained in:
@@ -7,10 +7,11 @@ import { Title } from './constainers';
|
||||
import StepCollapse from './step-collapse';
|
||||
|
||||
const K8sRunCommand: React.FC<AddWorkerStepProps> = ({ disabled }) => {
|
||||
const { registrationInfo, stepList } = useAddWorkerContext();
|
||||
const { registrationInfo, stepList, summary } = useAddWorkerContext();
|
||||
const intl = useIntl();
|
||||
|
||||
const stepIndex = stepList.indexOf(StepNamesMap.RunCommand) + 1;
|
||||
const currentGPU = summary.get('currentGPU') || '';
|
||||
|
||||
return (
|
||||
<StepCollapse
|
||||
@@ -32,7 +33,10 @@ const K8sRunCommand: React.FC<AddWorkerStepProps> = ({ disabled }) => {
|
||||
id: 'clusters.create.addCommand.tips'
|
||||
})}
|
||||
</Typography.Paragraph>
|
||||
<RegisterClusterInner registrationInfo={registrationInfo} />
|
||||
<RegisterClusterInner
|
||||
registrationInfo={registrationInfo}
|
||||
currentGPU={currentGPU}
|
||||
/>
|
||||
</StepCollapse>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import HighlightCode from '@/components/highlight-code';
|
||||
import React, { useMemo } from 'react';
|
||||
import { generateRegisterCommand } from '../config';
|
||||
import { generateK8sRegisterCommand } from '../config';
|
||||
|
||||
type AddModalProps = {
|
||||
currentGPU?: string;
|
||||
registrationInfo: {
|
||||
token: string;
|
||||
image: string;
|
||||
@@ -10,14 +11,18 @@ type AddModalProps = {
|
||||
cluster_id: number | null;
|
||||
};
|
||||
};
|
||||
const AddCluster: React.FC<AddModalProps> = ({ registrationInfo }) => {
|
||||
const AddCluster: React.FC<AddModalProps> = ({
|
||||
registrationInfo,
|
||||
currentGPU
|
||||
}) => {
|
||||
const code = useMemo(() => {
|
||||
return generateRegisterCommand({
|
||||
return generateK8sRegisterCommand({
|
||||
server: registrationInfo?.server_url || window.location.origin,
|
||||
clusterId: registrationInfo?.cluster_id,
|
||||
registrationToken: registrationInfo?.token
|
||||
registrationToken: registrationInfo?.token,
|
||||
currentGPU
|
||||
});
|
||||
}, [registrationInfo]);
|
||||
}, [registrationInfo, currentGPU]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user