diff --git a/src/components/chat/InputBox.vue b/src/components/chat/InputBox.vue
index df2f6e1..e26038a 100644
--- a/src/components/chat/InputBox.vue
+++ b/src/components/chat/InputBox.vue
@@ -155,7 +155,7 @@ export default defineComponent({
border-radius: 10px;
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
- top: 40px;
+ top: 50px;
.upload {
display: inline-block;
&.disabled {
diff --git a/src/components/chat/Message.vue b/src/components/chat/Message.vue
index 73bea08..2cec732 100644
--- a/src/components/chat/Message.vue
+++ b/src/components/chat/Message.vue
@@ -9,6 +9,7 @@
+
@@ -20,10 +21,19 @@
import { defineComponent } from 'vue';
import AnsweringMark from './AnsweringMark.vue';
import copy from 'copy-to-clipboard';
-import { ElImage } from 'element-plus';
+import { ElAlert } from 'element-plus';
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import { IChatMessage, IChatMessageState } from '@/operators';
import CopyToClipboard from '../common/CopyToClipboard.vue';
+import {
+ ERROR_CODE_API_ERROR,
+ ERROR_CODE_BAD_REQUEST,
+ ERROR_CODE_CONTENT_TOO_LARGE,
+ ERROR_CODE_TIMEOUT,
+ ERROR_CODE_TOO_MANY_REQUESTS,
+ ERROR_CODE_UNKNOWN,
+ ERROR_CODE_USED_UP
+} from '@/constants';
interface IData {
copied: boolean;
messageState: typeof IChatMessageState;
@@ -35,7 +45,7 @@ export default defineComponent({
CopyToClipboard,
AnsweringMark,
MarkdownRenderer,
- ElImage
+ ElAlert
},
props: {
message: {
@@ -51,9 +61,28 @@ export default defineComponent({
};
},
computed: {
- // conversationId() {
- // return this.$route.params?.id?.toString();
- // }
+ errorText() {
+ if (!this.message.error || !this.message.error?.code) {
+ return undefined;
+ }
+ switch (this.message.error?.code) {
+ case ERROR_CODE_USED_UP:
+ return this.$t('chat.message.errorUsedUp');
+ case ERROR_CODE_API_ERROR:
+ return this.$t('chat.message.errorApiError');
+ case ERROR_CODE_BAD_REQUEST:
+ return this.$t('chat.message.errorBadRequest');
+ case ERROR_CODE_TIMEOUT:
+ return this.$t('chat.message.errorTimeout');
+ case ERROR_CODE_TOO_MANY_REQUESTS:
+ return this.$t('chat.message.errorTooManyRequests');
+ case ERROR_CODE_CONTENT_TOO_LARGE:
+ return this.$t('chat.message.errorContentTooLarge');
+ case ERROR_CODE_UNKNOWN:
+ default:
+ return this.$t('chat.message.errorUnknown');
+ }
+ }
},
methods: {
onCopy() {
diff --git a/src/components/chat/SidePanel.vue b/src/components/chat/SidePanel.vue
index 28503eb..03a9c29 100644
--- a/src/components/chat/SidePanel.vue
+++ b/src/components/chat/SidePanel.vue
@@ -13,7 +13,7 @@
@@ -84,6 +84,9 @@ export default defineComponent({
props: {},
emits: ['click'],
computed: {
+ conversationId() {
+ return this.$route.params?.id?.toString();
+ },
conversations() {
return this.$store.state.chat.conversations;
},
@@ -156,6 +159,11 @@ export default defineComponent({
color: #666;
cursor: pointer;
+ &.active,
+ &:hover {
+ background-color: #eee;
+ }
+
.icons {
width: 30px;
padding-left: 10px;
diff --git a/src/components/midjourney/tasks/TaskPreview.vue b/src/components/midjourney/tasks/TaskPreview.vue
index ddf64e3..2e78648 100644
--- a/src/components/midjourney/tasks/TaskPreview.vue
+++ b/src/components/midjourney/tasks/TaskPreview.vue
@@ -19,7 +19,7 @@
-