diff --git a/src/components/seal-form/seal-switch.tsx b/src/components/seal-form/seal-switch.tsx index d3f503d2..b7f24f59 100644 --- a/src/components/seal-form/seal-switch.tsx +++ b/src/components/seal-form/seal-switch.tsx @@ -53,6 +53,7 @@ const SealSlider: React.FC = (props) => { required={required} status={checkStatus || status} className="no-focus" + disabled={props.disabled} > diff --git a/src/pages/api-keys/hooks/use-keys-columns.tsx b/src/pages/api-keys/hooks/use-keys-columns.tsx index bd4b5abd..09f4476d 100644 --- a/src/pages/api-keys/hooks/use-keys-columns.tsx +++ b/src/pages/api-keys/hooks/use-keys-columns.tsx @@ -83,7 +83,7 @@ const useModelsColumns = ({ key: 'masked_value', render: (text: string, record: ListItem) => ( - {text} + {text || '-'} ) }, diff --git a/src/pages/cluster-management/components/cluster-form.tsx b/src/pages/cluster-management/components/cluster-form.tsx index c116877b..ddaf821b 100644 --- a/src/pages/cluster-management/components/cluster-form.tsx +++ b/src/pages/cluster-management/components/cluster-form.tsx @@ -14,7 +14,6 @@ import { } from '../config/types'; import AdvanceConfig from '../step-forms/advance-config'; import CloudProvider from './cloud-provider-form'; -import K8SVolumeMount from './k8s-volume-mount'; type AddModalProps = { action: PageActionType; @@ -72,6 +71,23 @@ const ClusterForm: React.FC = forwardRef( ...currentData, k8s_volume_mounts: realVolumeList }); + } else { + form.setFieldsValue({ + k8s_volume_mounts: [ + { + name: 'gpustack-data-dir', + mountPath: '/var/lib/gpustack', + readOnly: false, + sourceType: 'hostPath', + volumeSource: { + hostPath: { + path: '/var/lib/gpustack', + type: 'DirectoryOrCreate' + } + } + } + ] + }); } }, [currentData]); @@ -173,9 +189,7 @@ const ClusterForm: React.FC = forwardRef( label={intl.formatMessage({ id: 'common.table.description' })} > - {provider === ProviderValueMap.Kubernetes && ( - - )} + = ({ action }) => { display: 'flex', flexDirection: 'column', gap: '16px', - marginBottom: '24px' + marginBottom: '8px' }} > @@ -180,13 +178,17 @@ const VolumeMountsForm: React.FC<{ action: PageActionType }> = ({ action }) => { } right={ - + <> + {name > 0 && ( + + )} + } > = ({ action }) => { ]} > = ({ action }) => { > = ({ action }) => { valuePropName="checked" > = ({ action }) => { > = ({ action }) => { > = ({ action }) => { /> - - - - )} diff --git a/src/pages/cluster-management/config/index.ts b/src/pages/cluster-management/config/index.ts index 2a2cfdf3..6e6c2a2f 100644 --- a/src/pages/cluster-management/config/index.ts +++ b/src/pages/cluster-management/config/index.ts @@ -146,10 +146,10 @@ export const sourceTypeOptions = [ label: 'clusters.volume.sourceType.pvc', locale: true, value: 'persistentVolumeClaim' - }, - { - label: 'clusters.volume.sourceType.configMap', - locale: true, - value: 'configMap' } + // { + // label: 'clusters.volume.sourceType.configMap', + // locale: true, + // value: 'configMap' + // } ]; diff --git a/src/pages/cluster-management/step-forms/advance-config.tsx b/src/pages/cluster-management/step-forms/advance-config.tsx index ee47d0bb..7392cdb9 100644 --- a/src/pages/cluster-management/step-forms/advance-config.tsx +++ b/src/pages/cluster-management/step-forms/advance-config.tsx @@ -6,11 +6,25 @@ import YamlEditor from '@/pages/_components/yaml-editor'; import { useIntl } from '@umijs/max'; import { Button, Form } from 'antd'; import React, { forwardRef, useEffect, useImperativeHandle } from 'react'; +import styled from 'styled-components'; +import K8SVolumeMount from '../components/k8s-volume-mount'; import { ProviderType, ProviderValueMap } from '../config'; import { ClusterFormData as FormData } from '../config/types'; import schema from '../config/worker-config.json'; import { dockerConfig, kubernetesConfig } from '../config/yaml-template'; +const Title = styled.div` + display: flex; + align-items: center; + justify-content: space-between; + background-color: var(--ant-color-bg-container); + font-weight: 500; + font-size: 14px; + padding-top: 0px; + height: 56px; + padding-bottom: 8px; +`; + const ClusterAdvanceConfig: React.FC<{ action: PageActionType; provider: ProviderType; @@ -59,11 +73,17 @@ const ClusterAdvanceConfig: React.FC<{ > + {provider === ProviderValueMap.Kubernetes && ( + + )} + + {intl.formatMessage({ id: 'clusters.create.workerConfig' })} + - {`${intl.formatMessage({ id: 'clusters.create.workerConfig' })} (YAML)`} + {`YAML`}