perf: code

This commit is contained in:
archer
2023-09-01 11:47:06 +08:00
parent 68cdf50cb6
commit 23cc2f81e9
8 changed files with 61 additions and 68 deletions

View File

@@ -88,6 +88,8 @@ const defaultVectorModels: VectorModelItemType[] = [
export async function getInitConfig() {
try {
if (global.feConfigs) return;
const filename =
process.env.NODE_ENV === 'development' ? 'data/config.local.json' : '/app/data/config.json';
const res = JSON.parse(readFileSync(filename, 'utf-8'));

View File

@@ -22,6 +22,7 @@ import { useTranslation } from 'react-i18next';
import { getTrainingQueueLen } from '@/api/plugins/kb';
import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons';
import { feConfigs } from '@/store/static';
const ImportData = dynamic(() => import('./components/Import'), {
ssr: false
@@ -119,7 +120,10 @@ const Detail = ({ kbId, currentTab }: { kbId: string; currentTab: `${TabEnum}` }
<Flex justifyContent={'center'} alignItems={'center'}>
<MyIcon mr={1} name="overviewLight" w={'16px'} color={'green.500'} />
<Box>{t('dataset.System Data Queue')}</Box>
<MyTooltip label={t('dataset.Queue Desc')} placement={'top'}>
<MyTooltip
label={t('dataset.Queue Desc', { title: feConfigs?.systemTitle })}
placement={'top'}
>
<QuestionOutlineIcon ml={1} w={'16px'} />
</MyTooltip>
</Flex>