fix(cluster): drive k8s cluster type from shared state
Replace unreliable Form.useWatch on the unregistered gpuInstanceOptions path with explicit shared clusterType state. Fixes the type selector being unclickable and flickering, and ensures a model cluster no longer submits a stale gpuInstanceOptions payload.
This commit is contained in:
@@ -5,6 +5,12 @@ import { ClusterListItem } from './types';
|
||||
interface FormContextProps {
|
||||
currentData?: ClusterListItem;
|
||||
submitAttempted?: boolean;
|
||||
// K8s cluster type. `gpuInstanceOptions` on the form is derived from this —
|
||||
// the selector, the static-address field, and submit all read this single
|
||||
// source of truth instead of independently watching the (unregistered) form
|
||||
// path, which did not re-render reliably.
|
||||
clusterType?: 'model' | 'gpu';
|
||||
setClusterType?: (type: 'model' | 'gpu') => void;
|
||||
}
|
||||
|
||||
export const FormContext = createContext<FormContextProps>({});
|
||||
|
||||
Reference in New Issue
Block a user