diff --git a/.lintstagedrc b/.lintstagedrc index 5400ebd1..e0257748 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,5 +1,4 @@ { - "concurrent": 2, "*.{md,json}": ["prettier --cache --write"], "*.{js,jsx}": ["max lint --fix --eslint-only", "prettier --cache --write"], "*.{css,less}": [ @@ -9,5 +8,6 @@ "*.ts?(x)": [ "max lint --fix --eslint-only", "prettier --cache --parser=typescript --write" - ] + ], + "src/locales/**/*.ts": ["npx tsx src/locales/check.ts"] } diff --git a/src/components/seal-table/components/row-prefix.tsx b/src/components/seal-table/components/row-prefix.tsx index 16afbefd..9451c9c0 100644 --- a/src/components/seal-table/components/row-prefix.tsx +++ b/src/components/seal-table/components/row-prefix.tsx @@ -51,7 +51,7 @@ const RowPrefix: React.FC = (props) => { ) : ( @@ -78,7 +78,7 @@ const RowPrefix: React.FC = (props) => { ) : ( diff --git a/src/locales/lang-config-map.tsx b/src/locales/lang-config-map.tsx index 2d762ba5..e05206a2 100644 --- a/src/locales/lang-config-map.tsx +++ b/src/locales/lang-config-map.tsx @@ -1,5 +1,3 @@ -import IconFont from '@/components/icon-font'; - /** * Language configuration map * Warning: The key of the map must be the same as the directory name in the locales directory @@ -70,7 +68,7 @@ const langConfigMap = { 'en-US': { lang: 'en-US', label: 'English', - icon: , + icon: '🇺🇸', title: 'Language' }, 'es-ES': { @@ -322,7 +320,7 @@ const langConfigMap = { 'zh-CN': { lang: 'zh-CN', label: '简体中文', - icon: , + icon: '🇨🇳', title: '语言' }, 'zh-TW': { diff --git a/src/pages/llmodels/components/deploy-builtin-modal.tsx b/src/pages/llmodels/components/deploy-builtin-modal.tsx index fb681b8c..c8983353 100644 --- a/src/pages/llmodels/components/deploy-builtin-modal.tsx +++ b/src/pages/llmodels/components/deploy-builtin-modal.tsx @@ -5,7 +5,14 @@ import { CloseOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Button, Drawer } from 'antd'; import _ from 'lodash'; -import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; +import React, { + memo, + useCallback, + useEffect, + useMemo, + useRef, + useState +} from 'react'; import styled from 'styled-components'; import { queryCatalogItemSpec } from '../apis'; import { @@ -448,6 +455,10 @@ const AddModal: React.FC = (props) => { axiosToken.current?.cancel?.(); }, [onCancel]); + const showExtraButton = useMemo(() => { + return warningStatus.show && warningStatus.type !== 'success'; + }, [warningStatus.show, warningStatus.type]); + useEffect(() => { if (open) { fetchSpecData(); @@ -542,12 +553,9 @@ const AddModal: React.FC = (props) => { = (props) => { } }; + const showExtraButton = useMemo(() => { + return warningStatus.show && warningStatus.type !== 'success'; + }, [warningStatus.show, warningStatus.type]); + useEffect(() => { if (open) { handleOnOpen(); @@ -338,12 +342,9 @@ const AddModal: FC = (props) => { = (props) => { const data = form.getFieldsValue?.(); const res = handleBackendChangeBefore(data); + console.log('res+++++++++++', res); if (res.show) { return; } @@ -393,6 +394,14 @@ const UpdateModal: React.FC = (props) => { onCancel?.(); }; + const showExtraButton = useMemo(() => { + return ( + warningStatus.show && + warningStatus.type !== 'success' && + !warningStatus.isDefault + ); + }, [warningStatus.show, warningStatus.type, warningStatus.isDefault]); + useEffect(() => { if (open && formData) { setOriginalFormData(); @@ -441,15 +450,9 @@ const UpdateModal: React.FC = (props) => {