Commit
·
53f091c
1
Parent(s):
da54ddf
Theme switch support (#3568)
Browse files### What problem does this PR solve?
- [x] New Feature (non-breaking change which adds functionality)
---------
Co-authored-by: Yingfeng <[email protected]>
Co-authored-by: Jin Hai <[email protected]>
This view is limited to 50 files because it contains too many changes.
See raw diff
- .gitignore +3 -1
- docker/docker-compose-base.yml +1 -1
- rag/svr/task_executor.py +1 -1
- web/src/app.tsx +27 -15
- web/src/assets/icon/Icon.tsx +240 -0
- web/src/assets/svg/api.svg +1 -1
- web/src/assets/svg/delete.svg +1 -1
- web/src/assets/svg/prompt.svg +8 -8
- web/src/components/api-service/chat-overview-modal/index.less +1 -0
- web/src/components/api-service/embed-modal/index.less +1 -1
- web/src/components/editable-cell.tsx +1 -1
- web/src/components/highlight-markdown/index.less +1 -1
- web/src/components/indented-tree/indented-tree.tsx +79 -63
- web/src/components/llm-setting-items/index.tsx +2 -2
- web/src/components/message-input/index.less +1 -1
- web/src/components/message-input/index.tsx +2 -10
- web/src/components/message-item/group-button.tsx +2 -2
- web/src/components/message-item/index.less +8 -5
- web/src/components/message-item/index.tsx +9 -3
- web/src/components/retrieval-documents/index.tsx +1 -1
- web/src/components/theme-provider.tsx +13 -26
- web/src/components/ui/navigation-menu.tsx +1 -1
- web/src/layouts/components/header/index.less +62 -2
- web/src/layouts/components/header/index.tsx +11 -4
- web/src/layouts/components/right-toolbar/index.less +5 -1
- web/src/layouts/components/right-toolbar/index.tsx +18 -3
- web/src/less/mixins.less +1 -1
- web/src/less/variable.less +1 -1
- web/src/locales/config.ts +10 -1
- web/src/locales/en.ts +2 -2
- web/src/locales/es.ts +1 -0
- web/src/locales/id.ts +2 -1
- web/src/locales/until.ts +60 -0
- web/src/locales/vi.ts +38 -2
- web/src/locales/zh-traditional.ts +1 -0
- web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-card/index.less +3 -0
- web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-card/index.tsx +4 -1
- web/src/pages/add-knowledge/components/knowledge-setting/category-panel.tsx +2 -4
- web/src/pages/add-knowledge/components/knowledge-setting/configuration.tsx +1 -0
- web/src/pages/add-knowledge/components/knowledge-sidebar/index.less +0 -1
- web/src/pages/add-knowledge/components/knowledge-testing/index.less +0 -1
- web/src/pages/add-knowledge/components/knowledge-testing/testing-control/index.less +1 -1
- web/src/pages/add-knowledge/components/knowledge-testing/testing-result/index.less +2 -2
- web/src/pages/add-knowledge/components/knowledge-testing/testing-result/index.tsx +2 -2
- web/src/pages/add-knowledge/index.less +2 -2
- web/src/pages/chat/chat-configuration-modal/model-setting.tsx +0 -218
- web/src/pages/chat/index.less +12 -0
- web/src/pages/chat/index.tsx +8 -2
- web/src/pages/document-viewer/docx/index.less +2 -1
- web/src/pages/flow/canvas/context-menu/index.less +2 -2
.gitignore
CHANGED
@@ -35,4 +35,6 @@ rag/res/deepdoc
|
|
35 |
sdk/python/ragflow.egg-info/
|
36 |
sdk/python/build/
|
37 |
sdk/python/dist/
|
38 |
-
sdk/python/ragflow_sdk.egg-info/
|
|
|
|
|
|
35 |
sdk/python/ragflow.egg-info/
|
36 |
sdk/python/build/
|
37 |
sdk/python/dist/
|
38 |
+
sdk/python/ragflow_sdk.egg-info/
|
39 |
+
huggingface.co/
|
40 |
+
nltk_data/
|
docker/docker-compose-base.yml
CHANGED
@@ -74,7 +74,7 @@ services:
|
|
74 |
command:
|
75 |
--max_connections=1000
|
76 |
--character-set-server=utf8mb4
|
77 |
-
--collation-server=
|
78 |
--default-authentication-plugin=mysql_native_password
|
79 |
--tls_version="TLSv1.2,TLSv1.3"
|
80 |
--init-file /data/application/init.sql
|
|
|
74 |
command:
|
75 |
--max_connections=1000
|
76 |
--character-set-server=utf8mb4
|
77 |
+
--collation-server=utf8mb4_unicode_ci
|
78 |
--default-authentication-plugin=mysql_native_password
|
79 |
--tls_version="TLSv1.2,TLSv1.3"
|
80 |
--init-file /data/application/init.sql
|
rag/svr/task_executor.py
CHANGED
@@ -260,7 +260,7 @@ def build_chunks(task, progress_callback):
|
|
260 |
|
261 |
def init_kb(row, vector_size: int):
|
262 |
idxnm = search.index_name(row["tenant_id"])
|
263 |
-
return settings.docStoreConn.createIdx(idxnm, row
|
264 |
|
265 |
|
266 |
def embedding(docs, mdl, parser_config=None, callback=None):
|
|
|
260 |
|
261 |
def init_kb(row, vector_size: int):
|
262 |
idxnm = search.index_name(row["tenant_id"])
|
263 |
+
return settings.docStoreConn.createIdx(idxnm, row.get("kb_id",""), vector_size)
|
264 |
|
265 |
|
266 |
def embedding(docs, mdl, parser_config=None, callback=None):
|
web/src/app.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import i18n from '@/locales/config';
|
2 |
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
3 |
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
4 |
-
import { App, ConfigProvider, ConfigProviderProps } from 'antd';
|
5 |
import enUS from 'antd/locale/en_US';
|
6 |
import vi_VN from 'antd/locale/vi_VN';
|
7 |
import zhCN from 'antd/locale/zh_CN';
|
@@ -14,7 +14,7 @@ import weekOfYear from 'dayjs/plugin/weekOfYear';
|
|
14 |
import weekYear from 'dayjs/plugin/weekYear';
|
15 |
import weekday from 'dayjs/plugin/weekday';
|
16 |
import React, { ReactNode, useEffect, useState } from 'react';
|
17 |
-
import { ThemeProvider } from './components/theme-provider';
|
18 |
import storage from './utils/authorization-util';
|
19 |
|
20 |
dayjs.extend(customParseFormat);
|
@@ -35,7 +35,8 @@ const queryClient = new QueryClient();
|
|
35 |
|
36 |
type Locale = ConfigProviderProps['locale'];
|
37 |
|
38 |
-
|
|
|
39 |
const getLocale = (lng: string) =>
|
40 |
AntLanguageMap[lng as keyof typeof AntLanguageMap] ?? enUS;
|
41 |
|
@@ -46,6 +47,28 @@ const RootProvider = ({ children }: React.PropsWithChildren) => {
|
|
46 |
setLocal(getLocale(lng));
|
47 |
});
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
useEffect(() => {
|
50 |
// Because the language is saved in the backend, a token is required to obtain the api. However, the login page cannot obtain the language through the getUserInfo api, so the language needs to be saved in localstorage.
|
51 |
const lng = storage.getLanguage();
|
@@ -57,22 +80,11 @@ const RootProvider = ({ children }: React.PropsWithChildren) => {
|
|
57 |
return (
|
58 |
<QueryClientProvider client={queryClient}>
|
59 |
<ThemeProvider defaultTheme="light" storageKey="ragflow-ui-theme">
|
60 |
-
<
|
61 |
-
theme={{
|
62 |
-
token: {
|
63 |
-
fontFamily: 'Inter',
|
64 |
-
},
|
65 |
-
}}
|
66 |
-
locale={locale}
|
67 |
-
>
|
68 |
-
<App> {children}</App>
|
69 |
-
</ConfigProvider>
|
70 |
-
<ReactQueryDevtools buttonPosition={'top-left'} />
|
71 |
</ThemeProvider>
|
72 |
</QueryClientProvider>
|
73 |
);
|
74 |
};
|
75 |
-
|
76 |
export function rootContainer(container: ReactNode) {
|
77 |
return <RootProvider>{container}</RootProvider>;
|
78 |
}
|
|
|
1 |
import i18n from '@/locales/config';
|
2 |
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
3 |
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
4 |
+
import { App, ConfigProvider, ConfigProviderProps, theme } from 'antd';
|
5 |
import enUS from 'antd/locale/en_US';
|
6 |
import vi_VN from 'antd/locale/vi_VN';
|
7 |
import zhCN from 'antd/locale/zh_CN';
|
|
|
14 |
import weekYear from 'dayjs/plugin/weekYear';
|
15 |
import weekday from 'dayjs/plugin/weekday';
|
16 |
import React, { ReactNode, useEffect, useState } from 'react';
|
17 |
+
import { ThemeProvider, useTheme } from './components/theme-provider';
|
18 |
import storage from './utils/authorization-util';
|
19 |
|
20 |
dayjs.extend(customParseFormat);
|
|
|
35 |
|
36 |
type Locale = ConfigProviderProps['locale'];
|
37 |
|
38 |
+
function Root({ children }: React.PropsWithChildren) {
|
39 |
+
const { theme: themeragflow } = useTheme();
|
40 |
const getLocale = (lng: string) =>
|
41 |
AntLanguageMap[lng as keyof typeof AntLanguageMap] ?? enUS;
|
42 |
|
|
|
47 |
setLocal(getLocale(lng));
|
48 |
});
|
49 |
|
50 |
+
return (
|
51 |
+
<>
|
52 |
+
<ConfigProvider
|
53 |
+
theme={{
|
54 |
+
token: {
|
55 |
+
fontFamily: 'Inter',
|
56 |
+
},
|
57 |
+
algorithm:
|
58 |
+
themeragflow === 'dark'
|
59 |
+
? theme.darkAlgorithm
|
60 |
+
: theme.defaultAlgorithm,
|
61 |
+
}}
|
62 |
+
locale={locale}
|
63 |
+
>
|
64 |
+
<App> {children}</App>
|
65 |
+
</ConfigProvider>
|
66 |
+
<ReactQueryDevtools buttonPosition={'top-left'} />
|
67 |
+
</>
|
68 |
+
);
|
69 |
+
}
|
70 |
+
|
71 |
+
const RootProvider = ({ children }: React.PropsWithChildren) => {
|
72 |
useEffect(() => {
|
73 |
// Because the language is saved in the backend, a token is required to obtain the api. However, the login page cannot obtain the language through the getUserInfo api, so the language needs to be saved in localstorage.
|
74 |
const lng = storage.getLanguage();
|
|
|
80 |
return (
|
81 |
<QueryClientProvider client={queryClient}>
|
82 |
<ThemeProvider defaultTheme="light" storageKey="ragflow-ui-theme">
|
83 |
+
<Root>{children}</Root>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
</ThemeProvider>
|
85 |
</QueryClientProvider>
|
86 |
);
|
87 |
};
|
|
|
88 |
export function rootContainer(container: ReactNode) {
|
89 |
return <RootProvider>{container}</RootProvider>;
|
90 |
}
|
web/src/assets/icon/Icon.tsx
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Icon from '@ant-design/icons';
|
2 |
+
import { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
3 |
+
|
4 |
+
type IconComponentProps = CustomIconComponentProps;
|
5 |
+
const currentColor = 'currentColor';
|
6 |
+
const ApiSvg = () => (
|
7 |
+
<svg
|
8 |
+
viewBox="0 0 1025 1024"
|
9 |
+
version="1.1"
|
10 |
+
xmlns="http://www.w3.org/2000/svg"
|
11 |
+
width="24"
|
12 |
+
height="24"
|
13 |
+
>
|
14 |
+
<path
|
15 |
+
d="M1019.520374 56.394706L966.393742 3.257862c-2.001695-2.001695-4.503815-2.87999-7.1387-2.879991s-5.137004 1.000848-7.148912 2.879991L856.749851 98.61414C814.520204 69.916363 765.396963 55.638964 716.283935 55.638964c-64.156382 0-128.312765 24.428855-177.30324 73.429543L411.280694 256.758295c-3.880838 3.880838-3.880838 10.274008 0 14.154847L751.74254 611.364776c2.001695 2.001695 4.514028 2.890203 7.1387 2.890203 2.512332 0 5.137004-1.000848 7.1387-2.890203l127.689788-127.689788c86.338436-86.460989 96.489892-220.166077 30.454367-317.646604l95.356279-95.366491c3.880838-3.993178 3.880838-10.386348 0-14.267187zM833.321844 423.409656l-74.430391 74.440604-234.075818-234.075818 74.430391-74.430391c31.199896-31.199896 72.806566-48.490052 117.037909-48.490051 44.231342 0 85.705247 17.167603 117.037909 48.490051 31.199896 31.199896 48.490052 72.806566 48.490051 117.037909 0 44.231342-17.290155 85.705247-48.490051 117.027696zM594.987317 554.980283c-3.880838-3.880838-10.274008-3.880838-14.154847 0l-83.458446 83.458446-113.15707-113.146858 83.580998-83.580999c3.891051-3.891051 3.891051-10.284221 0-14.165059l-45.610061-45.610061c-3.880838-3.891051-10.274008-3.891051-14.154846 0l-83.580999 83.580998-53.882374-53.882374c-2.001695-2.001695-4.514028-2.87999-7.1387-2.87999-2.512332 0-5.137004 1.000848-7.138699 2.87999L128.725037 539.313952C42.386601 625.774941 32.235145 759.480028 98.27067 856.970768L2.914392 952.33726c-3.880838 3.880838-3.880838 10.274008 0 14.154846l53.136844 53.126632c2.001695 2.001695 4.514028 2.87999 7.1387 2.87999 2.634885 0 5.137004-1.000848 7.1387-2.87999l95.366491-95.356279c42.219434 28.697777 91.352888 42.985389 140.465916 42.985389 64.156382 0 128.312765-24.439068 177.30324-73.429543l127.689789-127.689788c3.880838-3.891051 3.880838-10.274008 0-14.154847l-53.882374-53.882374 83.580998-83.580998c3.880838-3.880838 3.880838-10.274008 0-14.154847l-45.865379-45.375168zM423.066186 833.665314c-31.199896 31.199896-72.806566 48.490052-117.037908 48.490051-44.231342 0-85.705247-17.167603-117.037909-48.490051-31.199896-31.199896-48.490052-72.806566-48.490052-117.037909 0-44.231342 17.167603-85.71546 48.490052-117.037909l74.430391-74.430391 234.075817 234.075818-74.430391 74.430391z m0 0"
|
16 |
+
fill={currentColor}
|
17 |
+
></path>
|
18 |
+
</svg>
|
19 |
+
);
|
20 |
+
const TeamSvg = () => (
|
21 |
+
<svg
|
22 |
+
width="24"
|
23 |
+
height="24"
|
24 |
+
viewBox="0 0 24 24"
|
25 |
+
fill="none"
|
26 |
+
xmlns="http://www.w3.org/2000/svg"
|
27 |
+
>
|
28 |
+
<path
|
29 |
+
d="M22 21V19C22 17.1362 20.7252 15.5701 19 15.126M15.5 3.29076C16.9659 3.88415 18 5.32131 18 7C18 8.67869 16.9659 10.1159 15.5 10.7092M17 21C17 19.1362 17 18.2044 16.6955 17.4693C16.2895 16.4892 15.5108 15.7105 14.5307 15.3045C13.7956 15 12.8638 15 11 15H8C6.13623 15 5.20435 15 4.46927 15.3045C3.48915 15.7105 2.71046 16.4892 2.30448 17.4693C2 18.2044 2 19.1362 2 21M13.5 7C13.5 9.20914 11.7091 11 9.5 11C7.29086 11 5.5 9.20914 5.5 7C5.5 4.79086 7.29086 3 9.5 3C11.7091 3 13.5 4.79086 13.5 7Z"
|
30 |
+
stroke={currentColor}
|
31 |
+
strokeWidth="2"
|
32 |
+
strokeLinecap="round"
|
33 |
+
strokeLinejoin="round"
|
34 |
+
/>
|
35 |
+
</svg>
|
36 |
+
);
|
37 |
+
const ProfileSvg = () => (
|
38 |
+
<svg
|
39 |
+
width="24"
|
40 |
+
height="24"
|
41 |
+
viewBox="0 0 24 24"
|
42 |
+
fill="none"
|
43 |
+
xmlns="http://www.w3.org/2000/svg"
|
44 |
+
>
|
45 |
+
<path
|
46 |
+
d="M20 21C20 19.6044 20 18.9067 19.8278 18.3389C19.44 17.0605 18.4395 16.06 17.1611 15.6722C16.5933 15.5 15.8956 15.5 14.5 15.5H9.5C8.10444 15.5 7.40665 15.5 6.83886 15.6722C5.56045 16.06 4.56004 17.0605 4.17224 18.3389C4 18.9067 4 19.6044 4 21M16.5 7.5C16.5 9.98528 14.4853 12 12 12C9.51472 12 7.5 9.98528 7.5 7.5C7.5 5.01472 9.51472 3 12 3C14.4853 3 16.5 5.01472 16.5 7.5Z"
|
47 |
+
stroke={currentColor}
|
48 |
+
strokeWidth="2"
|
49 |
+
strokeLinecap="round"
|
50 |
+
strokeLinejoin="round"
|
51 |
+
/>
|
52 |
+
</svg>
|
53 |
+
);
|
54 |
+
const PasswordSvg = () => (
|
55 |
+
<svg
|
56 |
+
width="24"
|
57 |
+
height="24"
|
58 |
+
viewBox="0 0 24 24"
|
59 |
+
fill="none"
|
60 |
+
xmlns="http://www.w3.org/2000/svg"
|
61 |
+
>
|
62 |
+
<path
|
63 |
+
d="M17 10V8C17 5.23858 14.7614 3 12 3C9.23858 3 7 5.23858 7 8V10M12 14.5V16.5M8.8 21H15.2C16.8802 21 17.7202 21 18.362 20.673C18.9265 20.3854 19.3854 19.9265 19.673 19.362C20 18.7202 20 17.8802 20 16.2V14.8C20 13.1198 20 12.2798 19.673 11.638C19.3854 11.0735 18.9265 10.6146 18.362 10.327C17.7202 10 16.8802 10 15.2 10H8.8C7.11984 10 6.27976 10 5.63803 10.327C5.07354 10.6146 4.6146 11.0735 4.32698 11.638C4 12.2798 4 13.1198 4 14.8V16.2C4 17.8802 4 18.7202 4.32698 19.362C4.6146 19.9265 5.07354 20.3854 5.63803 20.673C6.27976 21 7.11984 21 8.8 21Z"
|
64 |
+
stroke={currentColor}
|
65 |
+
strokeWidth="2"
|
66 |
+
strokeLinecap="round"
|
67 |
+
strokeLinejoin="round"
|
68 |
+
/>
|
69 |
+
</svg>
|
70 |
+
);
|
71 |
+
const LogOutSvg = () => (
|
72 |
+
<svg
|
73 |
+
width="24"
|
74 |
+
height="24"
|
75 |
+
viewBox="0 0 24 24"
|
76 |
+
fill="none"
|
77 |
+
xmlns="http://www.w3.org/2000/svg"
|
78 |
+
>
|
79 |
+
<path
|
80 |
+
d="M16 17L21 12M21 12L16 7M21 12H9M9 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H9"
|
81 |
+
stroke={currentColor}
|
82 |
+
strokeWidth="2"
|
83 |
+
strokeLinecap="round"
|
84 |
+
strokeLinejoin="round"
|
85 |
+
/>
|
86 |
+
</svg>
|
87 |
+
);
|
88 |
+
const ModelProviderSvg = () => (
|
89 |
+
<svg
|
90 |
+
width="24"
|
91 |
+
height="24"
|
92 |
+
viewBox="0 0 24 24"
|
93 |
+
fill="none"
|
94 |
+
xmlns="http://www.w3.org/2000/svg"
|
95 |
+
>
|
96 |
+
<path
|
97 |
+
d="M9.75 20.7496L11.223 21.5679C11.5066 21.7255 11.6484 21.8043 11.7986 21.8351C11.9315 21.8625 12.0685 21.8625 12.2015 21.8351C12.3516 21.8043 12.4934 21.7255 12.777 21.5679L14.25 20.7496M5.25 18.2496L3.82297 17.4568C3.52346 17.2904 3.37368 17.2072 3.26463 17.0889C3.16816 16.9842 3.09515 16.8601 3.05048 16.7249C3 16.5721 3 16.4008 3 16.0582V14.4996M3 9.4996V7.94104C3 7.5984 3 7.42708 3.05048 7.27428C3.09515 7.1391 3.16816 7.01502 3.26463 6.91033C3.37368 6.792 3.52345 6.70879 3.82297 6.54239L5.25 5.7496M9.75 3.2496L11.223 2.43128C11.5066 2.27372 11.6484 2.19494 11.7986 2.16406C11.9315 2.13672 12.0685 2.13672 12.2015 2.16406C12.3516 2.19494 12.4934 2.27372 12.777 2.43128L14.25 3.2496M18.75 5.7496L20.177 6.54239C20.4766 6.70879 20.6263 6.79199 20.7354 6.91033C20.8318 7.01502 20.9049 7.1391 20.9495 7.27428C21 7.42708 21 7.5984 21 7.94104V9.4996M21 14.4996V16.0582C21 16.4008 21 16.5721 20.9495 16.7249C20.9049 16.8601 20.8318 16.9842 20.7354 17.0889C20.6263 17.2072 20.4766 17.2904 20.177 17.4568L18.75 18.2496M9.75 10.7496L12 11.9996M12 11.9996L14.25 10.7496M12 11.9996V14.4996M3 6.9996L5.25 8.2496M18.75 8.2496L21 6.9996M12 19.4996V21.9996"
|
98 |
+
stroke={currentColor}
|
99 |
+
strokeWidth="2"
|
100 |
+
strokeLinecap="round"
|
101 |
+
strokeLinejoin="round"
|
102 |
+
/>
|
103 |
+
</svg>
|
104 |
+
);
|
105 |
+
const PromptSvg = () => (
|
106 |
+
<svg
|
107 |
+
viewBox="0 0 1024 1024"
|
108 |
+
version="1.1"
|
109 |
+
xmlns="http://www.w3.org/2000/svg"
|
110 |
+
width="1em"
|
111 |
+
height="1em"
|
112 |
+
>
|
113 |
+
<path
|
114 |
+
d="M509.952 260.864c-152.832 0-277.248 124.416-277.248 277.248 0 152.832 124.416 277.248 277.248 277.248 152.832 0 277.248-124.416 277.248-277.248C787.2 385.28 662.784 260.864 509.952 260.864zM509.952 746.24c-114.688 0-208.128-93.44-208.128-208.128 0-114.688 93.44-208.128 208.128-208.128s208.128 93.44 208.128 208.128C717.824 652.8 624.64 746.24 509.952 746.24z"
|
115 |
+
fill={currentColor}
|
116 |
+
></path>
|
117 |
+
<path
|
118 |
+
d="M509.952 211.2c22.016 0 39.68-17.664 39.68-39.68L549.632 77.056c0-22.016-17.664-39.68-39.68-39.68s-39.68 17.664-39.68 39.68l0 94.464C470.272 193.28 487.936 211.2 509.952 211.2z"
|
119 |
+
fill={currentColor}
|
120 |
+
></path>
|
121 |
+
<path
|
122 |
+
d="M134.144 538.88l-94.464 0c-22.016 0-39.68 17.664-39.68 39.68s17.664 39.68 39.68 39.68l94.464 0c22.016 0 39.68-17.664 39.68-39.68S155.904 538.88 134.144 538.88z"
|
123 |
+
fill={currentColor}
|
124 |
+
></path>
|
125 |
+
<path
|
126 |
+
d="M984.32 538.88l-94.464 0c-22.016 0-39.68 17.664-39.68 39.68s17.664 39.68 39.68 39.68l94.464 0c22.016 0 39.68-17.664 39.68-39.68S1006.336 538.88 984.32 538.88z"
|
127 |
+
fill={currentColor}
|
128 |
+
></path>
|
129 |
+
<path
|
130 |
+
d="M901.632 196.864c-15.616-15.616-40.704-15.616-56.064 0l-66.816 66.816c-15.616 15.616-15.616 40.704 0 56.064 7.68 7.68 17.92 11.52 28.16 11.52 10.24 0 20.224-3.84 28.16-11.52l66.816-66.816C916.992 237.568 916.992 212.224 901.632 196.864z"
|
131 |
+
fill={currentColor}
|
132 |
+
></path>
|
133 |
+
<path
|
134 |
+
d="M241.152 263.424l-66.816-66.816c-15.616-15.616-40.704-15.616-56.064 0-15.616 15.616-15.616 40.704 0 56.064l66.816 66.816c7.68 7.68 17.92 11.52 28.16 11.52 10.24 0 20.224-3.84 28.16-11.52C256.768 304.128 256.768 279.04 241.152 263.424z"
|
135 |
+
fill={currentColor}
|
136 |
+
></path>
|
137 |
+
<path
|
138 |
+
d="M605.184 866.56 414.72 866.56c-13.056 0-23.808 9.472-23.808 21.248s10.752 21.248 23.808 21.248l190.464 0c13.056 0 23.808-9.472 23.808-21.248S618.24 866.56 605.184 866.56z"
|
139 |
+
fill={currentColor}
|
140 |
+
></path>
|
141 |
+
<path
|
142 |
+
d="M577.536 944.384l-135.168 0c-13.056 0-23.808 9.472-23.808 21.248s10.752 21.248 23.808 21.248l135.168 0c13.056 0 23.808-9.472 23.808-21.248S590.592 944.384 577.536 944.384z"
|
143 |
+
fill={currentColor}
|
144 |
+
></path>
|
145 |
+
</svg>
|
146 |
+
);
|
147 |
+
const WikipediaSvg = () => (
|
148 |
+
<svg
|
149 |
+
viewBox="0 0 1024 1024"
|
150 |
+
version="1.1"
|
151 |
+
xmlns="http://www.w3.org/2000/svg"
|
152 |
+
width="200"
|
153 |
+
height="200"
|
154 |
+
>
|
155 |
+
<path
|
156 |
+
d="M515.84 559.744c-39.936 82.432-94.592 194.048-121.728 244.394667-26.282667 45.824-48.085333 39.722667-65.365333 1.237333-59.989333-141.696-183.168-390.144-241.109334-529.450667-10.709333-25.642667-18.816-42.112-26.410666-48.597333-7.722667-6.4-23.637333-10.24-47.872-11.562667C4.394667 214.741333 0 212.565333 0 208.981333v-19.413333l2.218667-1.92c39.424-0.213333 230.442667 0 230.442666 0l2.176 1.92v18.517333c0 5.077333-3.2 7.509333-9.6 7.509334l-24.064 1.322666c-20.693333 1.237333-31.018667 6.997333-31.018666 18.602667 0 5.76 2.261333 14.08 7.082666 25.642667 46.165333 112.896 205.568 448.896 205.568 448.896l5.802667 1.962666 102.869333-205.226666-20.565333-45.525334-70.741333-139.264s-13.568-27.904-18.261334-37.205333c-31.061333-61.568-30.378667-64.768-61.738666-68.992-8.832-0.981333-13.354667-2.133333-13.354667-6.357333v-19.968l2.56-1.92h183.125333l4.821334 1.578666v19.242667c0 4.48-3.242667 6.4-9.685334 6.4l-13.141333 2.005333c-33.792 2.602667-28.202667 16.256-5.802667 60.672l67.498667 138.752 75.008-149.504c12.501333-27.306667 9.941333-34.176 4.736-40.405333-2.986667-3.584-13.013333-9.386667-34.645333-10.24l-8.576-0.896a9.728 9.728 0 0 1-6.186667-2.176 6.4 6.4 0 0 1-2.858667-5.504v-18.218667l2.602667-1.92c53.205333-0.341333 172.501333 0 172.501333 0l2.517334 1.92v18.602667c0 5.162667-2.517333 7.594667-8.234667 7.594667-27.562667 1.28-33.365333 4.053333-43.648 18.730666-5.12 7.936-16 25.130667-27.562667 44.330667l-98.176 182.314667-2.773333 5.76 119.125333 243.712 7.253334 2.048 187.562666-445.354667c6.570667-18.005333 5.504-30.805333-2.730666-38.186667-8.405333-7.338667-14.762667-11.648-36.565334-12.586666l-17.92-0.682667a10.88 10.88 0 0 1-6.485333-1.92c-1.834667-1.237333-3.072-3.2-3.072-5.077333v-18.602667l2.517333-1.92h211.669334l1.749333 1.92v18.645333c0 5.077333-3.157333 7.68-8.917333 7.68-27.648 1.28-48.085333 7.68-61.568 17.962667-13.397333 10.88-23.765333 26.282667-31.402667 45.525333 0 0-172.501333 395.008-231.509333 526.464-22.4 42.965333-44.928 39.125333-64.128-1.322666-24.362667-49.962667-75.648-161.536-112.896-243.626667l2.261333-1.536z"
|
157 |
+
fill={currentColor}
|
158 |
+
></path>
|
159 |
+
</svg>
|
160 |
+
);
|
161 |
+
const KeywordSvg = () => (
|
162 |
+
<svg
|
163 |
+
viewBox="0 0 1024 1024"
|
164 |
+
version="1.1"
|
165 |
+
xmlns="http://www.w3.org/2000/svg"
|
166 |
+
width="200"
|
167 |
+
height="200"
|
168 |
+
>
|
169 |
+
<path
|
170 |
+
d="M419.999992 631.999988v-136.699998c74.443999-50.009999 119.999998-134.033997 119.999997-223.299995C539.999989 123.113998 418.885992 0 269.999995 0S0 123.113998 0 271.999995c0 89.267998 45.555999 173.291997 119.999998 223.299995V871.999983c0 7.968 3.164 15.586 8.789999 21.21l119.999998 121.999997A29.903999 29.903999 0 0 0 269.999995 1023.99998a29.899999 29.899999 0 0 0 21.209999-8.79l119.999998-121.999997c11.718-11.718 11.718-30.703999 0-42.422L372.421993 811.999984l38.789999-38.789999c11.718-11.718 11.718-30.703999 0-42.421999L372.421993 691.999986l38.789999-38.789999A29.979999 29.979999 0 0 0 419.999992 631.999988z m-149.999997-329.999994c-49.627999 0-89.999998-40.371999-89.999999-89.999998s40.371999-89.999998 89.999999-89.999998 89.999998 40.371999 89.999998 89.999998-40.371999 89.999998-89.999998 89.999998z"
|
171 |
+
fill={currentColor}
|
172 |
+
></path>
|
173 |
+
<path
|
174 |
+
d="M933.999982 361.999993c-39.059999 0-72.047999 25.156-84.473999 59.999999H753.999985a30.011999 30.011999 0 0 0-26.835999 16.581999L675.455987 541.999989H509.99999c-16.582 0-29.999999 13.418-29.999999 30s13.418 29.999999 29.999999 29.999999h183.999996a30.011999 30.011999 0 0 0 26.836-16.581999L772.543985 481.999991h76.981998c12.426 34.843999 45.413999 59.999999 84.473999 59.999998 49.627999 0 89.999998-40.371999 89.999998-89.999998s-40.371999-89.999998-89.999998-89.999998zM933.999982 601.999988c-39.059999 0-72.047999 25.156-84.473999 59.999999H509.99999c-16.582 0-29.999999 13.418-29.999999 29.999999s13.418 29.999999 29.999999 30h339.525993c12.426 34.843999 45.413999 59.999999 84.473999 59.999999 49.627999 0 89.999998-40.371999 89.999998-89.999999s-40.371999-89.999998-89.999998-89.999998zM933.999982 841.999984c-39.059999 0-72.047999 25.156-84.473999 59.999998h-76.981998l-51.707999-103.417998A30.011999 30.011999 0 0 0 693.999986 781.999985h-183.999996c-16.582 0-29.999999 13.418-29.999999 29.999999s13.418 29.999999 29.999999 30h165.455997l51.707999 103.417998C732.261986 955.583981 742.631985 963.999981 753.999985 963.999981h95.525998c12.426 34.843999 45.413999 59.999999 84.473999 59.999999 49.627999 0 89.999998-42.371999 89.999998-91.999998s-40.371999-89.999998-89.999998-89.999998zM933.999982 121.999998c-39.059999 0-72.047999 25.156-84.473999 59.999998H753.999985c-10.02 0-19.394 5.01-24.959999 13.36L617.945988 361.999993H569.999989c-16.582 0-29.999999 13.418-30 29.999999s13.418 29.999999 30 30h63.999999c10.02 0 19.394-5.01 24.959999-13.36L770.053985 241.999995h79.471998c12.426 34.843999 45.413999 59.999999 84.473999 59.999999 49.627999 0 89.999998-40.371999 89.999998-89.999998s-40.371999-89.999998-89.999998-89.999998z"
|
175 |
+
fill={currentColor}
|
176 |
+
></path>
|
177 |
+
</svg>
|
178 |
+
);
|
179 |
+
const GitHubSvg = () => (
|
180 |
+
<svg
|
181 |
+
viewBox="0 0 1024 1024"
|
182 |
+
version="1.1"
|
183 |
+
xmlns="http://www.w3.org/2000/svg"
|
184 |
+
width="200"
|
185 |
+
height="200"
|
186 |
+
>
|
187 |
+
<path
|
188 |
+
fill={currentColor}
|
189 |
+
d="M938.666667 512a426.666667 426.666667 0 0 1-291.84 404.48 22.186667 22.186667 0 0 1-19.2-2.986667 21.76 21.76 0 0 1-8.96-17.493333v-113.92a170.666667 170.666667 0 0 0-21.333334-87.893333 10.666667 10.666667 0 0 1 0-11.52 11.52 11.52 0 0 1 8.533334-5.973334c104.106667-10.666667 162.133333-52.053333 162.133333-164.693333a200.96 200.96 0 0 0-50.773333-143.36 183.466667 183.466667 0 0 0 8.106666-51.2 184.746667 184.746667 0 0 0-6.4-46.08 20.906667 20.906667 0 0 0-22.613333-15.36 189.866667 189.866667 0 0 0-104.106667 50.346667 422.826667 422.826667 0 0 0-160.426666 0A189.866667 189.866667 0 0 0 327.68 256a20.906667 20.906667 0 0 0-22.613333 15.36A184.746667 184.746667 0 0 0 298.666667 317.44a183.466667 183.466667 0 0 0 8.106666 51.2A200.96 200.96 0 0 0 256 512c0 118.613333 64.426667 158.293333 182.613333 168.106667a158.293333 158.293333 0 0 0-29.44 65.28v5.12a29.013333 29.013333 0 0 0 0 5.973333 25.173333 25.173333 0 0 1-27.306666 21.76 42.666667 42.666667 0 0 1-18.346667-5.12 227.84 227.84 0 0 1-60.586667-53.76 430.506667 430.506667 0 0 0-34.133333-34.56 116.906667 116.906667 0 0 0-25.173333-16.64 20.906667 20.906667 0 0 0-20.48 0 21.333333 21.333333 0 0 0-9.813334 17.92v2.56a21.333333 21.333333 0 0 0 9.813334 17.92 193.706667 193.706667 0 0 1 39.253333 44.8 282.026667 282.026667 0 0 0 67.84 73.386667 105.813333 105.813333 0 0 0 59.733333 17.92h15.36V896a21.76 21.76 0 0 1-8.96 17.493333 22.186667 22.186667 0 0 1-19.2 2.986667A426.666667 426.666667 0 1 1 938.666667 512z"
|
190 |
+
></path>
|
191 |
+
</svg>
|
192 |
+
);
|
193 |
+
const QWeatherSvg = () => (
|
194 |
+
<svg
|
195 |
+
viewBox="0 0 1024 1024"
|
196 |
+
version="1.1"
|
197 |
+
xmlns="http://www.w3.org/2000/svg"
|
198 |
+
width="200"
|
199 |
+
height="200"
|
200 |
+
>
|
201 |
+
<path
|
202 |
+
fill={currentColor}
|
203 |
+
d="M953.6 736c-57.6 51.2-89.6 89.6-166.4 102.4 166.4-160 185.6-422.4 44.8-608-64-89.6-166.4-147.2-275.2-172.8-108.8-19.2-224 0-326.4 57.6-96 57.6-172.8 147.2-204.8 256-32 108.8-32 224 19.2 326.4 44.8 102.4 128 185.6 230.4 236.8 102.4 44.8 217.6 57.6 326.4 25.6 96 6.4 192-12.8 275.2-57.6 70.4-38.4 102.4-96 147.2-160l-70.4-6.4z m-537.6 172.8c-83.2-12.8-166.4-51.2-224-108.8-121.6-128-140.8-326.4-32-467.2 51.2-70.4 128-121.6 211.2-140.8 76.8-19.2 166.4-12.8 243.2 25.6 76.8 38.4 140.8 102.4 172.8 185.6 32 76.8 38.4 166.4 12.8 249.6-25.6 83.2-83.2 153.6-153.6 198.4-25.6 0-44.8-6.4-70.4-6.4-83.2-19.2-153.6-70.4-204.8-134.4-25.6-32-44.8-76.8-44.8-121.6 0-38.4 12.8-70.4 32-96 32-38.4 76.8-57.6 121.6-57.6 12.8 0 25.6 0 38.4 6.4 6.4 0 12.8 0 12.8 6.4 25.6 0 44.8 19.2 57.6 38.4 25.6 44.8 12.8 96-25.6 128-32 12.8-64 19.2-89.6 6.4h-12.8c0 6.4-6.4 6.4 0 12.8 19.2 32 51.2 51.2 89.6 51.2 25.6 0 51.2-6.4 76.8-19.2 57.6-32 96-89.6 96-153.6 0-38.4-12.8-70.4-32-102.4 0 0 0-6.4-6.4-6.4 0 0 0-6.4-6.4-6.4-51.2-64-128-102.4-217.6-102.4-83.2 0-153.6 32-211.2 89.6-83.2 83.2-102.4 211.2-44.8 320 51.2 89.6 128 160 217.6 204.8h-6.4z"
|
204 |
+
></path>
|
205 |
+
</svg>
|
206 |
+
);
|
207 |
+
|
208 |
+
export const ApiIcon = (props: Partial<IconComponentProps>) => (
|
209 |
+
<Icon component={ApiSvg} {...props} />
|
210 |
+
);
|
211 |
+
export const TeamIcon = (props: Partial<IconComponentProps>) => (
|
212 |
+
<Icon component={TeamSvg} {...props} />
|
213 |
+
);
|
214 |
+
export const ProfileIcon = (props: Partial<IconComponentProps>) => (
|
215 |
+
<Icon component={ProfileSvg} {...props} />
|
216 |
+
);
|
217 |
+
export const PasswordIcon = (props: Partial<IconComponentProps>) => (
|
218 |
+
<Icon component={PasswordSvg} {...props} />
|
219 |
+
);
|
220 |
+
export const LogOutIcon = (props: Partial<IconComponentProps>) => (
|
221 |
+
<Icon component={LogOutSvg} {...props} />
|
222 |
+
);
|
223 |
+
export const ModelProviderIcon = (props: Partial<IconComponentProps>) => (
|
224 |
+
<Icon component={ModelProviderSvg} {...props} />
|
225 |
+
);
|
226 |
+
export const PromptIcon = (props: Partial<IconComponentProps>) => (
|
227 |
+
<Icon component={PromptSvg} {...props} />
|
228 |
+
);
|
229 |
+
export const WikipediaIcon = (props: Partial<IconComponentProps>) => (
|
230 |
+
<Icon component={WikipediaSvg} {...props} />
|
231 |
+
);
|
232 |
+
export const KeywordIcon = (props: Partial<IconComponentProps>) => (
|
233 |
+
<Icon component={KeywordSvg} {...props} />
|
234 |
+
);
|
235 |
+
export const GitHubIcon = (props: Partial<IconComponentProps>) => (
|
236 |
+
<Icon component={GitHubSvg} {...props} />
|
237 |
+
);
|
238 |
+
export const QWeatherIcon = (props: Partial<IconComponentProps>) => (
|
239 |
+
<Icon component={QWeatherSvg} {...props} />
|
240 |
+
);
|
web/src/assets/svg/api.svg
CHANGED
|
|
web/src/assets/svg/delete.svg
CHANGED
|
|
web/src/assets/svg/prompt.svg
CHANGED
|
|
web/src/components/api-service/chat-overview-modal/index.less
CHANGED
@@ -16,4 +16,5 @@
|
|
16 |
.apiLinkText {
|
17 |
.linkText();
|
18 |
margin: 0 !important;
|
|
|
19 |
}
|
|
|
16 |
.apiLinkText {
|
17 |
.linkText();
|
18 |
margin: 0 !important;
|
19 |
+
background-color: rgba(255, 255, 255, 0.1);
|
20 |
}
|
web/src/components/api-service/embed-modal/index.less
CHANGED
@@ -4,5 +4,5 @@
|
|
4 |
|
5 |
.codeText {
|
6 |
padding: 10px;
|
7 |
-
background-color: #
|
8 |
}
|
|
|
4 |
|
5 |
.codeText {
|
6 |
padding: 10px;
|
7 |
+
background-color: #ffffff09;
|
8 |
}
|
web/src/components/editable-cell.tsx
CHANGED
@@ -90,7 +90,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
90 |
<Input ref={inputRef} onPressEnter={save} onBlur={save} />
|
91 |
</Form.Item>
|
92 |
) : (
|
93 |
-
<div onClick={toggleEdit} className="
|
94 |
<Text>{children}</Text>
|
95 |
</div>
|
96 |
);
|
|
|
90 |
<Input ref={inputRef} onPressEnter={save} onBlur={save} />
|
91 |
</Form.Item>
|
92 |
) : (
|
93 |
+
<div onClick={toggleEdit} className="editable-cell-value-wrap">
|
94 |
<Text>{children}</Text>
|
95 |
</div>
|
96 |
);
|
web/src/components/highlight-markdown/index.less
CHANGED
@@ -15,5 +15,5 @@
|
|
15 |
white-space: break-spaces;
|
16 |
background-color: rgba(129, 139, 152, 0.12);
|
17 |
border-radius: 4px;
|
18 |
-
color:
|
19 |
}
|
|
|
15 |
white-space: break-spaces;
|
16 |
background-color: rgba(129, 139, 152, 0.12);
|
17 |
border-radius: 4px;
|
18 |
+
color: var(--ant-color-text-base);
|
19 |
}
|
web/src/components/indented-tree/indented-tree.tsx
CHANGED
@@ -312,80 +312,96 @@ function fallbackRender({ error }: FallbackProps) {
|
|
312 |
const IndentedTree = ({ data, show, style = {} }: IProps) => {
|
313 |
const containerRef = useRef<HTMLDivElement>(null);
|
314 |
const graphRef = useRef<Graph | null>(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
-
const render = useCallback(
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
|
|
|
|
|
|
334 |
},
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
},
|
345 |
},
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
},
|
358 |
},
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
getVGap: () => 10,
|
367 |
-
},
|
368 |
-
behaviors: [
|
369 |
-
'scroll-canvas',
|
370 |
-
'collapse-expand-tree',
|
371 |
-
{
|
372 |
-
type: 'click-select',
|
373 |
-
enable: (event: any) =>
|
374 |
-
event.targetType === 'node' && event.target.id !== rootId,
|
375 |
},
|
376 |
-
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
|
383 |
-
|
384 |
|
385 |
-
|
386 |
|
387 |
-
|
388 |
-
|
|
|
|
|
|
|
|
|
389 |
|
390 |
useEffect(() => {
|
391 |
if (!isEmpty(data)) {
|
|
|
312 |
const IndentedTree = ({ data, show, style = {} }: IProps) => {
|
313 |
const containerRef = useRef<HTMLDivElement>(null);
|
314 |
const graphRef = useRef<Graph | null>(null);
|
315 |
+
const assignIds = React.useCallback(function assignIds(
|
316 |
+
node: TreeData,
|
317 |
+
parentId: string = '',
|
318 |
+
index = 0,
|
319 |
+
) {
|
320 |
+
if (!node.id) node.id = parentId ? `${parentId}-${index}` : 'root';
|
321 |
+
if (node.children) {
|
322 |
+
node.children.forEach((child, idx) => assignIds(child, node.id, idx));
|
323 |
+
}
|
324 |
+
}, []);
|
325 |
|
326 |
+
const render = useCallback(
|
327 |
+
async (data: TreeData) => {
|
328 |
+
const graph: Graph = new Graph({
|
329 |
+
container: containerRef.current!,
|
330 |
+
x: 60,
|
331 |
+
node: {
|
332 |
+
type: 'indented',
|
333 |
+
style: {
|
334 |
+
size: (d) => [d.id.length * 6 + 10, 20],
|
335 |
+
labelBackground: (datum) => datum.id === rootId,
|
336 |
+
labelBackgroundRadius: 0,
|
337 |
+
labelBackgroundFill: '#576286',
|
338 |
+
labelFill: (datum) => (datum.id === rootId ? '#fff' : '#666'),
|
339 |
+
labelText: (d) => d.style?.labelText || d.id,
|
340 |
+
labelTextAlign: (datum) =>
|
341 |
+
datum.id === rootId ? 'center' : 'left',
|
342 |
+
labelTextBaseline: 'top',
|
343 |
+
color: (datum: any) => {
|
344 |
+
const depth = graph.getAncestorsData(datum.id, 'tree').length - 1;
|
345 |
+
return COLORS[depth % COLORS.length] || '#576286';
|
346 |
+
},
|
347 |
},
|
348 |
+
state: {
|
349 |
+
selected: {
|
350 |
+
lineWidth: 0,
|
351 |
+
labelFill: '#40A8FF',
|
352 |
+
labelBackground: true,
|
353 |
+
labelFontWeight: 'normal',
|
354 |
+
labelBackgroundFill: '#e8f7ff',
|
355 |
+
labelBackgroundRadius: 10,
|
356 |
+
},
|
357 |
},
|
358 |
},
|
359 |
+
edge: {
|
360 |
+
type: 'indented',
|
361 |
+
style: {
|
362 |
+
radius: 16,
|
363 |
+
lineWidth: 2,
|
364 |
+
sourcePort: 'out',
|
365 |
+
targetPort: 'in',
|
366 |
+
stroke: (datum: any) => {
|
367 |
+
const depth = graph.getAncestorsData(datum.source, 'tree').length;
|
368 |
+
return COLORS[depth % COLORS.length] || 'black';
|
369 |
+
},
|
370 |
},
|
371 |
},
|
372 |
+
layout: {
|
373 |
+
type: 'indented',
|
374 |
+
direction: 'LR',
|
375 |
+
isHorizontal: true,
|
376 |
+
indent: 40,
|
377 |
+
getHeight: () => 20,
|
378 |
+
getVGap: () => 10,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
},
|
380 |
+
behaviors: [
|
381 |
+
'scroll-canvas',
|
382 |
+
'collapse-expand-tree',
|
383 |
+
{
|
384 |
+
type: 'click-select',
|
385 |
+
enable: (event: any) =>
|
386 |
+
event.targetType === 'node' && event.target.id !== rootId,
|
387 |
+
},
|
388 |
+
],
|
389 |
+
});
|
390 |
|
391 |
+
if (graphRef.current) {
|
392 |
+
graphRef.current.destroy();
|
393 |
+
}
|
394 |
|
395 |
+
graphRef.current = graph;
|
396 |
|
397 |
+
assignIds(data);
|
398 |
|
399 |
+
graph?.setData(treeToGraphData(data));
|
400 |
+
|
401 |
+
graph?.render();
|
402 |
+
},
|
403 |
+
[assignIds],
|
404 |
+
);
|
405 |
|
406 |
useEffect(() => {
|
407 |
if (!isEmpty(data)) {
|
web/src/components/llm-setting-items/index.tsx
CHANGED
@@ -269,7 +269,7 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|
269 |
>
|
270 |
<Slider
|
271 |
className={styles.variableSlider}
|
272 |
-
max={
|
273 |
disabled={disabled}
|
274 |
/>
|
275 |
</Form.Item>
|
@@ -278,7 +278,7 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
|
278 |
<InputNumber
|
279 |
disabled={disabled}
|
280 |
className={styles.sliderInputNumber}
|
281 |
-
max={
|
282 |
min={0}
|
283 |
/>
|
284 |
</Form.Item>
|
|
|
269 |
>
|
270 |
<Slider
|
271 |
className={styles.variableSlider}
|
272 |
+
max={128000}
|
273 |
disabled={disabled}
|
274 |
/>
|
275 |
</Form.Item>
|
|
|
278 |
<InputNumber
|
279 |
disabled={disabled}
|
280 |
className={styles.sliderInputNumber}
|
281 |
+
max={128000}
|
282 |
min={0}
|
283 |
/>
|
284 |
</Form.Item>
|
web/src/components/message-input/index.less
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.messageInputWrapper {
|
2 |
margin-right: 20px;
|
3 |
-
background-color:
|
4 |
border-radius: 8px;
|
5 |
:global(.ant-input-affix-wrapper) {
|
6 |
border-bottom-right-radius: 0;
|
|
|
1 |
.messageInputWrapper {
|
2 |
margin-right: 20px;
|
3 |
+
background-color: rgba(255, 255, 255, 0.1);
|
4 |
border-radius: 8px;
|
5 |
:global(.ant-input-affix-wrapper) {
|
6 |
border-bottom-right-radius: 0;
|
web/src/components/message-input/index.tsx
CHANGED
@@ -27,6 +27,7 @@ import {
|
|
27 |
} from 'antd';
|
28 |
import classNames from 'classnames';
|
29 |
import get from 'lodash/get';
|
|
|
30 |
import {
|
31 |
ChangeEventHandler,
|
32 |
memo,
|
@@ -36,7 +37,6 @@ import {
|
|
36 |
useState,
|
37 |
} from 'react';
|
38 |
import FileIcon from '../file-icon';
|
39 |
-
import SvgIcon from '../svg-icon';
|
40 |
import styles from './index.less';
|
41 |
|
42 |
type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
|
@@ -98,7 +98,6 @@ const MessageInput = ({
|
|
98 |
const { data: documentInfos, setDocumentIds } = useFetchDocumentInfosByIds();
|
99 |
const { uploadAndParseDocument } = useUploadAndParseDocument(uploadMethod);
|
100 |
const conversationIdRef = useRef(conversationId);
|
101 |
-
|
102 |
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
103 |
|
104 |
const handlePreview = async (file: UploadFile) => {
|
@@ -225,14 +224,7 @@ const MessageInput = ({
|
|
225 |
<Button
|
226 |
type={'text'}
|
227 |
disabled={disabled}
|
228 |
-
icon={
|
229 |
-
<SvgIcon
|
230 |
-
name="paper-clip"
|
231 |
-
width={18}
|
232 |
-
height={22}
|
233 |
-
disabled={disabled}
|
234 |
-
></SvgIcon>
|
235 |
-
}
|
236 |
></Button>
|
237 |
</Upload>
|
238 |
)}
|
|
|
27 |
} from 'antd';
|
28 |
import classNames from 'classnames';
|
29 |
import get from 'lodash/get';
|
30 |
+
import { Paperclip } from 'lucide-react';
|
31 |
import {
|
32 |
ChangeEventHandler,
|
33 |
memo,
|
|
|
37 |
useState,
|
38 |
} from 'react';
|
39 |
import FileIcon from '../file-icon';
|
|
|
40 |
import styles from './index.less';
|
41 |
|
42 |
type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
|
|
|
98 |
const { data: documentInfos, setDocumentIds } = useFetchDocumentInfosByIds();
|
99 |
const { uploadAndParseDocument } = useUploadAndParseDocument(uploadMethod);
|
100 |
const conversationIdRef = useRef(conversationId);
|
|
|
101 |
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
102 |
|
103 |
const handlePreview = async (file: UploadFile) => {
|
|
|
224 |
<Button
|
225 |
type={'text'}
|
226 |
disabled={disabled}
|
227 |
+
icon={<Paperclip></Paperclip>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
></Button>
|
229 |
</Upload>
|
230 |
)}
|
web/src/components/message-item/group-button.tsx
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import CopyToClipboard from '@/components/copy-to-clipboard';
|
2 |
import { useSetModalState } from '@/hooks/common-hooks';
|
3 |
import { IRemoveMessageById } from '@/hooks/logic-hooks';
|
@@ -12,7 +13,6 @@ import {
|
|
12 |
import { Radio, Tooltip } from 'antd';
|
13 |
import { useCallback } from 'react';
|
14 |
import { useTranslation } from 'react-i18next';
|
15 |
-
import SvgIcon from '../svg-icon';
|
16 |
import FeedbackModal from './feedback-modal';
|
17 |
import { useRemoveMessage, useSendFeedback, useSpeech } from './hooks';
|
18 |
import PromptModal from './prompt-modal';
|
@@ -70,7 +70,7 @@ export const AssistantGroupButton = ({
|
|
70 |
)}
|
71 |
{prompt && (
|
72 |
<Radio.Button value="e" onClick={showPromptModal}>
|
73 |
-
<
|
74 |
</Radio.Button>
|
75 |
)}
|
76 |
</Radio.Group>
|
|
|
1 |
+
import { PromptIcon } from '@/assets/icon/Icon';
|
2 |
import CopyToClipboard from '@/components/copy-to-clipboard';
|
3 |
import { useSetModalState } from '@/hooks/common-hooks';
|
4 |
import { IRemoveMessageById } from '@/hooks/logic-hooks';
|
|
|
13 |
import { Radio, Tooltip } from 'antd';
|
14 |
import { useCallback } from 'react';
|
15 |
import { useTranslation } from 'react-i18next';
|
|
|
16 |
import FeedbackModal from './feedback-modal';
|
17 |
import { useRemoveMessage, useSendFeedback, useSpeech } from './hooks';
|
18 |
import PromptModal from './prompt-modal';
|
|
|
70 |
)}
|
71 |
{prompt && (
|
72 |
<Radio.Button value="e" onClick={showPromptModal}>
|
73 |
+
<PromptIcon style={{ fontSize: '16px' }} />
|
74 |
</Radio.Button>
|
75 |
)}
|
76 |
</Radio.Group>
|
web/src/components/message-item/index.less
CHANGED
@@ -6,10 +6,6 @@
|
|
6 |
.messageItemSectionLeft {
|
7 |
width: 80%;
|
8 |
}
|
9 |
-
.messageItemSectionRight {
|
10 |
-
// width: 80%;
|
11 |
-
// max-width: 50vw;
|
12 |
-
}
|
13 |
.messageItemContent {
|
14 |
display: inline-flex;
|
15 |
gap: 20px;
|
@@ -36,10 +32,17 @@
|
|
36 |
background-color: #e6f4ff;
|
37 |
word-break: break-all;
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
.messageUserText {
|
40 |
.chunkText();
|
41 |
.messageTextBase();
|
42 |
-
background-color:
|
43 |
word-break: break-all;
|
44 |
text-align: justify;
|
45 |
}
|
|
|
6 |
.messageItemSectionLeft {
|
7 |
width: 80%;
|
8 |
}
|
|
|
|
|
|
|
|
|
9 |
.messageItemContent {
|
10 |
display: inline-flex;
|
11 |
gap: 20px;
|
|
|
32 |
background-color: #e6f4ff;
|
33 |
word-break: break-all;
|
34 |
}
|
35 |
+
.messageTextDark {
|
36 |
+
.chunkText();
|
37 |
+
.messageTextBase();
|
38 |
+
background-color: #1668dc;
|
39 |
+
word-break: break-all;
|
40 |
+
}
|
41 |
+
|
42 |
.messageUserText {
|
43 |
.chunkText();
|
44 |
.messageTextBase();
|
45 |
+
background-color: rgba(255, 255, 255, 0.3);
|
46 |
word-break: break-all;
|
47 |
text-align: justify;
|
48 |
}
|
web/src/components/message-item/index.tsx
CHANGED
@@ -18,6 +18,7 @@ import { Avatar, Button, Flex, List, Space, Typography } from 'antd';
|
|
18 |
import FileIcon from '../file-icon';
|
19 |
import IndentedTreeModal from '../indented-tree/modal';
|
20 |
import NewDocumentLink from '../new-document-link';
|
|
|
21 |
import { AssistantGroupButton, UserGroupButton } from './group-button';
|
22 |
import styles from './index.less';
|
23 |
|
@@ -47,6 +48,7 @@ const MessageItem = ({
|
|
47 |
regenerateMessage,
|
48 |
showLikeButton = true,
|
49 |
}: IProps) => {
|
|
|
50 |
const isAssistant = item.role === MessageType.Assistant;
|
51 |
const isUser = item.role === MessageType.User;
|
52 |
const { data: documentList, setDocumentIds } = useFetchDocumentInfosByIds();
|
@@ -139,7 +141,11 @@ const MessageItem = ({
|
|
139 |
</Space>
|
140 |
<div
|
141 |
className={
|
142 |
-
isAssistant
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
>
|
145 |
<MarkdownContent
|
@@ -181,8 +187,8 @@ const MessageItem = ({
|
|
181 |
dataSource={documentList}
|
182 |
renderItem={(item) => {
|
183 |
// TODO:
|
184 |
-
const fileThumbnail =
|
185 |
-
|
186 |
const fileExtension = getExtension(item.name);
|
187 |
return (
|
188 |
<List.Item>
|
|
|
18 |
import FileIcon from '../file-icon';
|
19 |
import IndentedTreeModal from '../indented-tree/modal';
|
20 |
import NewDocumentLink from '../new-document-link';
|
21 |
+
import { useTheme } from '../theme-provider';
|
22 |
import { AssistantGroupButton, UserGroupButton } from './group-button';
|
23 |
import styles from './index.less';
|
24 |
|
|
|
48 |
regenerateMessage,
|
49 |
showLikeButton = true,
|
50 |
}: IProps) => {
|
51 |
+
const { theme } = useTheme();
|
52 |
const isAssistant = item.role === MessageType.Assistant;
|
53 |
const isUser = item.role === MessageType.User;
|
54 |
const { data: documentList, setDocumentIds } = useFetchDocumentInfosByIds();
|
|
|
141 |
</Space>
|
142 |
<div
|
143 |
className={
|
144 |
+
isAssistant
|
145 |
+
? theme === 'dark'
|
146 |
+
? styles.messageTextDark
|
147 |
+
: styles.messageText
|
148 |
+
: styles.messageUserText
|
149 |
}
|
150 |
>
|
151 |
<MarkdownContent
|
|
|
187 |
dataSource={documentList}
|
188 |
renderItem={(item) => {
|
189 |
// TODO:
|
190 |
+
// const fileThumbnail =
|
191 |
+
// documentThumbnails[item.id] || documentThumbnails[item.id];
|
192 |
const fileExtension = getExtension(item.name);
|
193 |
return (
|
194 |
<List.Item>
|
web/src/components/retrieval-documents/index.tsx
CHANGED
@@ -35,7 +35,7 @@ const RetrievalDocuments = ({
|
|
35 |
>
|
36 |
<Space>
|
37 |
<span>
|
38 |
-
{selectedDocumentIds
|
39 |
</span>
|
40 |
{t('knowledgeDetails.filesSelected')}
|
41 |
</Space>
|
|
|
35 |
>
|
36 |
<Space>
|
37 |
<span>
|
38 |
+
{selectedDocumentIds?.length ?? 0}/{documents?.length ?? 0}
|
39 |
</span>
|
40 |
{t('knowledgeDetails.filesSelected')}
|
41 |
</Space>
|
web/src/components/theme-provider.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
import { createContext, useContext, useEffect, useState } from 'react';
|
2 |
|
3 |
-
type Theme = 'dark' | 'light'
|
4 |
|
5 |
type ThemeProviderProps = {
|
6 |
children: React.ReactNode;
|
@@ -14,7 +14,7 @@ type ThemeProviderState = {
|
|
14 |
};
|
15 |
|
16 |
const initialState: ThemeProviderState = {
|
17 |
-
theme: '
|
18 |
setTheme: () => null,
|
19 |
};
|
20 |
|
@@ -22,7 +22,7 @@ const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
|
|
22 |
|
23 |
export function ThemeProvider({
|
24 |
children,
|
25 |
-
defaultTheme = '
|
26 |
storageKey = 'vite-ui-theme',
|
27 |
...props
|
28 |
}: ThemeProviderProps) {
|
@@ -32,32 +32,19 @@ export function ThemeProvider({
|
|
32 |
|
33 |
useEffect(() => {
|
34 |
const root = window.document.documentElement;
|
35 |
-
|
36 |
root.classList.remove('light', 'dark');
|
37 |
-
|
38 |
-
if (theme === 'system') {
|
39 |
-
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)')
|
40 |
-
.matches
|
41 |
-
? 'dark'
|
42 |
-
: 'light';
|
43 |
-
|
44 |
-
root.classList.add(systemTheme);
|
45 |
-
return;
|
46 |
-
}
|
47 |
-
|
48 |
root.classList.add(theme);
|
49 |
-
}, [theme]);
|
50 |
-
|
51 |
-
const value = {
|
52 |
-
theme,
|
53 |
-
setTheme: (theme: Theme) => {
|
54 |
-
localStorage.setItem(storageKey, theme);
|
55 |
-
setTheme(theme);
|
56 |
-
},
|
57 |
-
};
|
58 |
|
59 |
return (
|
60 |
-
<ThemeProviderContext.Provider
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
{children}
|
62 |
</ThemeProviderContext.Provider>
|
63 |
);
|
|
|
1 |
+
import React, { createContext, useContext, useEffect, useState } from 'react';
|
2 |
|
3 |
+
type Theme = 'dark' | 'light';
|
4 |
|
5 |
type ThemeProviderProps = {
|
6 |
children: React.ReactNode;
|
|
|
14 |
};
|
15 |
|
16 |
const initialState: ThemeProviderState = {
|
17 |
+
theme: 'light',
|
18 |
setTheme: () => null,
|
19 |
};
|
20 |
|
|
|
22 |
|
23 |
export function ThemeProvider({
|
24 |
children,
|
25 |
+
defaultTheme = 'light',
|
26 |
storageKey = 'vite-ui-theme',
|
27 |
...props
|
28 |
}: ThemeProviderProps) {
|
|
|
32 |
|
33 |
useEffect(() => {
|
34 |
const root = window.document.documentElement;
|
|
|
35 |
root.classList.remove('light', 'dark');
|
36 |
+
localStorage.setItem(storageKey, theme);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
root.classList.add(theme);
|
38 |
+
}, [storageKey, theme]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
return (
|
41 |
+
<ThemeProviderContext.Provider
|
42 |
+
{...props}
|
43 |
+
value={{
|
44 |
+
theme,
|
45 |
+
setTheme,
|
46 |
+
}}
|
47 |
+
>
|
48 |
{children}
|
49 |
</ThemeProviderContext.Provider>
|
50 |
);
|
web/src/components/ui/navigation-menu.tsx
CHANGED
@@ -123,6 +123,6 @@ export {
|
|
123 |
NavigationMenuLink,
|
124 |
NavigationMenuList,
|
125 |
NavigationMenuTrigger,
|
126 |
-
navigationMenuTriggerStyle,
|
127 |
NavigationMenuViewport,
|
|
|
128 |
};
|
|
|
123 |
NavigationMenuLink,
|
124 |
NavigationMenuList,
|
125 |
NavigationMenuTrigger,
|
|
|
126 |
NavigationMenuViewport,
|
127 |
+
navigationMenuTriggerStyle,
|
128 |
};
|
web/src/layouts/components/header/index.less
CHANGED
@@ -48,6 +48,66 @@
|
|
48 |
color: white;
|
49 |
}
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
|
53 |
.ant-radio-button-wrapper-checked {
|
@@ -55,6 +115,6 @@
|
|
55 |
}
|
56 |
.radioButtonIcon {
|
57 |
vertical-align: middle;
|
58 |
-
max-width:
|
59 |
-
max-height:
|
60 |
}
|
|
|
48 |
color: white;
|
49 |
}
|
50 |
}
|
51 |
+
:global(.ant-radio-button-wrapper-checked.dark) {
|
52 |
+
border-radius: 0px !important;
|
53 |
+
& a {
|
54 |
+
color: white;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
:global(.ant-radio-button-wrapper-checked.dark.first) {
|
58 |
+
border-top-left-radius: 6px !important;
|
59 |
+
border-bottom-left-radius: 6px !important;
|
60 |
+
& a {
|
61 |
+
color: white;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
:global(.ant-radio-button-wrapper-checked.dark.last) {
|
65 |
+
border-top-right-radius: 6px !important;
|
66 |
+
border-bottom-right-radius: 6px !important;
|
67 |
+
& a {
|
68 |
+
color: white;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
.radioGroupDark {
|
74 |
+
& label {
|
75 |
+
height: 40px;
|
76 |
+
line-height: 40px;
|
77 |
+
border: 0 !important;
|
78 |
+
background-color: rgba(249, 249, 249, 0.25);
|
79 |
+
font-weight: @fontWeight700;
|
80 |
+
color: rgba(29, 25, 41, 1);
|
81 |
+
&::before {
|
82 |
+
display: none !important;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
:global(.ant-radio-button-wrapper-checked) {
|
86 |
+
border-radius: 6px !important;
|
87 |
+
& a {
|
88 |
+
color: white;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
:global(.ant-radio-button-wrapper-checked.dark) {
|
92 |
+
border-radius: 0px !important;
|
93 |
+
& a {
|
94 |
+
color: white;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
:global(.ant-radio-button-wrapper-checked.dark.first) {
|
98 |
+
border-top-left-radius: 6px !important;
|
99 |
+
border-bottom-left-radius: 6px !important;
|
100 |
+
& a {
|
101 |
+
color: white;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
:global(.ant-radio-button-wrapper-checked.dark.last) {
|
105 |
+
border-top-right-radius: 6px !important;
|
106 |
+
border-bottom-right-radius: 6px !important;
|
107 |
+
& a {
|
108 |
+
color: white;
|
109 |
+
}
|
110 |
+
}
|
111 |
}
|
112 |
|
113 |
.ant-radio-button-wrapper-checked {
|
|
|
115 |
}
|
116 |
.radioButtonIcon {
|
117 |
vertical-align: middle;
|
118 |
+
max-width: 15px;
|
119 |
+
max-height: 15px;
|
120 |
}
|
web/src/layouts/components/header/index.tsx
CHANGED
@@ -10,6 +10,7 @@ import { MouseEventHandler, useCallback, useMemo } from 'react';
|
|
10 |
import { useLocation } from 'umi';
|
11 |
import Toolbar from '../right-toolbar';
|
12 |
|
|
|
13 |
import styles from './index.less';
|
14 |
|
15 |
const { Header } = Layout;
|
@@ -22,7 +23,7 @@ const RagHeader = () => {
|
|
22 |
const { pathname } = useLocation();
|
23 |
const { t } = useTranslate('header');
|
24 |
const appConf = useFetchAppConf();
|
25 |
-
|
26 |
const tagsData = useMemo(
|
27 |
() => [
|
28 |
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
|
@@ -78,11 +79,17 @@ const RagHeader = () => {
|
|
78 |
<Radio.Group
|
79 |
defaultValue="a"
|
80 |
buttonStyle="solid"
|
81 |
-
className={
|
|
|
|
|
82 |
value={currentPath}
|
83 |
>
|
84 |
-
{tagsData.map((item) => (
|
85 |
-
<Radio.Button
|
|
|
|
|
|
|
|
|
86 |
<a href={item.path}>
|
87 |
<Flex
|
88 |
align="center"
|
|
|
10 |
import { useLocation } from 'umi';
|
11 |
import Toolbar from '../right-toolbar';
|
12 |
|
13 |
+
import { useTheme } from '@/components/theme-provider';
|
14 |
import styles from './index.less';
|
15 |
|
16 |
const { Header } = Layout;
|
|
|
23 |
const { pathname } = useLocation();
|
24 |
const { t } = useTranslate('header');
|
25 |
const appConf = useFetchAppConf();
|
26 |
+
const { theme: themeRag } = useTheme();
|
27 |
const tagsData = useMemo(
|
28 |
() => [
|
29 |
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
|
|
|
79 |
<Radio.Group
|
80 |
defaultValue="a"
|
81 |
buttonStyle="solid"
|
82 |
+
className={
|
83 |
+
themeRag === 'dark' ? styles.radioGroupDark : styles.radioGroup
|
84 |
+
}
|
85 |
value={currentPath}
|
86 |
>
|
87 |
+
{tagsData.map((item, index) => (
|
88 |
+
<Radio.Button
|
89 |
+
className={`${themeRag === 'dark' ? 'dark' : 'light'} ${index === 0 ? 'first' : ''} ${index === tagsData.length - 1 ? 'last' : ''}`}
|
90 |
+
value={item.name}
|
91 |
+
key={item.name}
|
92 |
+
>
|
93 |
<a href={item.path}>
|
94 |
<Flex
|
95 |
align="center"
|
web/src/layouts/components/right-toolbar/index.less
CHANGED
@@ -11,9 +11,13 @@
|
|
11 |
text-align: center;
|
12 |
height: 32px;
|
13 |
border-radius: 50%;
|
14 |
-
background-color: rgba(242, 243, 245,
|
15 |
vertical-align: middle;
|
16 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
|
19 |
.language {
|
|
|
11 |
text-align: center;
|
12 |
height: 32px;
|
13 |
border-radius: 50%;
|
14 |
+
background-color: rgba(242, 243, 245, 0.4);
|
15 |
vertical-align: middle;
|
16 |
cursor: pointer;
|
17 |
+
display: flex;
|
18 |
+
flex-direction: column;
|
19 |
+
justify-content: center;
|
20 |
+
align-items: center;
|
21 |
}
|
22 |
|
23 |
.language {
|
web/src/layouts/components/right-toolbar/index.tsx
CHANGED
@@ -5,9 +5,11 @@ import camelCase from 'lodash/camelCase';
|
|
5 |
import React from 'react';
|
6 |
import User from '../user';
|
7 |
|
|
|
8 |
import { LanguageList, LanguageMap } from '@/constants/common';
|
9 |
import { useChangeLanguage } from '@/hooks/logic-hooks';
|
10 |
import { useFetchUserInfo } from '@/hooks/user-setting-hooks';
|
|
|
11 |
import styled from './index.less';
|
12 |
|
13 |
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
|
@@ -25,6 +27,8 @@ const handleGithubCLick = () => {
|
|
25 |
const RightToolBar = () => {
|
26 |
const { t } = useTranslate('common');
|
27 |
const changeLanguage = useChangeLanguage();
|
|
|
|
|
28 |
const {
|
29 |
data: { language = 'English' },
|
30 |
} = useFetchUserInfo();
|
@@ -40,6 +44,13 @@ const RightToolBar = () => {
|
|
40 |
return [...pre!, { type: 'divider' }, cur];
|
41 |
}, []);
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
return (
|
44 |
<div className={styled.toolbarWrapper}>
|
45 |
<Space wrap size={16}>
|
@@ -52,9 +63,13 @@ const RightToolBar = () => {
|
|
52 |
<Circle>
|
53 |
<GithubOutlined onClick={handleGithubCLick} />
|
54 |
</Circle>
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
<User></User>
|
59 |
</Space>
|
60 |
</div>
|
|
|
5 |
import React from 'react';
|
6 |
import User from '../user';
|
7 |
|
8 |
+
import { useTheme } from '@/components/theme-provider';
|
9 |
import { LanguageList, LanguageMap } from '@/constants/common';
|
10 |
import { useChangeLanguage } from '@/hooks/logic-hooks';
|
11 |
import { useFetchUserInfo } from '@/hooks/user-setting-hooks';
|
12 |
+
import { MoonIcon, SunIcon } from 'lucide-react';
|
13 |
import styled from './index.less';
|
14 |
|
15 |
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
|
|
|
27 |
const RightToolBar = () => {
|
28 |
const { t } = useTranslate('common');
|
29 |
const changeLanguage = useChangeLanguage();
|
30 |
+
const { setTheme, theme } = useTheme();
|
31 |
+
|
32 |
const {
|
33 |
data: { language = 'English' },
|
34 |
} = useFetchUserInfo();
|
|
|
44 |
return [...pre!, { type: 'divider' }, cur];
|
45 |
}, []);
|
46 |
|
47 |
+
const onMoonClick = React.useCallback(() => {
|
48 |
+
setTheme('light');
|
49 |
+
}, [setTheme]);
|
50 |
+
const onSunClick = React.useCallback(() => {
|
51 |
+
setTheme('dark');
|
52 |
+
}, [setTheme]);
|
53 |
+
|
54 |
return (
|
55 |
<div className={styled.toolbarWrapper}>
|
56 |
<Space wrap size={16}>
|
|
|
63 |
<Circle>
|
64 |
<GithubOutlined onClick={handleGithubCLick} />
|
65 |
</Circle>
|
66 |
+
<Circle>
|
67 |
+
{theme === 'dark' ? (
|
68 |
+
<MoonIcon onClick={onMoonClick} size={20} />
|
69 |
+
) : (
|
70 |
+
<SunIcon onClick={onSunClick} size={20} />
|
71 |
+
)}
|
72 |
+
</Circle>
|
73 |
<User></User>
|
74 |
</Space>
|
75 |
</div>
|
web/src/less/mixins.less
CHANGED
@@ -38,7 +38,7 @@
|
|
38 |
}
|
39 |
|
40 |
tr:nth-child(even) {
|
41 |
-
background-color: #
|
42 |
}
|
43 |
}
|
44 |
|
|
|
38 |
}
|
39 |
|
40 |
tr:nth-child(even) {
|
41 |
+
background-color: #f2f2f22a;
|
42 |
}
|
43 |
}
|
44 |
|
web/src/less/variable.less
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
@fontWeight600: 600;
|
2 |
@fontWeight700: 700;
|
3 |
|
4 |
-
@grayBackground: rgba(247, 248, 250, 1);
|
5 |
@gray2: rgba(29, 25, 41, 1);
|
6 |
@gray3: rgba(52, 48, 62, 1);
|
7 |
@gray8: rgba(165, 163, 169, 1);
|
|
|
1 |
@fontWeight600: 600;
|
2 |
@fontWeight700: 700;
|
3 |
|
4 |
+
@grayBackground: rgba(247, 248, 250, 0.1);
|
5 |
@gray2: rgba(29, 25, 41, 1);
|
6 |
@gray3: rgba(52, 48, 62, 1);
|
7 |
@gray8: rgba(165, 163, 169, 1);
|
web/src/locales/config.ts
CHANGED
@@ -2,6 +2,7 @@ import i18n from 'i18next';
|
|
2 |
import LanguageDetector from 'i18next-browser-languagedetector';
|
3 |
import { initReactI18next } from 'react-i18next';
|
4 |
|
|
|
5 |
import translation_en from './en';
|
6 |
import translation_es from './es';
|
7 |
import translation_id from './id';
|
@@ -19,7 +20,15 @@ const resources = {
|
|
19 |
es: translation_es,
|
20 |
vi: translation_vi,
|
21 |
};
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
i18n
|
24 |
.use(initReactI18next)
|
25 |
.use(LanguageDetector)
|
|
|
2 |
import LanguageDetector from 'i18next-browser-languagedetector';
|
3 |
import { initReactI18next } from 'react-i18next';
|
4 |
|
5 |
+
import { createTranslationTable, flattenObject } from './until';
|
6 |
import translation_en from './en';
|
7 |
import translation_es from './es';
|
8 |
import translation_id from './id';
|
|
|
20 |
es: translation_es,
|
21 |
vi: translation_vi,
|
22 |
};
|
23 |
+
const enFlattened = flattenObject(translation_en);
|
24 |
+
const viFlattened = flattenObject(translation_vi);
|
25 |
+
const esFlattened = flattenObject(translation_es);
|
26 |
+
const zhFlattened = flattenObject(translation_zh);
|
27 |
+
const zh_traditionalFlattened = flattenObject(translation_zh_traditional);
|
28 |
+
export const translationTable = createTranslationTable(
|
29 |
+
[enFlattened, viFlattened, esFlattened, zhFlattened, zh_traditionalFlattened],
|
30 |
+
['English', 'Vietnamese', 'Spanish', 'zh', 'zh-TRADITIONAL'],
|
31 |
+
);
|
32 |
i18n
|
33 |
.use(initReactI18next)
|
34 |
.use(LanguageDetector)
|
web/src/locales/en.ts
CHANGED
@@ -303,9 +303,9 @@ The above is the content you need to summarize.`,
|
|
303 |
randomSeed: 'Random seed',
|
304 |
randomSeedMessage: 'Random seed is required',
|
305 |
entityTypes: 'Entity types',
|
|
|
306 |
pageRank: 'Page rank',
|
307 |
-
pageRankTip: `This is used to boost the relevance score. The relevance score with all the retrieved chunks will plus this number
|
308 |
-
When you want to search the given knowledge base at first place, set a higher pagerank score than others.`,
|
309 |
},
|
310 |
chunk: {
|
311 |
chunk: 'Chunk',
|
|
|
303 |
randomSeed: 'Random seed',
|
304 |
randomSeedMessage: 'Random seed is required',
|
305 |
entityTypes: 'Entity types',
|
306 |
+
vietnamese: 'Vietamese',
|
307 |
pageRank: 'Page rank',
|
308 |
+
pageRankTip: `This is used to boost the relevance score. The relevance score with all the retrieved chunks will plus this number, When you want to search the given knowledge base at first place, set a higher pagerank score than others.`,
|
|
|
309 |
},
|
310 |
chunk: {
|
311 |
chunk: 'Chunk',
|
web/src/locales/es.ts
CHANGED
@@ -277,6 +277,7 @@ export default {
|
|
277 |
multiTurn: 'Optimización de múltiples turnos',
|
278 |
multiTurnTip:
|
279 |
'En conversaciones de múltiples rondas, la consulta a la base de conocimiento se optimiza. El gran modelo se llamará para consumir tokens adicionales.',
|
|
|
280 |
},
|
281 |
setting: {
|
282 |
profile: 'Perfil',
|
|
|
277 |
multiTurn: 'Optimización de múltiples turnos',
|
278 |
multiTurnTip:
|
279 |
'En conversaciones de múltiples rondas, la consulta a la base de conocimiento se optimiza. El gran modelo se llamará para consumir tokens adicionales.',
|
280 |
+
description: 'Description of assistant',
|
281 |
},
|
282 |
setting: {
|
283 |
profile: 'Perfil',
|
web/src/locales/id.ts
CHANGED
@@ -449,6 +449,7 @@ export default {
|
|
449 |
multiTurnTip:
|
450 |
'Dalam percakapan multi-putaran, kueri ke basis pengetahuan dioptimalkan. Model besar akan dipanggil untuk mengonsumsi token tambahan.',
|
451 |
languageSelectionTip: 'Pilih bahasa yang digunakan dalam percakapan.',
|
|
|
452 |
},
|
453 |
setting: {
|
454 |
profile: 'Profil',
|
@@ -748,7 +749,7 @@ export default {
|
|
748 |
bingTip:
|
749 |
'Komponen ini digunakan untuk mendapatkan hasil pencarian dari https://www.bing.com/. Biasanya, ini berfungsi sebagai pelengkap basis pengetahuan. Top N dan Kunci Langganan Bing menentukan jumlah hasil pencarian yang perlu Anda sesuaikan.',
|
750 |
apiKey: 'Kunci API',
|
751 |
-
country: 'Negara
|
752 |
language: 'Bahasa',
|
753 |
googleScholar: 'Google Scholar',
|
754 |
googleScholarDescription:
|
|
|
449 |
multiTurnTip:
|
450 |
'Dalam percakapan multi-putaran, kueri ke basis pengetahuan dioptimalkan. Model besar akan dipanggil untuk mengonsumsi token tambahan.',
|
451 |
languageSelectionTip: 'Pilih bahasa yang digunakan dalam percakapan.',
|
452 |
+
description: 'Description of assistant',
|
453 |
},
|
454 |
setting: {
|
455 |
profile: 'Profil',
|
|
|
749 |
bingTip:
|
750 |
'Komponen ini digunakan untuk mendapatkan hasil pencarian dari https://www.bing.com/. Biasanya, ini berfungsi sebagai pelengkap basis pengetahuan. Top N dan Kunci Langganan Bing menentukan jumlah hasil pencarian yang perlu Anda sesuaikan.',
|
751 |
apiKey: 'Kunci API',
|
752 |
+
country: 'Negara',
|
753 |
language: 'Bahasa',
|
754 |
googleScholar: 'Google Scholar',
|
755 |
googleScholarDescription:
|
web/src/locales/until.ts
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
type NestedObject = {
|
2 |
+
[key: string]: string | NestedObject;
|
3 |
+
};
|
4 |
+
|
5 |
+
type FlattenedObject = {
|
6 |
+
[key: string]: string;
|
7 |
+
};
|
8 |
+
|
9 |
+
export function flattenObject(
|
10 |
+
obj: NestedObject,
|
11 |
+
parentKey: string = '',
|
12 |
+
): FlattenedObject {
|
13 |
+
const result: FlattenedObject = {};
|
14 |
+
|
15 |
+
for (const [key, value] of Object.entries(obj)) {
|
16 |
+
const newKey = parentKey ? `${parentKey}.${key}` : key;
|
17 |
+
|
18 |
+
if (typeof value === 'object' && value !== null) {
|
19 |
+
Object.assign(result, flattenObject(value as NestedObject, newKey));
|
20 |
+
} else {
|
21 |
+
result[newKey] = value as string;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
return result;
|
26 |
+
}
|
27 |
+
type TranslationTableRow = {
|
28 |
+
key: string;
|
29 |
+
[language: string]: string;
|
30 |
+
};
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Creates a translation table from multiple flattened language objects.
|
34 |
+
* @param langs - A list of flattened language objects.
|
35 |
+
* @param langKeys - A list of language identifiers (e.g., 'English', 'Vietnamese').
|
36 |
+
* @returns An array representing the translation table.
|
37 |
+
*/
|
38 |
+
export function createTranslationTable(
|
39 |
+
langs: FlattenedObject[],
|
40 |
+
langKeys: string[],
|
41 |
+
): TranslationTableRow[] {
|
42 |
+
const keys = new Set<string>();
|
43 |
+
|
44 |
+
// Collect all unique keys from the language objects
|
45 |
+
langs.forEach((lang) => {
|
46 |
+
Object.keys(lang).forEach((key) => keys.add(key));
|
47 |
+
});
|
48 |
+
|
49 |
+
// Build the table
|
50 |
+
return Array.from(keys).map((key) => {
|
51 |
+
const row: TranslationTableRow = { key };
|
52 |
+
|
53 |
+
langs.forEach((lang, index) => {
|
54 |
+
const langKey = langKeys[index];
|
55 |
+
row[langKey] = lang[key] || ''; // Use empty string if key is missing
|
56 |
+
});
|
57 |
+
|
58 |
+
return row;
|
59 |
+
});
|
60 |
+
}
|
web/src/locales/vi.ts
CHANGED
@@ -34,6 +34,7 @@ export default {
|
|
34 |
pleaseInput: 'Vui lòng nhập',
|
35 |
submit: 'Gửi',
|
36 |
vietnamese: 'Tiếng việt',
|
|
|
37 |
},
|
38 |
login: {
|
39 |
login: 'Đăng nhập',
|
@@ -76,6 +77,7 @@ export default {
|
|
76 |
namePlaceholder: 'Vui lòng nhập tên!',
|
77 |
doc: 'Tài liệu',
|
78 |
searchKnowledgePlaceholder: 'Tìm kiếm',
|
|
|
79 |
},
|
80 |
knowledgeDetails: {
|
81 |
dataset: 'Dữ liệu',
|
@@ -162,6 +164,7 @@ export default {
|
|
162 |
autoKeywordsTip: `Trích xuất N từ khóa cho mỗi khối để tăng thứ hạng của chúng cho các truy vấn chứa các từ khóa đó. Bạn có thể kiểm tra hoặc cập nhật các từ khóa đã thêm cho một khối từ danh sách khối. Lưu ý rằng các token bổ sung sẽ được tiêu thụ bởi LLM được chỉ định trong 'Cài đặt mô hình hệ thống'.`,
|
163 |
autoQuestions: 'Câu hỏi tự động',
|
164 |
autoQuestionsTip: `Trích xuất N câu hỏi cho mỗi khối để tăng thứ hạng của chúng cho các truy vấn chứa các câu hỏi đó. Bạn có thể kiểm tra hoặc cập nhật các câu hỏi đã thêm cho một khối từ danh sách khối. Tính năng này sẽ không làm gián đoạn quá trình phân khối nếu xảy ra lỗi, ngoại trừ việc nó có thể thêm kết quả trống vào khối gốc. Lưu ý rằng các token bổ sung sẽ được tiêu thụ bởi LLM được chỉ định trong 'Cài đặt mô hình hệ thống'.`,
|
|
|
165 |
},
|
166 |
knowledgeConfiguration: {
|
167 |
titleDescription:
|
@@ -297,6 +300,9 @@ export default {
|
|
297 |
randomSeed: 'Hạt giống ngẫu nhiên',
|
298 |
randomSeedMessage: 'Hạt giống ngẫu nhiên là bắt buộc',
|
299 |
entityTypes: 'Loại thực thể',
|
|
|
|
|
|
|
300 |
},
|
301 |
chunk: {
|
302 |
chunk: 'Khối',
|
@@ -316,6 +322,9 @@ export default {
|
|
316 |
ellipse: 'Elip',
|
317 |
graph: 'Biểu đồ kiến thức',
|
318 |
mind: 'Sơ đồ tư duy',
|
|
|
|
|
|
|
319 |
},
|
320 |
chat: {
|
321 |
newConversation: 'Cuộc trò chuyện mới',
|
@@ -593,6 +602,12 @@ export default {
|
|
593 |
refuse: 'Từ chối',
|
594 |
teamMembers: 'Thành viên nhóm',
|
595 |
joinedTeams: 'Nhóm đã tham gia',
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
},
|
597 |
message: {
|
598 |
registered: 'Đã đăng ký!',
|
@@ -625,8 +640,8 @@ export default {
|
|
625 |
requestError: 'Lỗi yêu cầu',
|
626 |
networkAnomalyDescription:
|
627 |
'Mạng của bạn có sự bất thường và bạn không thể kết nối với máy chủ.',
|
628 |
-
networkAnomaly: '
|
629 |
-
hint: '
|
630 |
},
|
631 |
fileManager: {
|
632 |
name: 'Tên',
|
@@ -1033,6 +1048,27 @@ export default {
|
|
1033 |
optional: 'Tùy chọn',
|
1034 |
pasteFileLink: 'Dán liên kết tệp',
|
1035 |
testRun: 'Chạy thử nghiệm',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1036 |
},
|
1037 |
footer: {
|
1038 |
profile: 'All rights reserved @ React',
|
|
|
34 |
pleaseInput: 'Vui lòng nhập',
|
35 |
submit: 'Gửi',
|
36 |
vietnamese: 'Tiếng việt',
|
37 |
+
spanish: 'Tiếng Tây Ban Nha',
|
38 |
},
|
39 |
login: {
|
40 |
login: 'Đăng nhập',
|
|
|
77 |
namePlaceholder: 'Vui lòng nhập tên!',
|
78 |
doc: 'Tài liệu',
|
79 |
searchKnowledgePlaceholder: 'Tìm kiếm',
|
80 |
+
noMoreData: 'Tất cả chỉ có thế, không còn gì nữa',
|
81 |
},
|
82 |
knowledgeDetails: {
|
83 |
dataset: 'Dữ liệu',
|
|
|
164 |
autoKeywordsTip: `Trích xuất N từ khóa cho mỗi khối để tăng thứ hạng của chúng cho các truy vấn chứa các từ khóa đó. Bạn có thể kiểm tra hoặc cập nhật các từ khóa đã thêm cho một khối từ danh sách khối. Lưu ý rằng các token bổ sung sẽ được tiêu thụ bởi LLM được chỉ định trong 'Cài đặt mô hình hệ thống'.`,
|
165 |
autoQuestions: 'Câu hỏi tự động',
|
166 |
autoQuestionsTip: `Trích xuất N câu hỏi cho mỗi khối để tăng thứ hạng của chúng cho các truy vấn chứa các câu hỏi đó. Bạn có thể kiểm tra hoặc cập nhật các câu hỏi đã thêm cho một khối từ danh sách khối. Tính năng này sẽ không làm gián đoạn quá trình phân khối nếu xảy ra lỗi, ngoại trừ việc nó có thể thêm kết quả trống vào khối gốc. Lưu ý rằng các token bổ sung sẽ được tiêu thụ bởi LLM được chỉ định trong 'Cài đặt mô hình hệ thống'.`,
|
167 |
+
delimiterTip: `Hỗ trợ nhiều ký tự phân cách, và các ký tự phân cách nhiều ký tự được bao bọc bởi dấu . Ví dụ: nếu được cấu hình như thế này: "##"; thì văn bản sẽ được phân tách bởi dấu xuống dòng, hai dấu # và dấu chấm phẩy, sau đó được lắp ráp theo kích thước của "số token".`,
|
168 |
},
|
169 |
knowledgeConfiguration: {
|
170 |
titleDescription:
|
|
|
300 |
randomSeed: 'Hạt giống ngẫu nhiên',
|
301 |
randomSeedMessage: 'Hạt giống ngẫu nhiên là bắt buộc',
|
302 |
entityTypes: 'Loại thực thể',
|
303 |
+
vietnamese: 'Tiếng Việt',
|
304 |
+
pageRank: 'Xếp hạng trang',
|
305 |
+
pageRankTip: `Điều này được sử dụng để tăng điểm liên quan. Điểm liên quan với tất cả các khối được truy xuất sẽ cộng với số này, Khi bạn muốn tìm kiếm cơ sở kiến thức đã cho ở vị trí đầu tiên, hãy đặt điểm "Page Rank" cao hơn những điểm khác.`,
|
306 |
},
|
307 |
chunk: {
|
308 |
chunk: 'Khối',
|
|
|
322 |
ellipse: 'Elip',
|
323 |
graph: 'Biểu đồ kiến thức',
|
324 |
mind: 'Sơ đồ tư duy',
|
325 |
+
question: 'Câu hỏi',
|
326 |
+
questionTip:
|
327 |
+
'Nếu có những câu hỏi được đưa ra, việc nhúng phần đó sẽ dựa trên những câu hỏi đó.',
|
328 |
},
|
329 |
chat: {
|
330 |
newConversation: 'Cuộc trò chuyện mới',
|
|
|
602 |
refuse: 'Từ chối',
|
603 |
teamMembers: 'Thành viên nhóm',
|
604 |
joinedTeams: 'Nhóm đã tham gia',
|
605 |
+
bedrockModelNameMessage: `Vui lòng nhập tên model của bạn!`,
|
606 |
+
sureDelete: `Bạn có chắc chắn muốn xóa thành viên này không?`,
|
607 |
+
quit: `Rời khỏi`,
|
608 |
+
sureQuit: `Bạn có chắc chắn muốn rời khỏi nhóm mà bạn đã tham gia không?`,
|
609 |
+
FishAudioAKMessage: `Vui lòng nhập KEY API`,
|
610 |
+
FishAudioRefIDMessage: `Vui lòng nhập ID của model tham chiếu (để trống để sử dụng model mặc định)`,
|
611 |
},
|
612 |
message: {
|
613 |
registered: 'Đã đăng ký!',
|
|
|
640 |
requestError: 'Lỗi yêu cầu',
|
641 |
networkAnomalyDescription:
|
642 |
'Mạng của bạn có sự bất thường và bạn không thể kết nối với máy chủ.',
|
643 |
+
networkAnomaly: 'Bất thường mạng',
|
644 |
+
hint: 'Gợi ý',
|
645 |
},
|
646 |
fileManager: {
|
647 |
name: 'Tên',
|
|
|
1048 |
optional: 'Tùy chọn',
|
1049 |
pasteFileLink: 'Dán liên kết tệp',
|
1050 |
testRun: 'Chạy thử nghiệm',
|
1051 |
+
template: 'Mẫu',
|
1052 |
+
templateDescription: `Thành phần này được sử dụng để sắp chữ đầu ra của nhiều thành phần khác nhau.`,
|
1053 |
+
arXivTip: `Thành phần này được sử dụng để lấy kết quả tìm kiếm từ https://arxiv.org/. Thông thường, nó hoạt động như một phần bổ sung cho cơ sở tri thức. Top N chỉ định số lượng kết quả tìm kiếm bạn cần điều chỉnh.`,
|
1054 |
+
googleTip: `Thành phần này được sử dụng để lấy kết quả tìm kiếm từ https://www.google.com/. Thông thường, nó hoạt động như một phần bổ sung cho cơ sở tri thức. Top N và khóa API SerpApi chỉ định số lượng kết quả tìm kiếm bạn cần điều chỉnh.`,
|
1055 |
+
bingTip: `Thành phần này được sử dụng để lấy kết quả tìm kiếm từ https://www.bing.com/. Thông thường, nó hoạt động như một phần bổ sung cho cơ sở tri thức. Top N và khóa đăng ký Bing chỉ định số lượng kết quả tìm kiếm bạn cần điều chỉnh.`,
|
1056 |
+
gitHubDescription: `Thành phần này được sử dụng để tìm kiếm các kho lưu trữ từ https://github.com/. Top N chỉ định số lượng kết quả tìm kiếm cần điều chỉnh.`,
|
1057 |
+
flow: `Quy trình làm việc`,
|
1058 |
+
emailDescription: 'Gửi email đến địa chỉ đã chỉ định',
|
1059 |
+
toEmail: 'Email người nhận',
|
1060 |
+
smtpServerRequired: 'Vui lòng nhập địa chỉ máy chủ SMTP',
|
1061 |
+
emailContent: 'Nội dung',
|
1062 |
+
smtpServer: 'SMTP Server',
|
1063 |
+
smtpPort: 'SMTP Port',
|
1064 |
+
senderEmailRequired: 'Vui lòng nhập email người gửi',
|
1065 |
+
authCodeRequired: 'Vui lòng nhập mã xác thực',
|
1066 |
+
toEmailRequired: 'Vui lòng nhập email người nhận',
|
1067 |
+
emailContentRequired: 'Vui lòng nhập nội dung email',
|
1068 |
+
emailSentSuccess: 'Email đã được gửi thành công',
|
1069 |
+
emailSentFailed: 'Không gửi được email',
|
1070 |
+
jsonFormatTip:
|
1071 |
+
'Thành phần thượng nguồn phải cung cấp chuỗi JSON theo định dạng sau:',
|
1072 |
},
|
1073 |
footer: {
|
1074 |
profile: 'All rights reserved @ React',
|
web/src/locales/zh-traditional.ts
CHANGED
@@ -428,6 +428,7 @@ export default {
|
|
428 |
multiTurnTip:
|
429 |
'在多輪對話的中,對去知識庫查詢的問題進行最佳化。會呼叫大模型額外消耗token。',
|
430 |
howUseId: '如何使用聊天ID?',
|
|
|
431 |
},
|
432 |
setting: {
|
433 |
profile: '概述',
|
|
|
428 |
multiTurnTip:
|
429 |
'在多輪對話的中,對去知識庫查詢的問題進行最佳化。會呼叫大模型額外消耗token。',
|
430 |
howUseId: '如何使用聊天ID?',
|
431 |
+
description: '助理描述',
|
432 |
},
|
433 |
setting: {
|
434 |
profile: '概述',
|
web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-card/index.less
CHANGED
@@ -29,3 +29,6 @@
|
|
29 |
.cardSelected {
|
30 |
background-color: @selectedBackgroundColor;
|
31 |
}
|
|
|
|
|
|
|
|
29 |
.cardSelected {
|
30 |
background-color: @selectedBackgroundColor;
|
31 |
}
|
32 |
+
.cardSelectedDark {
|
33 |
+
background-color: #ffffff2f;
|
34 |
+
}
|
web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-card/index.tsx
CHANGED
@@ -5,6 +5,7 @@ import classNames from 'classnames';
|
|
5 |
import DOMPurify from 'dompurify';
|
6 |
import { useEffect, useState } from 'react';
|
7 |
|
|
|
8 |
import { ChunkTextMode } from '../../constant';
|
9 |
import styles from './index.less';
|
10 |
|
@@ -31,6 +32,7 @@ const ChunkCard = ({
|
|
31 |
}: IProps) => {
|
32 |
const available = Number(item.available_int);
|
33 |
const [enabled, setEnabled] = useState(false);
|
|
|
34 |
|
35 |
const onChange = (checked: boolean) => {
|
36 |
setEnabled(checked);
|
@@ -56,7 +58,8 @@ const ChunkCard = ({
|
|
56 |
return (
|
57 |
<Card
|
58 |
className={classNames(styles.chunkCard, {
|
59 |
-
[styles.cardSelected]:
|
|
|
60 |
})}
|
61 |
>
|
62 |
<Flex gap={'middle'} justify={'space-between'}>
|
|
|
5 |
import DOMPurify from 'dompurify';
|
6 |
import { useEffect, useState } from 'react';
|
7 |
|
8 |
+
import { useTheme } from '@/components/theme-provider';
|
9 |
import { ChunkTextMode } from '../../constant';
|
10 |
import styles from './index.less';
|
11 |
|
|
|
32 |
}: IProps) => {
|
33 |
const available = Number(item.available_int);
|
34 |
const [enabled, setEnabled] = useState(false);
|
35 |
+
const { theme } = useTheme();
|
36 |
|
37 |
const onChange = (checked: boolean) => {
|
38 |
setEnabled(checked);
|
|
|
58 |
return (
|
59 |
<Card
|
60 |
className={classNames(styles.chunkCard, {
|
61 |
+
[`${theme === 'dark' ? styles.cardSelectedDark : styles.cardSelected}`]:
|
62 |
+
selected,
|
63 |
})}
|
64 |
>
|
65 |
<Flex gap={'middle'} justify={'space-between'}>
|
web/src/pages/add-knowledge/components/knowledge-setting/category-panel.tsx
CHANGED
@@ -37,16 +37,14 @@ const CategoryPanel = ({ chunkMethod }: { chunkMethod: string }) => {
|
|
37 |
{imageList.length > 0 ? (
|
38 |
<>
|
39 |
<Title level={5} className={styles.topTitle}>
|
40 |
-
"{item.title}" {t('methodTitle')}
|
41 |
</Title>
|
42 |
<p
|
43 |
dangerouslySetInnerHTML={{
|
44 |
__html: DOMPurify.sanitize(item.description),
|
45 |
}}
|
46 |
></p>
|
47 |
-
<Title level={5}>
|
48 |
-
"{item.title}" {t('methodExamples')}
|
49 |
-
</Title>
|
50 |
<Text>{t('methodExamplesDescription')}</Text>
|
51 |
<Row gutter={[10, 10]} className={styles.imageRow}>
|
52 |
{imageList.map((x) => (
|
|
|
37 |
{imageList.length > 0 ? (
|
38 |
<>
|
39 |
<Title level={5} className={styles.topTitle}>
|
40 |
+
{`"${item.title}" ${t('methodTitle')}`}
|
41 |
</Title>
|
42 |
<p
|
43 |
dangerouslySetInnerHTML={{
|
44 |
__html: DOMPurify.sanitize(item.description),
|
45 |
}}
|
46 |
></p>
|
47 |
+
<Title level={5}>{`"${item.title}" ${t('methodExamples')}`}</Title>
|
|
|
|
|
48 |
<Text>{t('methodExamplesDescription')}</Text>
|
49 |
<Row gutter={[10, 10]} className={styles.imageRow}>
|
50 |
{imageList.map((x) => (
|
web/src/pages/add-knowledge/components/knowledge-setting/configuration.tsx
CHANGED
@@ -70,6 +70,7 @@ const ConfigurationForm = ({ form }: { form: FormInstance }) => {
|
|
70 |
<Select placeholder={t('languagePlaceholder')}>
|
71 |
<Option value="English">{t('english')}</Option>
|
72 |
<Option value="Chinese">{t('chinese')}</Option>
|
|
|
73 |
</Select>
|
74 |
</Form.Item>
|
75 |
<Form.Item
|
|
|
70 |
<Select placeholder={t('languagePlaceholder')}>
|
71 |
<Option value="English">{t('english')}</Option>
|
72 |
<Option value="Chinese">{t('chinese')}</Option>
|
73 |
+
<Option value="Vietnamese">{t('vietnamese')}</Option>
|
74 |
</Select>
|
75 |
</Form.Item>
|
76 |
<Form.Item
|
web/src/pages/add-knowledge/components/knowledge-sidebar/index.less
CHANGED
@@ -11,7 +11,6 @@
|
|
11 |
font-size: 16px;
|
12 |
line-height: 24px;
|
13 |
font-weight: @fontWeight700;
|
14 |
-
color: @gray2;
|
15 |
margin-bottom: 6px;
|
16 |
}
|
17 |
.knowledgeDescription {
|
|
|
11 |
font-size: 16px;
|
12 |
line-height: 24px;
|
13 |
font-weight: @fontWeight700;
|
|
|
14 |
margin-bottom: 6px;
|
15 |
}
|
16 |
.knowledgeDescription {
|
web/src/pages/add-knowledge/components/knowledge-testing/index.less
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
.testingWrapper {
|
2 |
flex: 1;
|
3 |
-
background-color: @grayBackground;
|
4 |
height: 100%;
|
5 |
}
|
|
|
1 |
.testingWrapper {
|
2 |
flex: 1;
|
|
|
3 |
height: 100%;
|
4 |
}
|
web/src/pages/add-knowledge/components/knowledge-testing/testing-control/index.less
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.testingControlWrapper {
|
2 |
width: 350px;
|
3 |
-
background-color:
|
4 |
padding: 30px 20px;
|
5 |
overflow: auto;
|
6 |
height: calc(100vh - 160px);
|
|
|
1 |
.testingControlWrapper {
|
2 |
width: 350px;
|
3 |
+
background-color: rgba(255, 255, 255, 0.1);
|
4 |
padding: 30px 20px;
|
5 |
overflow: auto;
|
6 |
height: calc(100vh - 160px);
|
web/src/pages/add-knowledge/components/knowledge-testing/testing-result/index.less
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.testingResultWrapper {
|
2 |
flex: 1;
|
3 |
-
background-color:
|
4 |
padding: 30px 20px;
|
5 |
overflow: auto;
|
6 |
height: calc(100vh - 160px);
|
@@ -24,7 +24,7 @@
|
|
24 |
width: 24px;
|
25 |
height: 24px;
|
26 |
border-radius: 50%;
|
27 |
-
background-color: rgba(
|
28 |
font-size: 10px;
|
29 |
font-weight: normal;
|
30 |
}
|
|
|
1 |
.testingResultWrapper {
|
2 |
flex: 1;
|
3 |
+
background-color: rgba(255, 255, 255, 0.1);
|
4 |
padding: 30px 20px;
|
5 |
overflow: auto;
|
6 |
height: calc(100vh - 160px);
|
|
|
24 |
width: 24px;
|
25 |
height: 24px;
|
26 |
border-radius: 50%;
|
27 |
+
background-color: rgba(255, 255, 255, 0.1);
|
28 |
font-size: 10px;
|
29 |
font-weight: normal;
|
30 |
}
|
web/src/pages/add-knowledge/components/knowledge-testing/testing-result/index.tsx
CHANGED
@@ -82,7 +82,7 @@ const TestingResult = ({ handleTesting }: IProps) => {
|
|
82 |
>
|
83 |
<Space>
|
84 |
<span>
|
85 |
-
{selectedDocumentIds?.length ?? 0}/{documents
|
86 |
</span>
|
87 |
{t('filesSelected')}
|
88 |
</Space>
|
@@ -105,7 +105,7 @@ const TestingResult = ({ handleTesting }: IProps) => {
|
|
105 |
flex={1}
|
106 |
className={styles.selectFilesCollapse}
|
107 |
>
|
108 |
-
{chunks
|
109 |
<Card key={x.chunk_id} title={<ChunkTitle item={x}></ChunkTitle>}>
|
110 |
<Flex gap={'middle'}>
|
111 |
{x.img_id && (
|
|
|
82 |
>
|
83 |
<Space>
|
84 |
<span>
|
85 |
+
{selectedDocumentIds?.length ?? 0}/{documents?.length ?? 0}
|
86 |
</span>
|
87 |
{t('filesSelected')}
|
88 |
</Space>
|
|
|
105 |
flex={1}
|
106 |
className={styles.selectFilesCollapse}
|
107 |
>
|
108 |
+
{chunks?.map((x) => (
|
109 |
<Card key={x.chunk_id} title={<ChunkTitle item={x}></ChunkTitle>}>
|
110 |
<Flex gap={'middle'}>
|
111 |
{x.img_id && (
|
web/src/pages/add-knowledge/index.less
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
flex: 1;
|
7 |
overflow-x: auto;
|
8 |
height: 100%;
|
9 |
-
background-color: rgba(
|
10 |
padding: 16px 20px 28px 40px;
|
11 |
display: flex;
|
12 |
flex-direction: column;
|
13 |
}
|
14 |
.content {
|
15 |
-
background-color:
|
16 |
margin-top: 16px;
|
17 |
flex: 1;
|
18 |
}
|
|
|
6 |
flex: 1;
|
7 |
overflow-x: auto;
|
8 |
height: 100%;
|
9 |
+
background-color: rgba(255, 255, 255, 0.1);
|
10 |
padding: 16px 20px 28px 40px;
|
11 |
display: flex;
|
12 |
flex-direction: column;
|
13 |
}
|
14 |
.content {
|
15 |
+
background-color: rgba(255, 255, 255, 0.1);
|
16 |
margin-top: 16px;
|
17 |
flex: 1;
|
18 |
}
|
web/src/pages/chat/chat-configuration-modal/model-setting.tsx
CHANGED
@@ -42,224 +42,6 @@ const ModelSetting = ({
|
|
42 |
})}
|
43 |
>
|
44 |
{visible && <LlmSettingItems prefix="llm_setting"></LlmSettingItems>}
|
45 |
-
{/* <Form.Item
|
46 |
-
label={t('model')}
|
47 |
-
name="llm_id"
|
48 |
-
tooltip={t('modelTip')}
|
49 |
-
rules={[{ required: true, message: t('modelMessage') }]}
|
50 |
-
>
|
51 |
-
<Select options={modelOptions[LlmModelType.Chat]} showSearch />
|
52 |
-
</Form.Item>
|
53 |
-
<Divider></Divider>
|
54 |
-
<Form.Item
|
55 |
-
label={t('freedom')}
|
56 |
-
name="parameters"
|
57 |
-
tooltip={t('freedomTip')}
|
58 |
-
initialValue={ModelVariableType.Precise}
|
59 |
-
>
|
60 |
-
<Select<ModelVariableType>
|
61 |
-
options={parameterOptions}
|
62 |
-
onChange={handleParametersChange}
|
63 |
-
/>
|
64 |
-
</Form.Item>
|
65 |
-
<Form.Item label={t('temperature')} tooltip={t('temperatureTip')}>
|
66 |
-
<Flex gap={20} align="center">
|
67 |
-
<Form.Item
|
68 |
-
name={'temperatureEnabled'}
|
69 |
-
valuePropName="checked"
|
70 |
-
noStyle
|
71 |
-
>
|
72 |
-
<Switch size="small" />
|
73 |
-
</Form.Item>
|
74 |
-
<Form.Item noStyle dependencies={['temperatureEnabled']}>
|
75 |
-
{({ getFieldValue }) => {
|
76 |
-
const disabled = !getFieldValue('temperatureEnabled');
|
77 |
-
return (
|
78 |
-
<>
|
79 |
-
<Flex flex={1}>
|
80 |
-
<Form.Item name={['llm_setting', 'temperature']} noStyle>
|
81 |
-
<Slider
|
82 |
-
className={styles.variableSlider}
|
83 |
-
max={1}
|
84 |
-
step={0.01}
|
85 |
-
disabled={disabled}
|
86 |
-
/>
|
87 |
-
</Form.Item>
|
88 |
-
</Flex>
|
89 |
-
<Form.Item name={['llm_setting', 'temperature']} noStyle>
|
90 |
-
<InputNumber
|
91 |
-
className={styles.sliderInputNumber}
|
92 |
-
max={1}
|
93 |
-
min={0}
|
94 |
-
step={0.01}
|
95 |
-
disabled={disabled}
|
96 |
-
/>
|
97 |
-
</Form.Item>
|
98 |
-
</>
|
99 |
-
);
|
100 |
-
}}
|
101 |
-
</Form.Item>
|
102 |
-
</Flex>
|
103 |
-
</Form.Item>
|
104 |
-
<Form.Item label={t('topP')} tooltip={t('topPTip')}>
|
105 |
-
<Flex gap={20} align="center">
|
106 |
-
<Form.Item name={'topPEnabled'} valuePropName="checked" noStyle>
|
107 |
-
<Switch size="small" />
|
108 |
-
</Form.Item>
|
109 |
-
<Form.Item noStyle dependencies={['topPEnabled']}>
|
110 |
-
{({ getFieldValue }) => {
|
111 |
-
const disabled = !getFieldValue('topPEnabled');
|
112 |
-
return (
|
113 |
-
<>
|
114 |
-
<Flex flex={1}>
|
115 |
-
<Form.Item name={['llm_setting', 'top_p']} noStyle>
|
116 |
-
<Slider
|
117 |
-
className={styles.variableSlider}
|
118 |
-
max={1}
|
119 |
-
step={0.01}
|
120 |
-
disabled={disabled}
|
121 |
-
/>
|
122 |
-
</Form.Item>
|
123 |
-
</Flex>
|
124 |
-
<Form.Item name={['llm_setting', 'top_p']} noStyle>
|
125 |
-
<InputNumber
|
126 |
-
className={styles.sliderInputNumber}
|
127 |
-
max={1}
|
128 |
-
min={0}
|
129 |
-
step={0.01}
|
130 |
-
disabled={disabled}
|
131 |
-
/>
|
132 |
-
</Form.Item>
|
133 |
-
</>
|
134 |
-
);
|
135 |
-
}}
|
136 |
-
</Form.Item>
|
137 |
-
</Flex>
|
138 |
-
</Form.Item>
|
139 |
-
<Form.Item label={t('presencePenalty')} tooltip={t('presencePenaltyTip')}>
|
140 |
-
<Flex gap={20} align="center">
|
141 |
-
<Form.Item
|
142 |
-
name={'presencePenaltyEnabled'}
|
143 |
-
valuePropName="checked"
|
144 |
-
noStyle
|
145 |
-
>
|
146 |
-
<Switch size="small" />
|
147 |
-
</Form.Item>
|
148 |
-
<Form.Item noStyle dependencies={['presencePenaltyEnabled']}>
|
149 |
-
{({ getFieldValue }) => {
|
150 |
-
const disabled = !getFieldValue('presencePenaltyEnabled');
|
151 |
-
return (
|
152 |
-
<>
|
153 |
-
<Flex flex={1}>
|
154 |
-
<Form.Item
|
155 |
-
name={['llm_setting', 'presence_penalty']}
|
156 |
-
noStyle
|
157 |
-
>
|
158 |
-
<Slider
|
159 |
-
className={styles.variableSlider}
|
160 |
-
max={1}
|
161 |
-
step={0.01}
|
162 |
-
disabled={disabled}
|
163 |
-
/>
|
164 |
-
</Form.Item>
|
165 |
-
</Flex>
|
166 |
-
<Form.Item name={['llm_setting', 'presence_penalty']} noStyle>
|
167 |
-
<InputNumber
|
168 |
-
className={styles.sliderInputNumber}
|
169 |
-
max={1}
|
170 |
-
min={0}
|
171 |
-
step={0.01}
|
172 |
-
disabled={disabled}
|
173 |
-
/>
|
174 |
-
</Form.Item>
|
175 |
-
</>
|
176 |
-
);
|
177 |
-
}}
|
178 |
-
</Form.Item>
|
179 |
-
</Flex>
|
180 |
-
</Form.Item>
|
181 |
-
<Form.Item
|
182 |
-
label={t('frequencyPenalty')}
|
183 |
-
tooltip={t('frequencyPenaltyTip')}
|
184 |
-
>
|
185 |
-
<Flex gap={20} align="center">
|
186 |
-
<Form.Item
|
187 |
-
name={'frequencyPenaltyEnabled'}
|
188 |
-
valuePropName="checked"
|
189 |
-
noStyle
|
190 |
-
>
|
191 |
-
<Switch size="small" />
|
192 |
-
</Form.Item>
|
193 |
-
<Form.Item noStyle dependencies={['frequencyPenaltyEnabled']}>
|
194 |
-
{({ getFieldValue }) => {
|
195 |
-
const disabled = !getFieldValue('frequencyPenaltyEnabled');
|
196 |
-
return (
|
197 |
-
<>
|
198 |
-
<Flex flex={1}>
|
199 |
-
<Form.Item
|
200 |
-
name={['llm_setting', 'frequency_penalty']}
|
201 |
-
noStyle
|
202 |
-
>
|
203 |
-
<Slider
|
204 |
-
className={styles.variableSlider}
|
205 |
-
max={1}
|
206 |
-
step={0.01}
|
207 |
-
disabled={disabled}
|
208 |
-
/>
|
209 |
-
</Form.Item>
|
210 |
-
</Flex>
|
211 |
-
<Form.Item
|
212 |
-
name={['llm_setting', 'frequency_penalty']}
|
213 |
-
noStyle
|
214 |
-
>
|
215 |
-
<InputNumber
|
216 |
-
className={styles.sliderInputNumber}
|
217 |
-
max={1}
|
218 |
-
min={0}
|
219 |
-
step={0.01}
|
220 |
-
disabled={disabled}
|
221 |
-
/>
|
222 |
-
</Form.Item>
|
223 |
-
</>
|
224 |
-
);
|
225 |
-
}}
|
226 |
-
</Form.Item>
|
227 |
-
</Flex>
|
228 |
-
</Form.Item>
|
229 |
-
<Form.Item label={t('maxTokens')} tooltip={t('maxTokensTip')}>
|
230 |
-
<Flex gap={20} align="center">
|
231 |
-
<Form.Item name={'maxTokensEnabled'} valuePropName="checked" noStyle>
|
232 |
-
<Switch size="small" />
|
233 |
-
</Form.Item>
|
234 |
-
<Form.Item noStyle dependencies={['maxTokensEnabled']}>
|
235 |
-
{({ getFieldValue }) => {
|
236 |
-
const disabled = !getFieldValue('maxTokensEnabled');
|
237 |
-
|
238 |
-
return (
|
239 |
-
<>
|
240 |
-
<Flex flex={1}>
|
241 |
-
<Form.Item name={['llm_setting', 'max_tokens']} noStyle>
|
242 |
-
<Slider
|
243 |
-
className={styles.variableSlider}
|
244 |
-
max={2048}
|
245 |
-
disabled={disabled}
|
246 |
-
/>
|
247 |
-
</Form.Item>
|
248 |
-
</Flex>
|
249 |
-
<Form.Item name={['llm_setting', 'max_tokens']} noStyle>
|
250 |
-
<InputNumber
|
251 |
-
disabled={disabled}
|
252 |
-
className={styles.sliderInputNumber}
|
253 |
-
max={2048}
|
254 |
-
min={0}
|
255 |
-
/>
|
256 |
-
</Form.Item>
|
257 |
-
</>
|
258 |
-
);
|
259 |
-
}}
|
260 |
-
</Form.Item>
|
261 |
-
</Flex>
|
262 |
-
</Form.Item> */}
|
263 |
</section>
|
264 |
);
|
265 |
};
|
|
|
42 |
})}
|
43 |
>
|
44 |
{visible && <LlmSettingItems prefix="llm_setting"></LlmSettingItems>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</section>
|
46 |
);
|
47 |
};
|
web/src/pages/chat/index.less
CHANGED
@@ -27,6 +27,12 @@
|
|
27 |
border-radius: 8px;
|
28 |
}
|
29 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
.chatTitleWrapper {
|
32 |
width: 220px;
|
@@ -62,6 +68,12 @@
|
|
62 |
border-radius: 8px;
|
63 |
}
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
.divider {
|
67 |
margin: 0;
|
|
|
27 |
border-radius: 8px;
|
28 |
}
|
29 |
}
|
30 |
+
.chatAppCardSelectedDark {
|
31 |
+
:global(.ant-card-body) {
|
32 |
+
background-color: rgba(255, 255, 255, 0.1);
|
33 |
+
border-radius: 8px;
|
34 |
+
}
|
35 |
+
}
|
36 |
}
|
37 |
.chatTitleWrapper {
|
38 |
width: 220px;
|
|
|
68 |
border-radius: 8px;
|
69 |
}
|
70 |
}
|
71 |
+
.chatTitleCardSelectedDark {
|
72 |
+
:global(.ant-card-body) {
|
73 |
+
background-color: rgba(255, 255, 255, 0.1);
|
74 |
+
border-radius: 8px;
|
75 |
+
}
|
76 |
+
}
|
77 |
|
78 |
.divider {
|
79 |
margin: 0;
|
web/src/pages/chat/index.tsx
CHANGED
@@ -30,6 +30,7 @@ import {
|
|
30 |
} from './hooks';
|
31 |
|
32 |
import SvgIcon from '@/components/svg-icon';
|
|
|
33 |
import {
|
34 |
useClickConversationCard,
|
35 |
useClickDialogCard,
|
@@ -51,6 +52,7 @@ const Chat = () => {
|
|
51 |
const { handleClickDialog } = useClickDialogCard();
|
52 |
const { handleClickConversation } = useClickConversationCard();
|
53 |
const { dialogId, conversationId } = useGetChatSearchParams();
|
|
|
54 |
const {
|
55 |
list: conversationList,
|
56 |
addTemporaryConversation,
|
@@ -243,7 +245,9 @@ const Chat = () => {
|
|
243 |
key={x.id}
|
244 |
hoverable
|
245 |
className={classNames(styles.chatAppCard, {
|
246 |
-
[
|
|
|
|
|
247 |
})}
|
248 |
onMouseEnter={handleAppCardEnter(x.id)}
|
249 |
onMouseLeave={handleItemLeave}
|
@@ -316,7 +320,9 @@ const Chat = () => {
|
|
316 |
onMouseEnter={handleConversationCardEnter(x.id)}
|
317 |
onMouseLeave={handleConversationItemLeave}
|
318 |
className={classNames(styles.chatTitleCard, {
|
319 |
-
[
|
|
|
|
|
320 |
})}
|
321 |
>
|
322 |
<Flex justify="space-between" align="center">
|
|
|
30 |
} from './hooks';
|
31 |
|
32 |
import SvgIcon from '@/components/svg-icon';
|
33 |
+
import { useTheme } from '@/components/theme-provider';
|
34 |
import {
|
35 |
useClickConversationCard,
|
36 |
useClickDialogCard,
|
|
|
52 |
const { handleClickDialog } = useClickDialogCard();
|
53 |
const { handleClickConversation } = useClickConversationCard();
|
54 |
const { dialogId, conversationId } = useGetChatSearchParams();
|
55 |
+
const { theme } = useTheme();
|
56 |
const {
|
57 |
list: conversationList,
|
58 |
addTemporaryConversation,
|
|
|
245 |
key={x.id}
|
246 |
hoverable
|
247 |
className={classNames(styles.chatAppCard, {
|
248 |
+
[theme === 'dark'
|
249 |
+
? styles.chatAppCardSelectedDark
|
250 |
+
: styles.chatAppCardSelected]: dialogId === x.id,
|
251 |
})}
|
252 |
onMouseEnter={handleAppCardEnter(x.id)}
|
253 |
onMouseLeave={handleItemLeave}
|
|
|
320 |
onMouseEnter={handleConversationCardEnter(x.id)}
|
321 |
onMouseLeave={handleConversationItemLeave}
|
322 |
className={classNames(styles.chatTitleCard, {
|
323 |
+
[theme === 'dark'
|
324 |
+
? styles.chatTitleCardSelectedDark
|
325 |
+
: styles.chatTitleCardSelected]: x.id === conversationId,
|
326 |
})}
|
327 |
>
|
328 |
<Flex justify="space-between" align="center">
|
web/src/pages/document-viewer/docx/index.less
CHANGED
@@ -13,7 +13,8 @@
|
|
13 |
:global(.document-container) {
|
14 |
padding: 30px;
|
15 |
width: 700px;
|
16 |
-
background:
|
|
|
17 |
margin: auto;
|
18 |
}
|
19 |
|
|
|
13 |
:global(.document-container) {
|
14 |
padding: 30px;
|
15 |
width: 700px;
|
16 |
+
background: rgba(255, 255, 255, 0.1);
|
17 |
+
|
18 |
margin: auto;
|
19 |
}
|
20 |
|
web/src/pages/flow/canvas/context-menu/index.less
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
.contextMenu {
|
2 |
-
background:
|
3 |
border-style: solid;
|
4 |
box-shadow: 10px 19px 20px rgba(0, 0, 0, 10%);
|
5 |
position: absolute;
|
@@ -13,6 +13,6 @@
|
|
13 |
}
|
14 |
|
15 |
button:hover {
|
16 |
-
background:
|
17 |
}
|
18 |
}
|
|
|
1 |
.contextMenu {
|
2 |
+
background: rgba(255, 255, 255, 0.1);
|
3 |
border-style: solid;
|
4 |
box-shadow: 10px 19px 20px rgba(0, 0, 0, 10%);
|
5 |
position: absolute;
|
|
|
13 |
}
|
14 |
|
15 |
button:hover {
|
16 |
+
background: rgba(255, 255, 255, 0.1);
|
17 |
}
|
18 |
}
|