@lobehub/chat 0.101.1 → 0.101.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.101.3](https://github.com/lobehub/lobe-chat/compare/v0.101.2...v0.101.3)
6
+
7
+ <sup>Released on **2023-11-14**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Improve password ui to make it more clear.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Improve password ui to make it more clear, closes [#458](https://github.com/lobehub/lobe-chat/issues/458) ([e3d2a8e](https://github.com/lobehub/lobe-chat/commit/e3d2a8e))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.101.2](https://github.com/lobehub/lobe-chat/compare/v0.101.1...v0.101.2)
31
+
32
+ <sup>Released on **2023-11-14**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: upload image to vision model adapting to mobile device.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: upload image to vision model adapting to mobile device, closes [#457](https://github.com/lobehub/lobe-chat/issues/457) ([9c4f4ee](https://github.com/lobehub/lobe-chat/commit/9c4f4ee))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.101.1](https://github.com/lobehub/lobe-chat/compare/v0.101.0...v0.101.1)
6
56
 
7
57
  <sup>Released on **2023-11-14**</sup>
@@ -61,5 +61,10 @@
61
61
  },
62
62
  "translateTo": "Translate",
63
63
  "updateAgent": "Update Agent Information",
64
+ "upload": {
65
+ "actionTooltip": "Upload Image",
66
+ "dragDesc": "Drag and drop files here, supports uploading multiple images. Hold Shift to send images directly",
67
+ "dragTitle": "Upload Image"
68
+ },
64
69
  "warp": "Line Break"
65
70
  }
@@ -37,7 +37,8 @@
37
37
  "confirm": "Confirm and Retry",
38
38
  "password": {
39
39
  "description": "The application encryption has been enabled by the administrator. Enter the application password to unlock the application. The password only needs to be filled in once.",
40
- "title": "Enter Password to Unlock Application"
40
+ "title": "Enter Password to Unlock Application",
41
+ "placeholder": "Please enter password"
41
42
  },
42
43
  "closeMessage": "Close message"
43
44
  }
@@ -61,5 +61,10 @@
61
61
  },
62
62
  "translateTo": "翻訳",
63
63
  "updateAgent": "エージェント情報を更新",
64
+ "upload": {
65
+ "actionTooltip": "画像をアップロード",
66
+ "dragDesc": "ファイルをここにドラッグして複数の画像をアップロードできます。Shift キーを押しながら画像を直接送信できます",
67
+ "dragTitle": "画像をアップロード"
68
+ },
64
69
  "warp": "改行"
65
70
  }
@@ -38,7 +38,8 @@
38
38
  "confirm": "確認して再試行",
39
39
  "password": {
40
40
  "description": "管理者によってアプリが暗号化されました。アプリをロック解除するには、アプリのパスワードを入力してください。パスワードは1回だけ入力すればよいです",
41
- "title": "パスワードを入力してアプリをロック解除"
41
+ "title": "パスワードを入力してアプリをロック解除",
42
+ "placeholder": "パスワードを入力してください"
42
43
  }
43
44
  }
44
45
  }
@@ -61,5 +61,10 @@
61
61
  },
62
62
  "translateTo": "번역",
63
63
  "updateAgent": "도우미 정보 업데이트",
64
+ "upload": {
65
+ "actionTooltip": "이미지 업로드",
66
+ "dragDesc": "여기로 파일을 끌어다 놓으세요. 여러 이미지를 업로드할 수 있습니다. Shift를 누른 채로 이미지를 직접 보내세요.",
67
+ "dragTitle": "이미지 업로드"
68
+ },
64
69
  "warp": "줄바꿈"
65
70
  }
@@ -38,7 +38,8 @@
38
38
  "confirm": "확인 및 다시 시도",
39
39
  "password": {
40
40
  "description": "관리자가 애플리케이션 암호화를 활성화했습니다. 애플리케이션을 잠금 해제하려면 애플리케이션 비밀번호를 입력하십시오. 비밀번호는 한 번만 입력하면 됩니다.",
41
- "title": "암호 입력하여 애플리케이션 잠금 해제"
41
+ "title": "암호 입력하여 애플리케이션 잠금 해제",
42
+ "placeholder": "비밀번호를 입력하세요"
42
43
  }
43
44
  }
44
45
  }
