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