chore: update add worker command

This commit is contained in:
jialin
2025-11-04 13:37:53 +08:00
parent 4bbae673dc
commit 9be465a8cf
6 changed files with 349 additions and 453 deletions
@@ -3,6 +3,7 @@ import { addWorkerGuide } from '@/pages/resources/config';
import React from 'react';
type ViewModalProps = {
currentGPU?: string;
registrationInfo: {
token: string;
image: string;
@@ -10,17 +11,20 @@ type ViewModalProps = {
};
};
const AddWorkerCommand: React.FC<ViewModalProps> = ({ registrationInfo }) => {
const AddWorkerCommand: React.FC<ViewModalProps> = ({
registrationInfo,
currentGPU
}) => {
const code = React.useMemo(() => {
const commandCode = addWorkerGuide['all'];
return commandCode?.registerWorker({
gpu: currentGPU || '',
server: registrationInfo.server_url || origin,
tag: '',
image: registrationInfo.image,
token: registrationInfo.token || '${token}',
workerip: '${workerip}'
token: registrationInfo.token || '${token}'
});
}, [registrationInfo]);
}, [registrationInfo, currentGPU]);
return (
<HighlightCode