balibabu commited on
Commit
3313a7c
·
1 Parent(s): e4c78c3

feat: add background image to login page and alter tooltip of base_url and add llm type to Added models List (#173)

Browse files

* feat: add llm type to Added models List

* feat: alter tooltip of base_url

* feat: add background image to login page

web/src/assets/svg/login-avatars.svg ADDED
web/src/assets/svg/login-background.svg ADDED
web/src/assets/svg/login-star.svg ADDED
web/src/global.less CHANGED
@@ -2,4 +2,5 @@
2
 
3
  body {
4
  font-family: Inter;
 
5
  }
 
2
 
3
  body {
4
  font-family: Inter;
5
+ margin: 0;
6
  }
web/src/pages/login/index.less CHANGED
@@ -1,32 +1,77 @@
1
  @import '../../theme/vars';
2
 
3
  .loginPage {
4
- // width: 100%;
5
  display: flex;
6
-
7
  .loginLeft {
8
  // width: 610px;
9
  width: 40%;
10
  background-color: #fff;
11
  height: 100vh;
 
 
12
  }
13
 
14
- @media screen and (max-width: 957px) {
15
- .loginLeft {
16
- // width: 610px;
17
- width: 100%;
18
- background-color: #fff;
19
- height: 100vh;
20
- }
21
-
22
- .modal {
23
- width: 80%;
24
- }
25
  }
26
 
27
  .loginRight {
 
 
 
28
  flex: 1;
29
- background-color: #f2f4f7;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
 
32
  .loginTitle {
@@ -46,12 +91,16 @@
46
  color: #000000a6;
47
  }
48
  }
49
- }
50
 
51
- .modal {
52
- // width: 360px;
53
- width: 60%;
54
- height: 724px;
55
- padding: 5px, 0px, 5px, 0px;
56
- margin: 80px auto;
 
 
 
 
 
57
  }
 
1
  @import '../../theme/vars';
2
 
3
  .loginPage {
 
4
  display: flex;
 
5
  .loginLeft {
6
  // width: 610px;
7
  width: 40%;
8
  background-color: #fff;
9
  height: 100vh;
10
+ display: flex;
11
+ align-items: center;
12
  }
13
 
14
+ .leftContainer {
15
+ width: 60%;
16
+ padding: 5px, 0px, 5px, 0px;
17
+ margin: 0 auto;
 
 
 
 
 
 
 
18
  }
19
 
20
  .loginRight {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: center;
24
  flex: 1;
25
+ position: relative;
26
+ &::before {
27
+ content: ' ';
28
+ position: absolute;
29
+ top: 0;
30
+ bottom: 0;
31
+ left: 0;
32
+ right: 0;
33
+ background-color: rgba(24, 73, 169, 0.6);
34
+ background-image: url('@/assets/svg/login-background.svg');
35
+ background-size: cover;
36
+ background-blend-mode: multiply;
37
+ filter: blur(3px);
38
+ background-position: center;
39
+ z-index: -1;
40
+ }
41
+ .white {
42
+ color: #fff;
43
+ }
44
+ .pink {
45
+ color: #e9d7fe;
46
+ }
47
+ .rightPanel {
48
+ max-width: 640px;
49
+ .loginTitle {
50
+ font-size: 72px;
51
+ font-style: normal;
52
+ font-weight: 600;
53
+ line-height: 90px;
54
+ letter-spacing: -1.44px;
55
+ }
56
+ .loginDescription {
57
+ font-size: 20px;
58
+ font-style: normal;
59
+ font-weight: 500;
60
+ line-height: 30px;
61
+ }
62
+ .loginRateNumber {
63
+ font-size: 16px;
64
+ font-style: normal;
65
+ font-weight: 600;
66
+ line-height: 24px;
67
+ }
68
+ .loginRateReviews {
69
+ font-size: 16px;
70
+ font-style: normal;
71
+ font-weight: 500;
72
+ line-height: 24px;
73
+ }
74
+ }
75
  }
76
 
77
  .loginTitle {
 
91
  color: #000000a6;
92
  }
93
  }
 
94
 
95
+ @media screen and (max-width: 957px) {
96
+ .loginLeft {
97
+ width: 100%;
98
+ background-color: #fff;
99
+ height: 100%;
100
+ }
101
+
102
+ .modal {
103
+ width: 80%;
104
+ }
105
+ }
106
  }
web/src/pages/login/index.tsx CHANGED
@@ -2,6 +2,8 @@ import { rsaPsw } from '@/utils';
2
  import { Button, Checkbox, Form, Input } from 'antd';
3
  import { useEffect, useState } from 'react';
4
  import { Icon, useDispatch, useNavigate, useSelector } from 'umi';
 
 
5
  import styles from './index.less';
6
 
