Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Update Session history layout #485

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/portal/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"settings": "Settings",
"signOut": "Sign Out",
"chatSpace": "Chats",
"conversation": "Chat",
"chat": "Current chat",
"chatHistory": "Chat history",
"chatHistoryDescription": "History ID:",
"chatDescription": "Click the button on the right to start a new conversation with chatBot",
"chatBot": "Chatbot",
"docLibrary": "Document Library",
Expand Down
3 changes: 3 additions & 0 deletions source/portal/src/locale/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"settings": "设置",
"signOut": "退出登录",
"chatSpace": "聊天",
"conversation": "会话",
"chat": "当前会话",
"chatHistory": "会话记录",
"chatHistoryDescription": "会话ID:",
"chatDescription": "点击右侧按钮开始与机器人的新对话",
"chatBot": "聊天机器人",
"docLibrary": "文档库",
Expand Down
22 changes: 11 additions & 11 deletions source/portal/src/pages/chatbot/ChatBot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ const ChatBot: React.FC<ChatBotProps> = (props: ChatBotProps) => {
href: '/',
},
{
text: t('chatbot'),
href: '/chatbots',
text: t('conversation'),
href: '/chats',
},
]}
>
Expand All @@ -585,21 +585,22 @@ const ChatBot: React.FC<ChatBotProps> = (props: ChatBotProps) => {
<Header
variant="h1"
actions={
<SpaceBetween size="xs" direction="horizontal">
historySessionId?(
<></>):(<SpaceBetween size="xs" direction="horizontal">
<Button
variant="primary"
disabled={aiSpeaking || readyState !== ReadyState.OPEN}
onClick={() => {
startNewChat()
}}
>
{t('button.startNewChat')}
</Button>

</SpaceBetween>
</SpaceBetween>)
}
description={t('chatDescription')}
description={historySessionId?(t('chatHistoryDescription') +" " +historySessionId):t('chatDescription')}
>
<Box variant="h1">{t('chat')}</Box>
<Box variant="h1">{historySessionId?t('chatHistory'):t('chat')}</Box>
</Header>
}
>
Expand Down Expand Up @@ -784,8 +785,8 @@ const ChatBot: React.FC<ChatBotProps> = (props: ChatBotProps) => {
</div>
)}
</div>

<div className="flex-v gap-10">
{historySessionId?(<></>):(<div className="flex-v gap-10">
<div className="flex gap-5 send-message">
<Select
options={chatbotList}
Expand Down Expand Up @@ -856,8 +857,7 @@ const ChatBot: React.FC<ChatBotProps> = (props: ChatBotProps) => {
</div>
</div>
</div>

</div>
</div>)}
</div>
</Container>
</ContentLayout>
Expand Down
Loading