feat(cluster): card-based cluster type selector for K8s

Replace the GPU Service switch (with the small "cannot be used for
model service" caption) with a two-card radio selector that makes the
choice between Model Service and GPU Service explicit at a glance.

- Render two cards styled to match the existing SwitchCard (same
  border, radius, 12px/14px padding, and label/description typography)
  so the selector blends in with the surrounding form fields.
- Underlying form state is unchanged: picking GPU Service still seeds
  k8s_options.gpuInstanceOptions = {}, picking Model Service clears
  it — so the static-address field, the EDIT-mode change watcher, and
  the API payload all keep working as before.
- Align the GPU Service label with the top-level menu entry
  (menu.gpuService) — drop "Instance" / "实例" from the card title
  and the static access address label.
This commit is contained in:
gitlawr
2026-06-07 13:44:50 +08:00
committed by Lawrence Li
parent 0e4be63b6b
commit ab8e792276
7 changed files with 206 additions and 76 deletions
@@ -26,7 +26,7 @@ import {
import AdvanceConfig from '../step-forms/advance-config';
import CloudProvider from './cloud-provider-form';
import K8sAdvancedOptions, {
GpuInstanceServiceSwitch,
ClusterTypeSelector,
K8sOptionsChangeWatcher
} from './k8s-pod-spec';
@@ -260,8 +260,8 @@ const ClusterForm: React.FC<AddModalProps> = forwardRef(
<Form.Item<FormData>
name="description"
rules={[{ required: false }]}
// For Kubernetes the GPU instance service switch follows directly,
// so fall back to the default item margin (matching the name field)
// For Kubernetes the cluster type selector follows directly, so
// fall back to the default item margin (matching the name field)
// to keep the description spacing symmetric; other providers keep
// the tighter gap before the advanced panel.
style={{
@@ -275,9 +275,7 @@ const ClusterForm: React.FC<AddModalProps> = forwardRef(
></SealTextArea>
</Form.Item>
{provider === ProviderValueMap.Kubernetes && (
<GpuInstanceServiceSwitch />
)}
{provider === ProviderValueMap.Kubernetes && <ClusterTypeSelector />}
<CollapsePanel
accordion={false}