7
  const Login = () => {
@@ -73,7 +75,7 @@ const Login = () => {
73
  return (
74
  <div className={styles.loginPage}>
75
  <div className={styles.loginLeft}>
76
- <div className={styles.modal}>
77
  <div className={styles.loginTitle}>
78
  <div>{title === 'login' ? 'Sign in' : 'Create an account'}</div>
79
  <span>
@@ -189,7 +191,9 @@ const Login = () => {
189
  </Form>
190
  </div>
191
  </div>
192
- <div className={styles.loginRight}></div>
 
 
193
  </div>
194
  );
195
  };
 
2
  import { Button, Checkbox, Form, Input } from 'antd';
3
  import { useEffect, useState } from 'react';
4
  import { Icon, useDispatch, useNavigate, useSelector } from 'umi';
5
+ import RightPanel from './right-panel';
6
+
7
  import styles from './index.less';
8
 
9
  const Login = () => {
 
75
  return (
76
  <div className={styles.loginPage}>
77
  <div className={styles.loginLeft}>
78
+ <div className={styles.leftContainer}>
79
  <div className={styles.loginTitle}>
80
  <div>{title === 'login' ? 'Sign in' : 'Create an account'}</div>
81
  <span>
 
191
  </Form>
192
  </div>
193
  </div>
194
+ <div className={styles.loginRight}>
195
+ <RightPanel></RightPanel>
196
+ </div>
197
  </div>
198
  );
199
  };
web/src/pages/login/right-panel.tsx ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ReactComponent as Avatars } from '@/assets/svg/login-avatars.svg';
2
+ import SvgIcon from '@/components/svg-icon';
3
+ import { Flex, Rate, Space, Typography } from 'antd';
4
+ import classNames from 'classnames';
5
+
6
+ import styles from './index.less';
7
+
8
+ const { Title, Text } = Typography;
9
+
10
+ const LoginRightPanel = () => {
11
+ return (
12
+ <section className={styles.rightPanel}>
13
+ <SvgIcon name="login-star" width={80}></SvgIcon>
14
+ <Flex vertical gap={40}>
15
+ <Title
16
+ level={1}
17
+ className={classNames(styles.white, styles.loginTitle)}
18
+ >
19
+ Start building your smart assisstants.
20
+ </Title>
21
+ <Text className={classNames(styles.pink, styles.loginDescription)}>
22
+ Sign up for free to explore top RAG technology. Create knowledge bases
23
+ and AIs to empower your business.
24
+ </Text>
25
+ <Flex align="center" gap={16}>
26
+ <Avatars></Avatars>
27
+ <Flex vertical>
28
+ <Space>
29
+ <Rate disabled defaultValue={5} />
30
+ <span
31
+ className={classNames(styles.white, styles.loginRateNumber)}
32
+ >
33
+ 5.0
34
+ </span>
35
+ </Space>
36
+ <span className={classNames(styles.pink, styles.loginRateReviews)}>
37
+ from 500+ reviews
38
+ </span>
39
+ </Flex>
40
+ </Flex>
41
+ </Flex>
42
+ </section>
43
+ );
44
+ };
45
+
46
+ export default LoginRightPanel;
web/src/pages/user-setting/setting-model/api-key-modal/index.tsx CHANGED
@@ -78,10 +78,9 @@ const ApiKeyModal = ({
78
  <Form.Item<FieldType>
79
  label="Base-Url"
80
  name="base_url"
81
- tooltip="The API key can be obtained by registering the corresponding LLM supplier."
82
- rules={[{ required: true, message: 'Please input base url!' }]}
83
  >
84
- <Input />
85
  </Form.Item>
86
  )}
87
  </Form>
 
78
  <Form.Item<FieldType>
79
  label="Base-Url"
80
  name="base_url"
81
+ tooltip="If your API key is from OpenAI, just ignore it. Any other intermediate providers will give this base url with the API key."
 
82
  >
83
+ <Input placeholder="https://api.openai.com/v1" />
84
  </Form.Item>
85
  )}
86
  </Form>
web/src/pages/user-setting/setting-model/index.tsx CHANGED
@@ -24,6 +24,7 @@ import {
24
  Row,
25
  Space,
26
  Spin,
 
27
  Typography,
28
  } from 'antd';
29
  import { useCallback } from 'react';
@@ -105,7 +106,13 @@ const ModelCard = ({ item, clickApiKey }: IModelCardProps) => {
105
  size="small"
106
  dataSource={item.llm}
107
  className={styles.llmList}
108
- renderItem={(item) => <List.Item>{item.name}</List.Item>}
 
 
 
 
 
 
109
  />
110
  )}
111
  </Card>
 
24
  Row,
25
  Space,
26
  Spin,
27
+ Tag,
28
  Typography,
29
  } from 'antd';
30
  import { useCallback } from 'react';
 
106
  size="small"
107
  dataSource={item.llm}
108
  className={styles.llmList}
109
+ renderItem={(item) => (
110
+ <List.Item>
111
+ <Space>
112
+ {item.name} <Tag color="#b8b8b8">{item.type}</Tag>
113
+ </Space>
114
+ </List.Item>
115
+ )}
116
  />
117
  )}
118
  </Card>