fix: target model text overflow
This commit is contained in:
@@ -1,54 +1,87 @@
|
||||
export default `# This is a template for worker_config.
|
||||
|
||||
export const dockerConfig = `# This is a template for worker_config.
|
||||
|
||||
# debug: false
|
||||
|
||||
|
||||
# ========= directories ===========
|
||||
|
||||
|
||||
# cache_dir: "/var/lib/gpustack/cache"
|
||||
# log_dir: "/var/lib/gpustack/log"
|
||||
# bin_dir: "/var/lib/gpustack/bin"
|
||||
|
||||
|
||||
# ========= container & image ===========
|
||||
|
||||
|
||||
# system_default_container_registry: "docker.io"
|
||||
# image_name_override: "gpustack/gpustack:main"
|
||||
# image_name_override: "gpustack/gpustack:dev"
|
||||
# image_repo: "gpustack/gpustack"
|
||||
|
||||
# ========= gateway ===========
|
||||
|
||||
# gateway_mode: "auto"
|
||||
# gateway_concurrency: 16
|
||||
# gateway_kubeconfig: "/var/lib/gpustack/higress/kubeconfig"
|
||||
|
||||
|
||||
# ========= service & networking ===========
|
||||
|
||||
|
||||
# worker_port: 10150
|
||||
# worker_metrics_port: 10150
|
||||
# service_port_range: "40000-40063"
|
||||
# ray_port_range: "41000-41999"
|
||||
|
||||
# ========= resources ===========
|
||||
|
||||
# system_reserved:
|
||||
# ram: 2
|
||||
# vram: 1
|
||||
|
||||
# ========= huggingface ===========
|
||||
|
||||
# huggingface_token:
|
||||
# enable_hf_transfer: false
|
||||
# enable_hf_xet: false
|
||||
|
||||
# ========= metrics ===========
|
||||
|
||||
# disable_worker_metrics: false
|
||||
|
||||
# ========= proxy ===========
|
||||
|
||||
# proxy_mode: worker
|
||||
`;
|
||||
|
||||
export const kubernetesConfig = `# This is a template for worker_config.
|
||||
|
||||
# debug: false
|
||||
|
||||
# ========= directories ===========
|
||||
|
||||
# cache_dir: "/var/lib/gpustack/cache"
|
||||
# log_dir: "/var/lib/gpustack/log"
|
||||
|
||||
# ========= container & image ===========
|
||||
|
||||
# system_default_container_registry: "docker.io"
|
||||
# image_name_override: "gpustack/gpustack:dev"
|
||||
# image_repo: "gpustack/gpustack"
|
||||
|
||||
# ========= service & networking ===========
|
||||
|
||||
# service_discovery_name: "worker"
|
||||
# namespace: "gpustack-system"
|
||||
# worker_port: 10150
|
||||
# worker_metrics_port: 10150
|
||||
# service_port_range: "40000-40063"
|
||||
# ray_port_range: "41000-41999"
|
||||
|
||||
|
||||
# ========= resources ===========
|
||||
|
||||
# resources:
|
||||
|
||||
|
||||
# system_reserved:
|
||||
# ram: 2
|
||||
# vram: 1
|
||||
|
||||
# ========= huggingface ===========
|
||||
|
||||
|
||||
# huggingface_token:
|
||||
# enable_hf_transfer: false
|
||||
# enable_hf_xet: false
|
||||
|
||||
|
||||
# ========= metrics ===========
|
||||
|
||||
|
||||
# disable_worker_metrics: false
|
||||
|
||||
# ========= tools & runtime ===========
|
||||
|
||||
# pipx_path: "/usr/local/bin/pipx"
|
||||
# tools_download_base_url:
|
||||
|
||||
|
||||
# ========= proxy ===========
|
||||
|
||||
# proxy_mode: worker
|
||||
`;
|
||||
|
||||
# proxy_mode: worker`;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import YamlEditor from '@/pages/_components/yaml-editor';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Form } from 'antd';
|
||||
import React, { forwardRef, useImperativeHandle } from 'react';
|
||||
import { ProviderType } from '../config';
|
||||
import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
|
||||
import { ProviderType, ProviderValueMap } from '../config';
|
||||
import { ClusterFormData as FormData } from '../config/types';
|
||||
import schema from '../config/worker-config.json';
|
||||
import yamlTemplate from '../config/yaml-template';
|
||||
import { dockerConfig, kubernetesConfig } from '../config/yaml-template';
|
||||
|
||||
const ClusterAdvanceConfig: React.FC<{
|
||||
action: PageActionType;
|
||||
@@ -18,18 +19,32 @@ const ClusterAdvanceConfig: React.FC<{
|
||||
const [form] = Form.useForm();
|
||||
const intl = useIntl();
|
||||
const editorRef = React.useRef<any>(null);
|
||||
const [fileContent, setFileContent] = React.useState<string>(yamlTemplate);
|
||||
const [fileContent, setFileContent] = React.useState<string>('');
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
getYamlValue: () => {
|
||||
return editorRef.current?.getValue();
|
||||
},
|
||||
setYamlValue: (values: any) => {
|
||||
console.log('setYamlValue:', values);
|
||||
editorRef.current?.setValue(values || yamlTemplate);
|
||||
editorRef.current?.setValue(
|
||||
values ||
|
||||
(provider === ProviderValueMap.Kubernetes
|
||||
? kubernetesConfig
|
||||
: dockerConfig)
|
||||
);
|
||||
}
|
||||
}));
|
||||
|
||||
useEffect(() => {
|
||||
if (action === PageAction.CREATE) {
|
||||
setFileContent(
|
||||
provider === ProviderValueMap.Kubernetes
|
||||
? kubernetesConfig
|
||||
: dockerConfig
|
||||
);
|
||||
}
|
||||
}, [provider, action]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item<FormData>
|
||||
|
||||
Reference in New Issue
Block a user