@@ -61,5 +61,10 @@
61
61
  },
62
62
  "translateTo": "Перевести на",
63
63
  "updateAgent": "Обновить информацию о помощнике",
64
+ "upload": {
65
+ "actionTooltip": "Загрузить изображение",
66
+ "dragDesc": "Перетащите файлы сюда, поддерживается загрузка нескольких изображений. Удерживайте клавишу Shift для прямой отправки изображений",
67
+ "dragTitle": "Загрузить изображение"
68
+ },
64
69
  "warp": "Перенос строки"
65
70
  }
@@ -37,7 +37,8 @@
37
37
  "confirm": "Подтвердить и повторить попытку",
38
38
  "password": {
39
39
  "description": "Шифрование приложения включено администратором. Введите пароль приложения, чтобы разблокировать приложение. Пароль необходимо ввести только один раз.",
40
- "title": "Введите пароль для разблокировки приложения"
40
+ "title": "Введите пароль для разблокировки приложения",
41
+ "placeholder": "Введите пароль"
41
42
  },
42
43
  "closeMessage": "Закрыть сообщение"
43
44
  }
@@ -59,5 +59,10 @@
59
59
  },
60
60
  "translateTo": "翻译",
61
61
  "updateAgent": "更新助理信息",
62
+ "upload": {
63
+ "actionTooltip": "上传图片",
64
+ "dragDesc": "拖拽文件到这里,支持上传多个图片。按住 Shift 直接发送图片",
65
+ "dragTitle": "上传图片"
66
+ },
62
67
  "warp": "换行"
63
68
  }
@@ -38,6 +38,7 @@
38
38
  "confirm": "确认并重试",
39
39
  "password": {
40
40
  "description": "管理员已开启应用加密,输入应用密码后即可解锁应用。密码只需填写一次",
41
+ "placeholder": "请输入密码",
41
42
  "title": "输入密码解锁应用"
42
43
  }
43
44
  }
@@ -61,5 +61,10 @@
61
61
  },
62
62
  "translateTo": "翻譯",
63
63
  "updateAgent": "更新助理資訊",
64
+ "upload": {
65
+ "actionTooltip": "上傳圖片",
66
+ "dragDesc": "拖曳檔案到這裡,支援上傳多張圖片。按住 Shift 直接發送圖片",
67
+ "dragTitle": "上傳圖片"
68
+ },
64
69
  "warp": "換行"
65
70
  }
@@ -37,7 +37,8 @@
37
37
  "confirm": "確認並重試",
38
38
  "password": {
39
39
  "description": "管理員已啟用應用程式加密,輸入應用程式密碼後即可解鎖應用程式。密碼只需填寫一次。",
40
- "title": "輸入密碼解鎖應用程式"
40
+ "title": "輸入密碼解鎖應用程式",
41
+ "placeholder": "請輸入密碼"
41
42
  },
42
43
  "closeMessage": "關閉提示"
43
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.101.1",
3
+ "version": "0.101.3",
4
4
  "description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -1,11 +1,7 @@
1
- import { TextArea } from '@lobehub/ui';
2
1
  import { createStyles } from 'antd-style';
3
- import { memo, useRef } from 'react';
4
- import { useTranslation } from 'react-i18next';
2
+ import { memo } from 'react';
5
3
 
6
- import { useSessionStore } from '@/store/session';
7
-
8
- import { useSendMessage } from '../../../features/ChatInput/useSend';
4
+ import InputAreaInner from '@/app/chat/features/ChatInput/InputAreaInner';
9
5
 
