chore: dashboard api

This commit is contained in:
jialin
2024-06-26 19:01:38 +08:00
parent 0fa4e21fa5
commit 1293f71bce
21 changed files with 430 additions and 188 deletions
@@ -18,11 +18,20 @@ interface ChatFooterProps {
onView: () => void;
disabled?: boolean;
feedback?: React.ReactNode;
hasTokenResult?: boolean;
}
const ChatFooter: React.FC<ChatFooterProps> = (props) => {
const intl = useIntl();
const { onSubmit, onClear, onNewMessage, onView, feedback, disabled } = props;
const {
onSubmit,
onClear,
onNewMessage,
onView,
feedback,
disabled,
hasTokenResult
} = props;
useHotkeys(
HotKeys.SUBMIT.join(','),
() => {
@@ -34,7 +43,7 @@ const ChatFooter: React.FC<ChatFooterProps> = (props) => {
return (
<div className="chat-footer">
<Row style={{ width: '100%' }}>
<Col span={8}>
<Col span={hasTokenResult ? 8 : 12}>
<Space size={20}>
<Button
disabled={disabled}
@@ -53,8 +62,8 @@ const ChatFooter: React.FC<ChatFooterProps> = (props) => {
</Button>
</Space>
</Col>
<Col span={8}>{feedback}</Col>
<Col span={8} style={{ textAlign: 'right' }}>
<Col span={hasTokenResult ? 8 : 0}>{feedback}</Col>
<Col span={hasTokenResult ? 8 : 12} style={{ textAlign: 'right' }}>
<Space size={20}>
<Button
icon={<CodeOutlined></CodeOutlined>}
@@ -235,6 +235,7 @@ const MessageList: React.FC<MessageProps> = (props) => {
onSubmit={handleSubmit}
onView={handleView}
disabled={loading}
hasTokenResult={!!tokenResult}
feedback={<ReferenceParams usage={tokenResult}></ReferenceParams>}
></ChatFooter>
</div>
@@ -6,6 +6,10 @@
.message-list-wrap {
max-height: calc(100vh - 152px);
overflow-y: auto;
.ant-pro-page-container-children-container {
padding-inline: 26px;
}
}
.ground-left-footer {