From c897bb1409123d544bca6f176aedb03ebded072c Mon Sep 17 00:00:00 2001 From: Jihyun Kang Date: Mon, 25 Nov 2024 18:14:13 +0900 Subject: [PATCH] fix: show agent select section only if agent select feature is enabled both UI and serverside --- .../ResourceAllocationFormItems.tsx | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/react/src/components/ResourceAllocationFormItems.tsx b/react/src/components/ResourceAllocationFormItems.tsx index aab7eccb2..3953bd5fd 100644 --- a/react/src/components/ResourceAllocationFormItems.tsx +++ b/react/src/components/ResourceAllocationFormItems.tsx @@ -1208,7 +1208,7 @@ const ResourceAllocationFormItems: React.FC< ) : null} {/* TODO: Support cluster mode */} - {enableAgentSelect && ( + {enableAgentSelect && baiClient.supports('agent-select') && ( - {baiClient.supports('agent-select') && ( - { - if (value !== 'auto') { - form.setFieldsValue({ - cluster_mode: 'single-node', - cluster_size: 1, - }); - } - // TODO: set cluster mode to single node and cluster size to 1 when agent value is not "auto" - }} - > - )} + { + if (value !== 'auto') { + form.setFieldsValue({ + cluster_mode: 'single-node', + cluster_size: 1, + }); + } + // TODO: set cluster mode to single node and cluster size to 1 when agent value is not "auto" + }} + >