fix: container name in add worker
This commit is contained in:
@@ -96,6 +96,16 @@ const SpecifyArguments = () => {
|
||||
path: ''
|
||||
};
|
||||
|
||||
const containerNameConfig = summary.get('containerNameConfig') || {
|
||||
enable: false,
|
||||
name: ''
|
||||
};
|
||||
|
||||
const gpustackDataVolumeConfig = summary.get('gpustackDataVolumeConfig') || {
|
||||
enable: false,
|
||||
path: ''
|
||||
};
|
||||
|
||||
const setWorkerIPConfig = (config: {
|
||||
enable: boolean;
|
||||
ip?: string;
|
||||
@@ -138,10 +148,16 @@ const SpecifyArguments = () => {
|
||||
const unregisterWorkerIP = registerField('workerIPConfig');
|
||||
const unregisterModelDir = registerField('modelDirConfig');
|
||||
const unregisterCacheDir = registerField('cacheDirConfig');
|
||||
const unregisterContainerName = registerField('containerNameConfig');
|
||||
const unregisterGpustackDataVolume = registerField(
|
||||
'gpustackDataVolumeConfig'
|
||||
);
|
||||
return () => {
|
||||
unregisterWorkerIP();
|
||||
unregisterModelDir();
|
||||
unregisterCacheDir();
|
||||
unregisterContainerName();
|
||||
unregisterGpustackDataVolume();
|
||||
};
|
||||
}, []);
|
||||
|
||||
@@ -161,6 +177,16 @@ const SpecifyArguments = () => {
|
||||
enable: false,
|
||||
path: ''
|
||||
});
|
||||
|
||||
updateField('containerNameConfig', {
|
||||
enable: false,
|
||||
name: ''
|
||||
});
|
||||
|
||||
updateField('gpustackDataVolumeConfig', {
|
||||
enable: false,
|
||||
path: ''
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -246,6 +272,60 @@ const SpecifyArguments = () => {
|
||||
)
|
||||
}
|
||||
></SwitchSetting>
|
||||
{/* container name config */}
|
||||
<SwitchSetting
|
||||
label={intl.formatMessage({ id: 'clusters.addworker.containerName' })}
|
||||
tips={intl.formatMessage({
|
||||
id: 'clusters.addworker.containerName.tips'
|
||||
})}
|
||||
placeholder={intl.formatMessage(
|
||||
{
|
||||
id: 'common.help.default'
|
||||
},
|
||||
{ content: 'gpustack-worker' }
|
||||
)}
|
||||
checked={containerNameConfig.enable}
|
||||
value={containerNameConfig.name}
|
||||
onChange={(checked) =>
|
||||
updateField('containerNameConfig', {
|
||||
...containerNameConfig,
|
||||
enable: checked
|
||||
})
|
||||
}
|
||||
onInputChange={(value) =>
|
||||
updateField('containerNameConfig', {
|
||||
...containerNameConfig,
|
||||
name: value
|
||||
})
|
||||
}
|
||||
></SwitchSetting>
|
||||
{/* gpustack data volume config */}
|
||||
<SwitchSetting
|
||||
label={intl.formatMessage({ id: 'clusters.addworker.dataVolume' })}
|
||||
tips={intl.formatMessage({
|
||||
id: 'clusters.addworker.dataVolume.tips'
|
||||
})}
|
||||
placeholder={intl.formatMessage(
|
||||
{
|
||||
id: 'common.help.default'
|
||||
},
|
||||
{ content: 'gpustack-data' }
|
||||
)}
|
||||
checked={gpustackDataVolumeConfig.enable}
|
||||
value={gpustackDataVolumeConfig.path}
|
||||
onChange={(checked) =>
|
||||
updateField('gpustackDataVolumeConfig', {
|
||||
...gpustackDataVolumeConfig,
|
||||
enable: checked
|
||||
})
|
||||
}
|
||||
onInputChange={(value) =>
|
||||
updateField('gpustackDataVolumeConfig', {
|
||||
...gpustackDataVolumeConfig,
|
||||
path: value
|
||||
})
|
||||
}
|
||||
></SwitchSetting>
|
||||
{/* model directory config */}
|
||||
<SwitchSetting
|
||||
label={intl.formatMessage({ id: 'clusters.addworker.extraVolume' })}
|
||||
|
||||
Reference in New Issue
Block a user