fix: use setFieldsValue to explicitly set gatewayType and accessGatewayId
This commit is contained in:
@@ -72,7 +72,6 @@ const AssetsPost = function ({assetId, groupId, copy, onClose}: AssetsInfoProps)
|
||||
const get = async () => {
|
||||
if (assetId) {
|
||||
let asset = await assetsApi.getById(assetId);
|
||||
window.alert('accessGatewayId: ' + asset.accessGatewayId + ', gatewayType will be set');
|
||||
if (strings.hasText(asset.logo)) {
|
||||
setLogo(asset.logo);
|
||||
}
|
||||
@@ -89,7 +88,12 @@ const AssetsPost = function ({assetId, groupId, copy, onClose}: AssetsInfoProps)
|
||||
}
|
||||
if (asset.accessGatewayId && asset.accessGatewayId !== '-') {
|
||||
asset.gatewayType = 'ssh';
|
||||
window.alert('gatewayType set to: ' + asset.gatewayType);
|
||||
setTimeout(() => {
|
||||
formRef.current?.setFieldsValue({
|
||||
gatewayType: 'ssh',
|
||||
accessGatewayId: asset.accessGatewayId
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
return asset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user