fix: update first login state after deploying from catalog
This commit is contained in:
@@ -2,6 +2,7 @@ import { modelsExpandKeysAtom } from '@/atoms/models';
|
|||||||
import PageTools from '@/components/page-tools';
|
import PageTools from '@/components/page-tools';
|
||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import useBodyScroll from '@/hooks/use-body-scroll';
|
import useBodyScroll from '@/hooks/use-body-scroll';
|
||||||
|
import { IS_FIRST_LOGIN, writeState } from '@/utils/localstore/index';
|
||||||
import { SyncOutlined } from '@ant-design/icons';
|
import { SyncOutlined } from '@ant-design/icons';
|
||||||
import { PageContainer } from '@ant-design/pro-components';
|
import { PageContainer } from '@ant-design/pro-components';
|
||||||
import { useIntl, useNavigate } from '@umijs/max';
|
import { useIntl, useNavigate } from '@umijs/max';
|
||||||
@@ -136,6 +137,7 @@ const Catalog: React.FC = () => {
|
|||||||
..._.omit(data, ['size', 'quantization'])
|
..._.omit(data, ['size', 'quantization'])
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
writeState(IS_FIRST_LOGIN, false);
|
||||||
setOpenDeployModal({
|
setOpenDeployModal({
|
||||||
...openDeployModal,
|
...openDeployModal,
|
||||||
show: false
|
show: false
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
sourceOptions
|
sourceOptions
|
||||||
} from '../config';
|
} from '../config';
|
||||||
import { CatalogSpec, FormData, ListItem } from '../config/types';
|
import { CatalogSpec, FormData, ListItem } from '../config/types';
|
||||||
|
import { useGenerateFormEditInitialValues } from '../hooks';
|
||||||
import ColumnWrapper from './column-wrapper';
|
import ColumnWrapper from './column-wrapper';
|
||||||
import DataForm from './data-form';
|
import DataForm from './data-form';
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ const quantiCapitMap: Record<string, string> = {
|
|||||||
|
|
||||||
const defaultQuant = ['Q4_K_M'];
|
const defaultQuant = ['Q4_K_M'];
|
||||||
const EmbeddingRerankFirstQuant = ['FP16', 'F16'];
|
const EmbeddingRerankFirstQuant = ['FP16', 'F16'];
|
||||||
|
|
||||||
const AddModal: React.FC<AddModalProps> = (props) => {
|
const AddModal: React.FC<AddModalProps> = (props) => {
|
||||||
const {
|
const {
|
||||||
title,
|
title,
|
||||||
@@ -62,9 +64,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
current,
|
current,
|
||||||
width = 600
|
width = 600
|
||||||
} = props || {};
|
} = props || {};
|
||||||
|
const { getGPUList } = useGenerateFormEditInitialValues();
|
||||||
const form = useRef<any>({});
|
const form = useRef<any>({});
|
||||||
|
const [gpuOptions, setGpuOptions] = useState<any[]>([]);
|
||||||
const [isGGUF, setIsGGUF] = useState<boolean>(false);
|
const [isGGUF, setIsGGUF] = useState<boolean>(false);
|
||||||
const [sourceList, setSourceList] = useState<any[]>([]);
|
const [sourceList, setSourceList] = useState<any[]>([]);
|
||||||
const [backendList, setBackendList] = useState<any[]>([]);
|
const [backendList, setBackendList] = useState<any[]>([]);
|
||||||
@@ -363,6 +365,12 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
}, [open, current]);
|
}, [open, current]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getGPUList().then((data) => {
|
||||||
|
setGpuOptions(data);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Drawer
|
<Drawer
|
||||||
title={
|
title={
|
||||||
@@ -429,6 +437,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
sourceList={sourceList}
|
sourceList={sourceList}
|
||||||
quantizationOptions={quantizationOptions}
|
quantizationOptions={quantizationOptions}
|
||||||
sizeOptions={sizeOptions}
|
sizeOptions={sizeOptions}
|
||||||
|
gpuOptions={gpuOptions}
|
||||||
onBackendChange={handleBackendChange}
|
onBackendChange={handleBackendChange}
|
||||||
onSourceChange={handleSourceChange}
|
onSourceChange={handleSourceChange}
|
||||||
onQuantizationChange={handleOnQuantizationChange}
|
onQuantizationChange={handleOnQuantizationChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user