refactor: add worker
This commit is contained in:
@@ -5,6 +5,7 @@ import React from 'react';
|
||||
type ViewModalProps = {
|
||||
currentGPU?: string;
|
||||
workerIP?: string;
|
||||
modelDir?: string;
|
||||
registrationInfo: {
|
||||
token: string;
|
||||
image: string;
|
||||
@@ -15,19 +16,25 @@ type ViewModalProps = {
|
||||
const AddWorkerCommand: React.FC<ViewModalProps> = ({
|
||||
registrationInfo,
|
||||
workerIP,
|
||||
modelDir,
|
||||
currentGPU
|
||||
}) => {
|
||||
const code = React.useMemo(() => {
|
||||
const commandCode = addWorkerGuide['all'];
|
||||
return commandCode?.registerWorker({
|
||||
gpu: currentGPU || '',
|
||||
server: registrationInfo.server_url || origin,
|
||||
tag: '',
|
||||
workerIP: '${WORKER_IP}',
|
||||
image: registrationInfo.image,
|
||||
token: registrationInfo.token || '${token}'
|
||||
});
|
||||
}, [registrationInfo, currentGPU, workerIP]);
|
||||
return commandCode
|
||||
?.registerWorker({
|
||||
gpu: currentGPU || '',
|
||||
server: registrationInfo.server_url || origin,
|
||||
tag: '',
|
||||
workerIP: workerIP,
|
||||
modelDir: modelDir,
|
||||
image: registrationInfo.image,
|
||||
token: registrationInfo.token || '${token}'
|
||||
})
|
||||
?.trim()
|
||||
.replace(/\\\s+$/gm, '')
|
||||
.replace(/\\+$/, '');
|
||||
}, [registrationInfo, currentGPU, workerIP, modelDir]);
|
||||
|
||||
return (
|
||||
<HighlightCode
|
||||
|
||||
Reference in New Issue
Block a user