Skip to content

Commit

Permalink
feat: add loading to ChatContainer and set font family to inter and a…
Browse files Browse the repository at this point in the history
…dd 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
  • Loading branch information
cike8899 authored Mar 20, 2024
1 parent 6999598 commit fce14ee
Show file tree
Hide file tree
Showing 65 changed files with 434 additions and 59 deletions.
2 changes: 2 additions & 0 deletions web/.umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export default defineConfig({
icons: {},
hash: true,
favicons: ['/logo.svg'],
clickToComponent: {},
history: {
type: 'browser',
},
plugins: ['@react-dev-inspector/umi4-plugin', '@umijs/plugins/dist/dva'],
dva: {},

lessLoader: {
modifyVars: {
hack: `true; @import "~@/less/index.less";`,
Expand Down
14 changes: 12 additions & 2 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { ConfigProvider } from 'antd';
import React, { ReactNode } from 'react';
import { Inspector } from 'react-dev-inspector';

export function rootContainer(container: ReactNode) {
return React.createElement(Inspector, null, container);
return React.createElement(
ConfigProvider,
{
theme: {
token: {
fontFamily: 'Inter',
},
},
},
container,
);
}
Binary file added web/src/assets/inter/Inter-Black.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-BlackItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-Bold.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-BoldItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-ExtraBold.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-ExtraBoldItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-ExtraLight.woff2
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/Inter-Italic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-Light.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-LightItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-Medium.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-MediumItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-Regular.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-SemiBold.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-SemiBoldItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-Thin.woff2
Binary file not shown.
Binary file added web/src/assets/inter/Inter-ThinItalic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Black.woff2
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Italic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Light.woff2
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Medium.woff2
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Regular.woff2
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-SemiBold.woff2
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/InterDisplay-Thin.woff2
Binary file not shown.
Binary file not shown.
Binary file added web/src/assets/inter/InterVariable-Italic.woff2
Binary file not shown.
Binary file added web/src/assets/inter/InterVariable.woff2
Binary file not shown.
4 changes: 2 additions & 2 deletions web/src/components/similarity-slider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const SimilaritySlider = ({ isTooltipShown = false }: IProps) => {
<Form.Item<FieldType>
label="Similarity threshold"
name={'similarity_threshold'}
tooltip={isTooltipShown && 'xxx'}
tooltip={isTooltipShown && 'coming soon'}
initialValue={0.2}
>
<Slider max={1} step={0.01} />
Expand All @@ -24,7 +24,7 @@ const SimilaritySlider = ({ isTooltipShown = false }: IProps) => {
label="Vector similarity weight"
name={'vector_similarity_weight'}
initialValue={0.3}
tooltip={isTooltipShown && 'xxx'}
tooltip={isTooltipShown && 'coming soon'}
>
<Slider max={1} step={0.01} />
</Form.Item>
Expand Down
5 changes: 5 additions & 0 deletions web/src/global.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import url(./inter.less);

body {
font-family: Inter;
}
1 change: 0 additions & 1 deletion web/src/hooks/authHook.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import authorizationUtil from '@/utils/authorizationUtil';
import { message } from 'antd';
import { useEffect, useMemo, useState } from 'react';
import { Nullable } from 'typings';
import { useNavigate, useSearchParams } from 'umi';

export const useLoginWithGithub = () => {
Expand Down
273 changes: 273 additions & 0 deletions web/src/inter.less
Original file line number Diff line number Diff line change
@@ -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');
}
1 change: 0 additions & 1 deletion web/src/layouts/components/header/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
border: 0 !important;
background-color: rgba(249, 249, 249, 1);
font-weight: @fontWeight700;
font-family: 'Nunito Sans';
color: rgba(29, 25, 41, 1);
&::before {
display: none !important;
Expand Down
2 changes: 0 additions & 2 deletions web/src/less/variable.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@
@fontSize14: 14px;
@fontSize16: 16px;
@fontSize18: 18px;

@fontFamilyNunitoSans: 'Nunito Sans';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import kbService, { getDocumentFile } from '@/services/kbService';
import { message } from 'antd';
import omit from 'lodash/omit';
import pick from 'lodash/pick';
import { Nullable } from 'typings';
import { DvaModel } from 'umi';

export interface KFModelState extends BaseState {
Expand Down
Loading

0 comments on commit fce14ee

Please sign in to comment.