10
6
  const useStyles = createStyles(({ css }) => {
11
7
  return {
@@ -22,46 +18,11 @@ const useStyles = createStyles(({ css }) => {
22
18
  });
23
19
 
24
20
  const InputArea = memo(() => {
25
- const { t } = useTranslation('common');
26
- const { cx, styles } = useStyles();
27
-
28
- const isChineseInput = useRef(false);
29
-
30
- const [loading, message, updateInputMessage] = useSessionStore((s) => [
31
- !!s.chatLoadingId,
32
- s.inputMessage,
33
- s.updateInputMessage,
34
- ]);
35
-
36
- const handleSend = useSendMessage();
21
+ const { styles } = useStyles();
37
22
 
38
23
  return (
39
- <div className={cx(styles.textareaContainer)}>
40
- <TextArea
41
- className={styles.textarea}
42
- onBlur={(e) => {
43
- updateInputMessage(e.target.value);
44
- }}
45
- onChange={(e) => {
46
- updateInputMessage(e.target.value);
47
- }}
48
- onCompositionEnd={() => {
49
- isChineseInput.current = false;
50
- }}
51
- onCompositionStart={() => {
52
- isChineseInput.current = true;
53
- }}
54
- onPressEnter={(e) => {
55
- if (!loading && !e.shiftKey && !isChineseInput.current) {
56
- e.preventDefault();
57
- handleSend();
58
- }
59
- }}
60
- placeholder={t('sendPlaceholder', { ns: 'chat' })}
61
- resize={false}
62
- type="pure"
63
- value={message}
64
- />
24
+ <div className={styles.textareaContainer}>
25
+ <InputAreaInner className={styles.textarea} />
65
26
  </div>
66
27
  );
67
28
  });
@@ -0,0 +1,17 @@
1
+ import { memo } from 'react';
2
+ import { Flexbox } from 'react-layout-kit';
3
+
4
+ import FileList from '@/app/chat/components/FileList';
5
+ import { useFileStore } from '@/store/files';
6
+
7
+ const Files = memo(() => {
8
+ const inputFilesList = useFileStore((s) => s.inputFilesList);
9
+
10
+ return (
11
+ <Flexbox padding={12}>
12
+ <FileList alwaysShowClose items={inputFilesList} />
13
+ </Flexbox>
14
+ );
15
+ });
16
+
17
+ export default Files;
@@ -1,79 +1,25 @@
1
- import { Icon, Input } from '@lobehub/ui';
2
- import { Button, type InputRef } from 'antd';
3
- import { Loader2, SendHorizonal } from 'lucide-react';
4
- import { forwardRef, useCallback, useRef } from 'react';
5
- import { useTranslation } from 'react-i18next';
1
+ import { memo } from 'react';
6
2
  import { Flexbox } from 'react-layout-kit';
7
- import useControlledState from 'use-merge-value';
8
3
 
9
4
  import ActionBar from '@/app/chat/features/ChatInput/ActionBar';
5
+ import InputAreaInner from '@/app/chat/features/ChatInput/InputAreaInner';
10
6
  import SaveTopic from '@/app/chat/features/ChatInput/Topic';
11
7
 
8
+ import SendButton from './SendButton';
12
9
  import { useStyles } from './style.mobile';
13
10
 
14
- export type ChatInputAreaMobile = {
15
- loading?: boolean;
16
- onChange?: (value: string) => void;
17
- onSend?: (value: string) => void;
18
- onStop?: () => void;
19
- value?: string;
20
- };
11
+ const ChatInputArea = memo(() => {
12
+ const { cx, styles } = useStyles();
21
13
 
22
- const ChatInputArea = forwardRef<InputRef, ChatInputAreaMobile>(
23
- ({ onSend, loading, onChange, onStop, value }) => {
24
- const { t } = useTranslation('chat');
25
- const [currentValue, setCurrentValue] = useControlledState<string>('', {
26
- onChange: onChange,
27
- value,
28
- });
29
- const { cx, styles } = useStyles();
30
- const isChineseInput = useRef(false);
31
-
32
- const handleSend = useCallback(() => {
33
- if (loading) return;
34
- if (onSend) onSend(currentValue);
35
- setCurrentValue('');
36
- }, [currentValue]);
37
-
38
- return (
39
- <Flexbox className={cx(styles.container)} gap={12}>
40
- <ActionBar rightAreaStartRender={<SaveTopic />} />
41
- <Flexbox className={styles.inner} gap={8} horizontal>
42
- <Input
43
- className={cx(styles.input)}
44
- onBlur={(e) => {
45
- setCurrentValue(e.target.value);
46
- }}
47
- onChange={(e) => {
48
- setCurrentValue(e.target.value);
49
- }}
50
- onCompositionEnd={() => {
51
- isChineseInput.current = false;
52
- }}
53
- onCompositionStart={() => {
54
- isChineseInput.current = true;
55
- }}
56
- onPressEnter={(e) => {
57
- if (!loading && !e.shiftKey && !isChineseInput.current) {
58
- e.preventDefault();
59
- handleSend();
60
- }
61
- }}
62
- placeholder={t('sendPlaceholder')}
63
- type={'block'}
64
- value={currentValue}
65
- />
66
- <div>
67
- {loading ? (
68
- <Button icon={loading && <Icon icon={Loader2} spin />} onClick={onStop} />
69
- ) : (
70
- <Button icon={<Icon icon={SendHorizonal} />} onClick={handleSend} type={'primary'} />
71
- )}
72
- </div>
73
- </Flexbox>
14
+ return (
15
+ <Flexbox className={cx(styles.container)} gap={12}>
16
+ <ActionBar rightAreaStartRender={<SaveTopic />} />
17
+ <Flexbox className={styles.inner} gap={8} horizontal>
18
+ <InputAreaInner mobile />
19
+ <SendButton />
74
20
  </Flexbox>
75
- );
76
- },
77
- );
21
+ </Flexbox>
22
+ );
23
+ });
78
24
 
79
25
  export default ChatInputArea;
@@ -0,0 +1,30 @@
1
+ import { Icon } from '@lobehub/ui';
2
+ import { Button } from 'antd';
3
+ import { Loader2, SendHorizonal } from 'lucide-react';
4
+ import { memo } from 'react';
5
+
6
+ import { useSendMessage } from '@/app/chat/features/ChatInput/useSend';
7
+ import { useSessionStore } from '@/store/session';
8
+
9
+ const SendButton = memo(() => {
10
+ const [loading, onStop] = useSessionStore((s) => [!!s.chatLoadingId, s.stopGenerateMessage]);
11
+
12
+ const handleSend = useSendMessage();
13
+
14
+ return loading ? (
15
+ <Button
16
+ icon={loading && <Icon icon={Loader2} spin />}
17
+ onClick={onStop}
18
+ style={{ flex: 'none' }}
19
+ />
20
+ ) : (
21
+ <Button
22
+ icon={<Icon icon={SendHorizonal} />}
23
+ onClick={handleSend}
24
+ style={{ flex: 'none' }}
25
+ type={'primary'}
26
+ />
27
+ );
28
+ });
29
+
30
+ export default SendButton;
@@ -1,10 +1,10 @@
1
1
  import { createStyles } from 'antd-style';
2
- import { memo, useState } from 'react';
2
+ import { memo } from 'react';
3
3
 
4
4
  import SafeSpacing from '@/components/SafeSpacing';
5
5
  import { CHAT_TEXTAREA_HEIGHT_MOBILE } from '@/const/layoutTokens';
6
- import { useSessionStore } from '@/store/session';
7
6
 
7
+ import Files from './Files';
8
8
  import ChatInputArea from './Mobile';
9
9
 
10
10
  const useStyles = createStyles(
@@ -23,25 +23,12 @@ const useStyles = createStyles(
23
23
  const ChatInputMobileLayout = memo(() => {
24
24
  const { styles } = useStyles();
25
25
 
26
- const [message, setMessage] = useState('');
27
-
28
- const [isLoading, sendMessage, stopGenerateMessage] = useSessionStore((s) => [
29
- !!s.chatLoadingId,
30
- s.sendMessage,
31
- s.stopGenerateMessage,
32
- ]);
33
-
34
26
  return (
35
27
  <>
28
+ <Files />
36
29
  <SafeSpacing height={CHAT_TEXTAREA_HEIGHT_MOBILE} mobile position={'bottom'} />
37
30
  <div className={styles}>
38
- <ChatInputArea
39
- loading={isLoading}
40
- onChange={setMessage}
41
- onSend={sendMessage}
42
- onStop={stopGenerateMessage}
43
- value={message}
44
- />
31
+ <ChatInputArea />
45
32
  </div>
46
33
  </>
47
34
  );
@@ -28,6 +28,9 @@ export const useStyles = createStyles(({ css, cx, token, isDarkMode }) => {
28
28
  `);
29
29
 
30
30
  return {
31
+ alwaysShowClose: css`
32
+ opacity: 1 !important;
33
+ `,
31
34
  closeIcon,
32
35
  container: css`
33
36
  cursor: pointer;
@@ -10,60 +10,64 @@ import { useFileStore } from '@/store/files';
10
10
 
11
11
  import { IMAGE_SIZE, useStyles } from './FileItem.style';
12
12
 
13
- const FileItem = memo<{ editable: boolean; id: string; onClick: () => void }>(
14
- ({ editable, id, onClick }) => {
15
- const { styles } = useStyles();
16
- const [useFetchFile, removeFile] = useFileStore((s) => [s.useFetchFile, s.removeFile]);
13
+ interface FileItemProps {
14
+ alwaysShowClose?: boolean;
15
+ editable: boolean;
16
+ id: string;
17
+ onClick: () => void;
18
+ }
19
+ const FileItem = memo<FileItemProps>(({ editable, id, onClick, alwaysShowClose }) => {
20
+ const { styles, cx } = useStyles();
21
+ const [useFetchFile, removeFile] = useFileStore((s) => [s.useFetchFile, s.removeFile]);
17
22
 
18
- const { data, isLoading } = useFetchFile(id);
23
+ const { data, isLoading } = useFetchFile(id);
19
24
 
20
- return (
21
- <Flexbox className={styles.container} onClick={onClick}>
22
- {isLoading ? (
23
- <Skeleton
24
- active
25
- title={{
26
- style: { borderRadius: 8, height: IMAGE_SIZE },
27
- width: IMAGE_SIZE,
28
- }}
29
- />
30
- ) : (
31
- <Flexbox className={styles.imageCtn}>
32
- <div className={styles.imageWrapper}>
33
- {data ? (
34
- <Image
35
- alt={data.name || ''}
36
- className={styles.image}
37
- fetchPriority={'high'}
38
- height={IMAGE_SIZE}
39
- loading={'lazy'}
40
- src={data.url}
41
- width={IMAGE_SIZE}
42
- />
43
- ) : (
44
- <Center className={styles.notFound} height={'100%'}>
45
- <Icon icon={LucideImageOff} size={{ fontSize: 28 }} />
46
- </Center>
47
- )}
48
- </div>
49
- </Flexbox>
50
- )}
51
- {/* only show close icon when editable */}
52
- {editable && (
53
- <Center
54
- className={styles.closeIcon}
55
- onClick={(e) => {
56
- e.stopPropagation();
25
+ return (
26
+ <Flexbox className={styles.container} onClick={onClick}>
27
+ {isLoading ? (
28
+ <Skeleton
29
+ active
30
+ title={{
31
+ style: { borderRadius: 8, height: IMAGE_SIZE },
32
+ width: IMAGE_SIZE,
33
+ }}
34
+ />
35
+ ) : (
36
+ <Flexbox className={styles.imageCtn}>
37
+ <div className={styles.imageWrapper}>
38
+ {data ? (
39
+ <Image
40
+ alt={data.name || ''}
41
+ className={styles.image}
42
+ fetchPriority={'high'}
43
+ height={IMAGE_SIZE}
44
+ loading={'lazy'}
45
+ src={data.url}
46
+ width={IMAGE_SIZE}
47
+ />
48
+ ) : (
49
+ <Center className={styles.notFound} height={'100%'}>
50
+ <Icon icon={LucideImageOff} size={{ fontSize: 28 }} />
51
+ </Center>
52
+ )}
53
+ </div>
54
+ </Flexbox>
55
+ )}
56
+ {/* only show close icon when editable */}
57
+ {editable && (
58
+ <Center
59
+ className={cx(styles.closeIcon, alwaysShowClose && styles.alwaysShowClose)}
60
+ onClick={(e) => {
61
+ e.stopPropagation();
57
62
 
58
- removeFile(id);
59
- }}
60
- >
61
- <CloseCircleFilled />
62
- </Center>
63
- )}
64
- </Flexbox>
65
- );
66
- },
67
- );
63
+ removeFile(id);
64
+ }}
65
+ >
66
+ <CloseCircleFilled />
67
+ </Center>
68
+ )}
69
+ </Flexbox>
70
+ );
71
+ });
68
72
 
69
73
  export default FileItem;
@@ -14,11 +14,14 @@ import Lightbox from './Lightbox';
14
14
  // }));
15
15
 
16
16
  interface FileListProps {
17
+ alwaysShowClose?: boolean;
18
+
17
19
  editable?: boolean;
20
+
18
21
  items: string[];
19
22
  }
20
23
 
21
- const FileList = memo<FileListProps>(({ items, editable = true }) => {
24
+ const FileList = memo<FileListProps>(({ items, editable = true, alwaysShowClose }) => {
22
25
  // const { styles } = useStyles();
23
26
 
24
27
  const [showLightbox, setShowLightbox] = useState(false);
@@ -38,6 +41,7 @@ const FileList = memo<FileListProps>(({ items, editable = true }) => {
38
41
  >
39
42
  {items.map((i, index) => (
40
43
  <FileItem
44
+ alwaysShowClose={alwaysShowClose}
41
45
  editable={editable}
42
46
  id={i}
43
47
  key={i}
@@ -0,0 +1,57 @@
1
+ import { Input, TextArea } from '@lobehub/ui';
2
+ import { memo, useRef } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ import { useSessionStore } from '@/store/session';
6
+
7
+ import { useSendMessage } from '../useSend';
8
+
9
+ export interface InputAreaInnerProps {
10
+ className?: string;
11
+ mobile?: boolean;
12
+ }
13
+
14
+ const InputAreaInner = memo<InputAreaInnerProps>(({ className, mobile }) => {
15
+ const { t } = useTranslation('chat');
16
+ const isChineseInput = useRef(false);
17
+
18
+ const [loading, message, updateInputMessage] = useSessionStore((s) => [
19
+ !!s.chatLoadingId,
20
+ s.inputMessage,
21
+ s.updateInputMessage,
22
+ ]);
23
+
24
+ const handleSend = useSendMessage();
25
+
26
+ const Render = mobile ? Input : TextArea;
27
+
28
+ return (
29
+ <Render
30
+ className={className}
31
+ onBlur={(e) => {
32
+ updateInputMessage(e.target.value);
33
+ }}
34
+ onChange={(e) => {
35
+ updateInputMessage(e.target.value);
36
+ }}
37
+ onCompositionEnd={() => {
38
+ isChineseInput.current = false;
39
+ }}
40
+ onCompositionStart={() => {
41
+ isChineseInput.current = true;
42
+ }}
43
+ onPressEnter={(e) => {
44
+ if (!loading && !e.shiftKey && !isChineseInput.current) {
45
+ e.preventDefault();
46
+ handleSend();
47
+ }
48
+ }}
49
+ placeholder={t('sendPlaceholder')}
50
+ resize={false}
51
+ type={mobile ? 'block' : 'pure'}
52
+ value={message}
53
+ />
54
+ );
55
+ });
56
+
57
+ export default InputAreaInner;
@@ -1,5 +1,5 @@
1
1
  import { Icon, RenderErrorMessage } from '@lobehub/ui';
2
- import { Button, Segmented } from 'antd';
2
+ import { Button, Input, Segmented } from 'antd';
3
3
  import { KeySquare, SquareAsterisk } from 'lucide-react';
4
4
  import { memo, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
@@ -8,7 +8,6 @@ import { Flexbox } from 'react-layout-kit';
8
8
  import { useGlobalStore } from '@/store/global';
9
9
  import { useSessionStore } from '@/store/session';
10
10
 
11
- import OtpInput from '../OTPInput';
12
11
  import APIKeyForm from './ApiKeyForm';
13
12
  import { ErrorActionContainer, FormAction } from './style';
14
13
 
@@ -47,11 +46,12 @@ const InvalidAccess: RenderErrorMessage = memo(({ id }) => {
47
46
  description={t('unlock.password.description')}
48
47
  title={t('unlock.password.title')}
49
48
  >
50
- <OtpInput
49
+ <Input.Password
51
50
  onChange={(e) => {
52
- setSettings({ password: e });
51
+ setSettings({ password: e.target.value });
53
52
  }}
54
- validationPattern={/.*/}
53
+ placeholder={t('unlock.password.placeholder')}
54
+ type={'block'}
55
55
  value={password}
56
56
  />
57
57
  </FormAction>
@@ -45,6 +45,7 @@ export default {
45
45
  confirm: '确认并重试',
46
46
  password: {
47
47
  description: '管理员已开启应用加密,输入应用密码后即可解锁应用。密码只需填写一次',
48
+ placeholder: '请输入密码',
48
49
  title: '输入密码解锁应用',
49
50
  },
50
51
  },