mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-11-11 23:54:46 +00:00
feat: add loading to ChatContainer and set font family to inter and add tooltip to Form.Item and download documents on the document list page (#136)
* feat: download documents on the document list page * feat: add tooltip to Form.Item * feat: set font family to inter * feat: add loading to ChatContainer
This commit is contained in:
parent
6999598101
commit
fce14ee187
@ -12,11 +12,13 @@ export default defineConfig({
|
|||||||
icons: {},
|
icons: {},
|
||||||
hash: true,
|
hash: true,
|
||||||
favicons: ['/logo.svg'],
|
favicons: ['/logo.svg'],
|
||||||
|
clickToComponent: {},
|
||||||
history: {
|
history: {
|
||||||
type: 'browser',
|
type: 'browser',
|
||||||
},
|
},
|
||||||
plugins: ['@react-dev-inspector/umi4-plugin', '@umijs/plugins/dist/dva'],
|
plugins: ['@react-dev-inspector/umi4-plugin', '@umijs/plugins/dist/dva'],
|
||||||
dva: {},
|
dva: {},
|
||||||
|
|
||||||
lessLoader: {
|
lessLoader: {
|
||||||
modifyVars: {
|
modifyVars: {
|
||||||
hack: `true; @import "~@/less/index.less";`,
|
hack: `true; @import "~@/less/index.less";`,
|
||||||
|
|||||||
@ -1,6 +1,16 @@
|
|||||||
|
import { ConfigProvider } from 'antd';
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { Inspector } from 'react-dev-inspector';
|
|
||||||
|
|
||||||
export function rootContainer(container: ReactNode) {
|
export function rootContainer(container: ReactNode) {
|
||||||
return React.createElement(Inspector, null, container);
|
return React.createElement(
|
||||||
|
ConfigProvider,
|
||||||
|
{
|
||||||
|
theme: {
|
||||||
|
token: {
|
||||||
|
fontFamily: 'Inter',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
container,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
web/src/assets/inter/Inter-Black.woff2
Normal file
BIN
web/src/assets/inter/Inter-Black.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-BlackItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-BlackItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-Bold.woff2
Normal file
BIN
web/src/assets/inter/Inter-Bold.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-BoldItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-ExtraBold.woff2
Normal file
BIN
web/src/assets/inter/Inter-ExtraBold.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-ExtraBoldItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-ExtraBoldItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-ExtraLight.woff2
Normal file
BIN
web/src/assets/inter/Inter-ExtraLight.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-ExtraLightItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-ExtraLightItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-Italic.woff2
Normal file
BIN
web/src/assets/inter/Inter-Italic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-Light.woff2
Normal file
BIN
web/src/assets/inter/Inter-Light.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-LightItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-LightItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-Medium.woff2
Normal file
BIN
web/src/assets/inter/Inter-Medium.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-MediumItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-MediumItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-Regular.woff2
Normal file
BIN
web/src/assets/inter/Inter-Regular.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-SemiBold.woff2
Normal file
BIN
web/src/assets/inter/Inter-SemiBold.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-SemiBoldItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-SemiBoldItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-Thin.woff2
Normal file
BIN
web/src/assets/inter/Inter-Thin.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/Inter-ThinItalic.woff2
Normal file
BIN
web/src/assets/inter/Inter-ThinItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Black.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Black.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-BlackItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-BlackItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Bold.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Bold.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-BoldItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-ExtraBold.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-ExtraBold.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-ExtraBoldItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-ExtraBoldItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-ExtraLight.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-ExtraLight.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-ExtraLightItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-ExtraLightItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Italic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Italic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Light.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Light.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-LightItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-LightItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Medium.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Medium.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-MediumItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-MediumItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Regular.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Regular.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-SemiBold.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-SemiBold.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-SemiBoldItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-SemiBoldItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-Thin.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-Thin.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterDisplay-ThinItalic.woff2
Normal file
BIN
web/src/assets/inter/InterDisplay-ThinItalic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterVariable-Italic.woff2
Normal file
BIN
web/src/assets/inter/InterVariable-Italic.woff2
Normal file
Binary file not shown.
BIN
web/src/assets/inter/InterVariable.woff2
Normal file
BIN
web/src/assets/inter/InterVariable.woff2
Normal file
Binary file not shown.
@ -15,7 +15,7 @@ const SimilaritySlider = ({ isTooltipShown = false }: IProps) => {
|
|||||||
<Form.Item<FieldType>
|
<Form.Item<FieldType>
|
||||||
label="Similarity threshold"
|
label="Similarity threshold"
|
||||||
name={'similarity_threshold'}
|
name={'similarity_threshold'}
|
||||||
tooltip={isTooltipShown && 'xxx'}
|
tooltip={isTooltipShown && 'coming soon'}
|
||||||
initialValue={0.2}
|
initialValue={0.2}
|
||||||
>
|
>
|
||||||
<Slider max={1} step={0.01} />
|
<Slider max={1} step={0.01} />
|
||||||
@ -24,7 +24,7 @@ const SimilaritySlider = ({ isTooltipShown = false }: IProps) => {
|
|||||||
label="Vector similarity weight"
|
label="Vector similarity weight"
|
||||||
name={'vector_similarity_weight'}
|
name={'vector_similarity_weight'}
|
||||||
initialValue={0.3}
|
initialValue={0.3}
|
||||||
tooltip={isTooltipShown && 'xxx'}
|
tooltip={isTooltipShown && 'coming soon'}
|
||||||
>
|
>
|
||||||
<Slider max={1} step={0.01} />
|
<Slider max={1} step={0.01} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
5
web/src/global.less
Normal file
5
web/src/global.less
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@import url(./inter.less);
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Inter;
|
||||||
|
}
|
||||||
@ -1,7 +1,6 @@
|
|||||||
import authorizationUtil from '@/utils/authorizationUtil';
|
import authorizationUtil from '@/utils/authorizationUtil';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import { Nullable } from 'typings';
|
|
||||||
import { useNavigate, useSearchParams } from 'umi';
|
import { useNavigate, useSearchParams } from 'umi';
|
||||||
|
|
||||||
export const useLoginWithGithub = () => {
|
export const useLoginWithGithub = () => {
|
||||||
|
|||||||
273
web/src/inter.less
Normal file
273
web/src/inter.less
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
/* Variable fonts usage:
|
||||||
|
:root { font-family: "Inter", sans-serif; }
|
||||||
|
@supports (font-variation-settings: normal) {
|
||||||
|
:root { font-family: "InterVariable", sans-serif; font-optical-sizing: auto; }
|
||||||
|
} */
|
||||||
|
@font-face {
|
||||||
|
font-family: InterVariable;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterVariable.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: InterVariable;
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 100 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterVariable-Italic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* static fonts */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Thin.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 100;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-ThinItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 200;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-ExtraLight.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 200;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-ExtraLightItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Light.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 300;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-LightItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Regular.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Italic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Medium.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-MediumItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-SemiBold.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-SemiBoldItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Bold.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-BoldItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-ExtraBold.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-ExtraBoldItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-Black.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/Inter-BlackItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Thin.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 100;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-ThinItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 200;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-ExtraLight.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 200;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-ExtraLightItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Light.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 300;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-LightItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Regular.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Italic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Medium.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-MediumItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-SemiBold.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-SemiBoldItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Bold.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-BoldItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-ExtraBold.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-ExtraBoldItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-Black.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'InterDisplay';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('@/assets/inter/InterDisplay-BlackItalic.woff2') format('woff2');
|
||||||
|
}
|
||||||
@ -36,7 +36,6 @@
|
|||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
background-color: rgba(249, 249, 249, 1);
|
background-color: rgba(249, 249, 249, 1);
|
||||||
font-weight: @fontWeight700;
|
font-weight: @fontWeight700;
|
||||||
font-family: 'Nunito Sans';
|
|
||||||
color: rgba(29, 25, 41, 1);
|
color: rgba(29, 25, 41, 1);
|
||||||
&::before {
|
&::before {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|||||||
@ -15,5 +15,3 @@
|
|||||||
@fontSize14: 14px;
|
@fontSize14: 14px;
|
||||||
@fontSize16: 16px;
|
@fontSize16: 16px;
|
||||||
@fontSize18: 18px;
|
@fontSize18: 18px;
|
||||||
|
|
||||||
@fontFamilyNunitoSans: 'Nunito Sans';
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import kbService, { getDocumentFile } from '@/services/kbService';
|
|||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import omit from 'lodash/omit';
|
import omit from 'lodash/omit';
|
||||||
import pick from 'lodash/pick';
|
import pick from 'lodash/pick';
|
||||||
import { Nullable } from 'typings';
|
|
||||||
import { DvaModel } from 'umi';
|
import { DvaModel } from 'umi';
|
||||||
|
|
||||||
export interface KFModelState extends BaseState {
|
export interface KFModelState extends BaseState {
|
||||||
|
|||||||
@ -1,10 +1,17 @@
|
|||||||
import showDeleteConfirm from '@/components/deleting-confirm';
|
import showDeleteConfirm from '@/components/deleting-confirm';
|
||||||
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
||||||
import { DeleteOutlined, EditOutlined, ToolOutlined } from '@ant-design/icons';
|
import {
|
||||||
|
DeleteOutlined,
|
||||||
|
DownloadOutlined,
|
||||||
|
EditOutlined,
|
||||||
|
ToolOutlined,
|
||||||
|
} from '@ant-design/icons';
|
||||||
import { Button, Dropdown, MenuProps, Space, Tooltip } from 'antd';
|
import { Button, Dropdown, MenuProps, Space, Tooltip } from 'antd';
|
||||||
import { useDispatch } from 'umi';
|
import { useDispatch } from 'umi';
|
||||||
import { isParserRunning } from '../utils';
|
import { isParserRunning } from '../utils';
|
||||||
|
|
||||||
|
import { api_host } from '@/utils/api';
|
||||||
|
import { downloadFile } from '@/utils/fileUtil';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
@ -38,6 +45,13 @@ const ParsingActionCell = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onDownloadDocument = () => {
|
||||||
|
downloadFile({
|
||||||
|
url: `${api_host}/document/get/${documentId}`,
|
||||||
|
filename: record.name,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const setCurrentRecord = () => {
|
const setCurrentRecord = () => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'kFModel/setCurrentRecord',
|
type: 'kFModel/setCurrentRecord',
|
||||||
@ -110,6 +124,14 @@ const ParsingActionCell = ({
|
|||||||
>
|
>
|
||||||
<DeleteOutlined size={20} />
|
<DeleteOutlined size={20} />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="text"
|
||||||
|
disabled={isRunning}
|
||||||
|
onClick={onDownloadDocument}
|
||||||
|
className={styles.iconButton}
|
||||||
|
>
|
||||||
|
<DownloadOutlined size={20} />
|
||||||
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -91,6 +91,7 @@ const Configuration = () => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
name="permission"
|
name="permission"
|
||||||
label="Permissions"
|
label="Permissions"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Radio.Group>
|
<Radio.Group>
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
.knowledgeLogo {
|
.knowledgeLogo {
|
||||||
}
|
}
|
||||||
.knowledgeTitle {
|
.knowledgeTitle {
|
||||||
font-family: 'Nunito Sans';
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
font-weight: @fontWeight700;
|
font-weight: @fontWeight700;
|
||||||
@ -16,7 +15,6 @@
|
|||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
}
|
}
|
||||||
.knowledgeDescription {
|
.knowledgeDescription {
|
||||||
font-family: 'Nunito Sans';
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: @fontWeight600;
|
font-weight: @fontWeight600;
|
||||||
color: @gray8;
|
color: @gray8;
|
||||||
@ -55,7 +53,6 @@
|
|||||||
|
|
||||||
.menuText {
|
.menuText {
|
||||||
color: @gray3;
|
color: @gray3;
|
||||||
font-family: @fontFamilyNunitoSans;
|
|
||||||
font-size: @fontSize14;
|
font-size: @fontSize14;
|
||||||
font-weight: @fontWeight700;
|
font-weight: @fontWeight700;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,8 +51,12 @@ const TestingControl = ({ form, handleTesting }: IProps) => {
|
|||||||
top_k: 1024,
|
top_k: 1024,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SimilaritySlider></SimilaritySlider>
|
<SimilaritySlider isTooltipShown></SimilaritySlider>
|
||||||
<Form.Item<FieldType> label="Top k" name={'top_k'}>
|
<Form.Item<FieldType>
|
||||||
|
label="Top k"
|
||||||
|
name={'top_k'}
|
||||||
|
tooltip="coming soon"
|
||||||
|
>
|
||||||
<Slider marks={{ 0: 0, 2048: 2048 }} max={2048} />
|
<Slider marks={{ 0: 0, 2048: 2048 }} max={2048} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Card size="small" title="Test text">
|
<Card size="small" title="Test text">
|
||||||
|
|||||||
@ -50,7 +50,12 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
|
|||||||
</button>
|
</button>
|
||||||
</Upload>
|
</Upload>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name={'language'} label="Language" initialValue={'Chinese'}>
|
<Form.Item
|
||||||
|
name={'language'}
|
||||||
|
label="Language"
|
||||||
|
initialValue={'Chinese'}
|
||||||
|
tooltip="coming soon"
|
||||||
|
>
|
||||||
<Select
|
<Select
|
||||||
options={[
|
options={[
|
||||||
{ value: 'Chinese', label: 'Chinese' },
|
{ value: 'Chinese', label: 'Chinese' },
|
||||||
@ -61,12 +66,14 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
name={['prompt_config', 'empty_response']}
|
name={['prompt_config', 'empty_response']}
|
||||||
label="Empty response"
|
label="Empty response"
|
||||||
|
tooltip="coming soon"
|
||||||
>
|
>
|
||||||
<Input placeholder="" />
|
<Input placeholder="" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={['prompt_config', 'prologue']}
|
name={['prompt_config', 'prologue']}
|
||||||
label="Set an opener"
|
label="Set an opener"
|
||||||
|
tooltip="coming soon"
|
||||||
initialValue={"Hi! I'm your assistant, what can I do for you?"}
|
initialValue={"Hi! I'm your assistant, what can I do for you?"}
|
||||||
>
|
>
|
||||||
<Input.TextArea autoSize={{ minRows: 5 }} />
|
<Input.TextArea autoSize={{ minRows: 5 }} />
|
||||||
@ -74,6 +81,7 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label="Select one context"
|
label="Select one context"
|
||||||
name="kb_ids"
|
name="kb_ids"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||
@ -5,11 +5,18 @@
|
|||||||
.variableContainer {
|
.variableContainer {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
.variableAlign {
|
.variableAlign {
|
||||||
text-align: right;
|
text-align: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.variableLabel {
|
.variableLabel {
|
||||||
margin-right: 16px;
|
margin-right: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.variableIcon {
|
||||||
|
margin-inline-start: 4px;
|
||||||
|
color: rgba(0, 0, 0, 0.45);
|
||||||
|
cursor: help;
|
||||||
|
writing-mode: horizontal-tb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.variableTable {
|
.variableTable {
|
||||||
|
|||||||
@ -46,6 +46,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label="Model"
|
label="Model"
|
||||||
name="llm_id"
|
name="llm_id"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[{ required: true, message: 'Please select!' }]}
|
rules={[{ required: true, message: 'Please select!' }]}
|
||||||
>
|
>
|
||||||
<Select options={modelOptions} showSearch />
|
<Select options={modelOptions} showSearch />
|
||||||
@ -54,6 +55,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label="Parameters"
|
label="Parameters"
|
||||||
name="parameters"
|
name="parameters"
|
||||||
|
tooltip="coming soon"
|
||||||
initialValue={ModelVariableType.Precise}
|
initialValue={ModelVariableType.Precise}
|
||||||
// rules={[{ required: true, message: 'Please input!' }]}
|
// rules={[{ required: true, message: 'Please input!' }]}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import SimilaritySlider from '@/components/similarity-slider';
|
import SimilaritySlider from '@/components/similarity-slider';
|
||||||
import { DeleteOutlined } from '@ant-design/icons';
|
import { DeleteOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Col,
|
Col,
|
||||||
@ -11,6 +11,7 @@ import {
|
|||||||
Switch,
|
Switch,
|
||||||
Table,
|
Table,
|
||||||
TableProps,
|
TableProps,
|
||||||
|
Tooltip,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {
|
import {
|
||||||
@ -153,6 +154,7 @@ const PromptEngine = (
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label="System"
|
label="System"
|
||||||
rules={[{ required: true, message: 'Please input!' }]}
|
rules={[{ required: true, message: 'Please input!' }]}
|
||||||
|
tooltip="coming soon"
|
||||||
name={['prompt_config', 'system']}
|
name={['prompt_config', 'system']}
|
||||||
initialValue={`你是一个智能助手,请总结知识库的内容来回答问题,请列举知识库中的数据详细回答。当所有知识库内容都与问题无关时,你的回答必须包括“知识库中未找到您要的答案!”这句话。回答需要考虑聊天历史。
|
initialValue={`你是一个智能助手,请总结知识库的内容来回答问题,请列举知识库中的数据详细回答。当所有知识库内容都与问题无关时,你的回答必须包括“知识库中未找到您要的答案!”这句话。回答需要考虑聊天历史。
|
||||||
以下是知识库:
|
以下是知识库:
|
||||||
@ -173,10 +175,15 @@ const PromptEngine = (
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<section className={classNames(styles.variableContainer)}>
|
<section className={classNames(styles.variableContainer)}>
|
||||||
<Row align={'middle'} justify="end">
|
<Row align={'middle'} justify="end">
|
||||||
<Col span={6} className={styles.variableAlign}>
|
<Col span={7} className={styles.variableAlign}>
|
||||||
<label className={styles.variableLabel}>Variables</label>
|
<label className={styles.variableLabel}>
|
||||||
|
Variables
|
||||||
|
<Tooltip title="coming soon">
|
||||||
|
<QuestionCircleOutlined className={styles.variableIcon} />
|
||||||
|
</Tooltip>
|
||||||
|
</label>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={18} className={styles.variableAlign}>
|
<Col span={17} className={styles.variableAlign}>
|
||||||
<Button size="small" onClick={handleAdd}>
|
<Button size="small" onClick={handleAdd}>
|
||||||
Add
|
Add
|
||||||
</Button>
|
</Button>
|
||||||
@ -184,8 +191,8 @@ const PromptEngine = (
|
|||||||
</Row>
|
</Row>
|
||||||
{dataSource.length > 0 && (
|
{dataSource.length > 0 && (
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={6}></Col>
|
<Col span={7}> </Col>
|
||||||
<Col span={18}>
|
<Col span={17}>
|
||||||
<Table
|
<Table
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import {
|
|||||||
Popover,
|
Popover,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Space,
|
Space,
|
||||||
|
Spin,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
@ -31,6 +32,7 @@ import {
|
|||||||
useFetchConversationOnMount,
|
useFetchConversationOnMount,
|
||||||
useGetFileIcon,
|
useGetFileIcon,
|
||||||
useGetSendButtonDisabled,
|
useGetSendButtonDisabled,
|
||||||
|
useSelectConversationLoading,
|
||||||
useSendMessage,
|
useSendMessage,
|
||||||
} from '../hooks';
|
} from '../hooks';
|
||||||
|
|
||||||
@ -259,12 +261,14 @@ const ChatContainer = () => {
|
|||||||
useClickDrawer();
|
useClickDrawer();
|
||||||
const disabled = useGetSendButtonDisabled();
|
const disabled = useGetSendButtonDisabled();
|
||||||
useGetFileIcon();
|
useGetFileIcon();
|
||||||
|
const loading = useSelectConversationLoading();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Flex flex={1} className={styles.chatContainer} vertical>
|
<Flex flex={1} className={styles.chatContainer} vertical>
|
||||||
<Flex flex={1} vertical className={styles.messageContainer}>
|
<Flex flex={1} vertical className={styles.messageContainer}>
|
||||||
<div>
|
<div>
|
||||||
|
<Spin spinning={loading}>
|
||||||
{conversation?.message?.map((message) => {
|
{conversation?.message?.map((message) => {
|
||||||
const assistantMessages = conversation?.message
|
const assistantMessages = conversation?.message
|
||||||
?.filter((x) => x.role === MessageType.Assistant)
|
?.filter((x) => x.role === MessageType.Assistant)
|
||||||
@ -282,6 +286,7 @@ const ChatContainer = () => {
|
|||||||
></MessageItem>
|
></MessageItem>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
<div ref={ref} />
|
<div ref={ref} />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@ -773,6 +773,9 @@ export const useSelectDialogListLoading = () => {
|
|||||||
export const useSelectConversationListLoading = () => {
|
export const useSelectConversationListLoading = () => {
|
||||||
return useOneNamespaceEffectsLoading('chatModel', ['listConversation']);
|
return useOneNamespaceEffectsLoading('chatModel', ['listConversation']);
|
||||||
};
|
};
|
||||||
|
export const useSelectConversationLoading = () => {
|
||||||
|
return useOneNamespaceEffectsLoading('chatModel', ['getConversation']);
|
||||||
|
};
|
||||||
|
|
||||||
export const useGetSendButtonDisabled = () => {
|
export const useGetSendButtonDisabled = () => {
|
||||||
const { dialogId, conversationId } = useGetChatSearchParams();
|
const { dialogId, conversationId } = useGetChatSearchParams();
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: rgba(0, 0, 0, 0.88);
|
color: rgba(0, 0, 0, 0.88);
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.description {
|
.description {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
// width: 100%;
|
// width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
|
||||||
.loginLeft {
|
.loginLeft {
|
||||||
// width: 610px;
|
// width: 610px;
|
||||||
width: 40%;
|
width: 40%;
|
||||||
@ -12,9 +11,7 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 957px) {
|
||||||
|
|
||||||
@media screen and (max-width:957px) {
|
|
||||||
.loginLeft {
|
.loginLeft {
|
||||||
// width: 610px;
|
// width: 610px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -29,13 +26,11 @@
|
|||||||
|
|
||||||
.loginRight {
|
.loginRight {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background-color: #F2F4F7;
|
background-color: #f2f4f7;
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginTitle {
|
.loginTitle {
|
||||||
//styleName: Heading/1;
|
//styleName: Heading/1;
|
||||||
font-family: SF Pro Text;
|
|
||||||
font-size: 38px;
|
font-size: 38px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 46px;
|
line-height: 46px;
|
||||||
@ -48,9 +43,8 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
|
||||||
color: #000000A6;
|
color: #000000a6;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,5 +53,5 @@
|
|||||||
width: 60%;
|
width: 60%;
|
||||||
height: 724px;
|
height: 724px;
|
||||||
padding: 5px, 0px, 5px, 0px;
|
padding: 5px, 0px, 5px, 0px;
|
||||||
margin: 80px auto
|
margin: 80px auto;
|
||||||
}
|
}
|
||||||
@ -7,7 +7,6 @@ import {
|
|||||||
import { IUserInfo } from '@/interfaces/database/userSetting';
|
import { IUserInfo } from '@/interfaces/database/userSetting';
|
||||||
import userService from '@/services/userService';
|
import userService from '@/services/userService';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { Nullable } from 'typings';
|
|
||||||
import { DvaModel } from 'umi';
|
import { DvaModel } from 'umi';
|
||||||
|
|
||||||
export interface SettingModelState {
|
export interface SettingModelState {
|
||||||
|
|||||||
@ -66,6 +66,7 @@ const ApiKeyModal = ({
|
|||||||
<Form.Item<FieldType>
|
<Form.Item<FieldType>
|
||||||
label="Api-Key"
|
label="Api-Key"
|
||||||
name="api_key"
|
name="api_key"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[{ required: true, message: 'Please input api key!' }]}
|
rules={[{ required: true, message: 'Please input api key!' }]}
|
||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
|
|||||||
@ -43,16 +43,24 @@ const SystemModelSettingModal = ({
|
|||||||
confirmLoading={loading}
|
confirmLoading={loading}
|
||||||
>
|
>
|
||||||
<Form form={form} onValuesChange={onFormLayoutChange} layout={'vertical'}>
|
<Form form={form} onValuesChange={onFormLayoutChange} layout={'vertical'}>
|
||||||
<Form.Item label="Sequence2txt model" name="asr_id">
|
<Form.Item
|
||||||
|
label="Sequence2txt model"
|
||||||
|
name="asr_id"
|
||||||
|
tooltip="coming soon"
|
||||||
|
>
|
||||||
<Select options={allOptions[LlmModelType.Speech2text]} />
|
<Select options={allOptions[LlmModelType.Speech2text]} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="Embedding model" name="embd_id">
|
<Form.Item label="Embedding model" name="embd_id" tooltip="coming soon">
|
||||||
<Select options={allOptions[LlmModelType.Embedding]} />
|
<Select options={allOptions[LlmModelType.Embedding]} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="Img2txt model" name="img2txt_id">
|
<Form.Item
|
||||||
|
label="Img2txt model"
|
||||||
|
name="img2txt_id"
|
||||||
|
tooltip="coming soon"
|
||||||
|
>
|
||||||
<Select options={allOptions[LlmModelType.Image2text]} />
|
<Select options={allOptions[LlmModelType.Image2text]} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="Chat model" name="llm_id">
|
<Form.Item label="Chat model" name="llm_id" tooltip="coming soon">
|
||||||
<Select options={allOptions[LlmModelType.Chat]} />
|
<Select options={allOptions[LlmModelType.Chat]} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@ -110,7 +110,7 @@ const UserSettingProfile = () => {
|
|||||||
<div>
|
<div>
|
||||||
<Space>
|
<Space>
|
||||||
Your photo
|
Your photo
|
||||||
<Tooltip title="prompt text">
|
<Tooltip title="coming soon">
|
||||||
<QuestionCircleOutlined />
|
<QuestionCircleOutlined />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
@ -140,6 +140,7 @@ const UserSettingProfile = () => {
|
|||||||
<Form.Item<FieldType>
|
<Form.Item<FieldType>
|
||||||
label="Color schema"
|
label="Color schema"
|
||||||
name="color_schema"
|
name="color_schema"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[
|
rules={[
|
||||||
{ required: true, message: 'Please select your color schema!' },
|
{ required: true, message: 'Please select your color schema!' },
|
||||||
]}
|
]}
|
||||||
@ -153,6 +154,7 @@ const UserSettingProfile = () => {
|
|||||||
<Form.Item<FieldType>
|
<Form.Item<FieldType>
|
||||||
label="Language"
|
label="Language"
|
||||||
name="language"
|
name="language"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[{ required: true, message: 'Please input your language!' }]}
|
rules={[{ required: true, message: 'Please input your language!' }]}
|
||||||
>
|
>
|
||||||
<Select placeholder="select your language">
|
<Select placeholder="select your language">
|
||||||
@ -164,6 +166,7 @@ const UserSettingProfile = () => {
|
|||||||
<Form.Item<FieldType>
|
<Form.Item<FieldType>
|
||||||
label="Timezone"
|
label="Timezone"
|
||||||
name="timezone"
|
name="timezone"
|
||||||
|
tooltip="coming soon"
|
||||||
rules={[{ required: true, message: 'Please input your timezone!' }]}
|
rules={[{ required: true, message: 'Please input your timezone!' }]}
|
||||||
>
|
>
|
||||||
<Select placeholder="select your timezone" showSearch>
|
<Select placeholder="select your timezone" showSearch>
|
||||||
|
|||||||
@ -61,3 +61,27 @@ export const getBase64FromUploadFileList = async (fileList?: UploadFile[]) => {
|
|||||||
|
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const downloadFile = ({
|
||||||
|
url,
|
||||||
|
filename,
|
||||||
|
target,
|
||||||
|
}: {
|
||||||
|
url: string;
|
||||||
|
filename?: string;
|
||||||
|
target?: string;
|
||||||
|
}) => {
|
||||||
|
const downloadElement = document.createElement('a');
|
||||||
|
downloadElement.style.display = 'none';
|
||||||
|
downloadElement.href = url;
|
||||||
|
if (target) {
|
||||||
|
downloadElement.target = '_blank';
|
||||||
|
}
|
||||||
|
downloadElement.rel = 'noopener noreferrer';
|
||||||
|
if (filename) {
|
||||||
|
downloadElement.download = filename;
|
||||||
|
}
|
||||||
|
document.body.appendChild(downloadElement);
|
||||||
|
downloadElement.click();
|
||||||
|
document.body.removeChild(downloadElement);
|
||||||
|
};
|
||||||
|
|||||||
6
web/typings.d.ts
vendored
6
web/typings.d.ts
vendored
@ -1,4 +1,8 @@
|
|||||||
import 'umi/typings';
|
import 'umi/typings';
|
||||||
declare module 'lodash';
|
declare module 'lodash';
|
||||||
|
|
||||||
export type Nullable<T> = T | null;
|
// declare type Nullable<T> = T | null; invalid
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
type Nullable<T> = T | null;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user