Fix midjourney error (#226)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2025-07-19 13:31:09 +08:00
1 parent 6a36155252
commit 6e7787e827
14 files changed
+66 -85

No files matched your search

+16 -5
View File
@@ -10,12 +10,12 @@
{{ $t('chat.message.startNewChat') }}
</div>
</div>
<div v-for="(conversations, groupKey) in conversationGroups" :key="groupKey" class="group">
<div v-for="(group, groupKey) in conversationGroups" :key="groupKey" class="group">
<div class="key">
{{ $t(`chat.group.${groupKey}`) }}
</div>
<div
v-for="(conversation, conversationIndex) in conversations"
v-for="(conversation, conversationIndex) in group"
:key="conversationIndex"
:class="{ conversation: true, active: conversation.id === conversationId }"
@click="onClickConversation(conversation.id)"
@@ -95,7 +95,7 @@ export default defineComponent({
console.debug('conversationId in side', this.$route.params?.id);
return this.$route.params?.id?.toString();
},
conversationGroups() {
conversations() {
let conversations = this.$store.state.chat.conversations;
console.debug('conversations', conversations);
console.debug('modelGroup', this.modelGroup);
@@ -105,8 +105,10 @@ export default defineComponent({
conversation.model && this.modelGroup.models?.map((item) => item.name as string)?.includes(conversation.model)
);
console.debug('filtered conversations', conversations);
return conversations;
},
conversationGroups() {
// split our 4 groups according to the `updated_at` field, to 'today', 'yesterday', 'this week', 'earlier'.
// if (conversations) {
const today = new Date();
today.setHours(0, 0, 0, 0);
const yesterday = new Date(today);
@@ -115,7 +117,7 @@ export default defineComponent({
thisWeek.setDate(thisWeek.getDate() - today.getDay());
const earlier = new Date(thisWeek);
earlier.setDate(earlier.getDate() - 7);
const groups = conversations?.reduce(
const groups = this.conversations?.reduce(
(acc, conversation: IChatConversation) => {
const updatedAt = new Date(conversation.updated_at! * 1000);
if (updatedAt >= today) {
@@ -155,6 +157,15 @@ export default defineComponent({
return this.$store.state.chat?.credential?.token;
}
},
watch: {
modelGroup() {
console.debug('modelGroup changed, refreshing conversations');
const firstConversation = this.conversations?.[0];
if (firstConversation) {
this.$emit('change-conversation', firstConversation.id);
}
}
},
methods: {
async onNewConversation() {
console.debug('onNewConversation from side panel');
+4 -3
View File
@@ -43,6 +43,7 @@ import {
ROUTE_KLING_INDEX,
ROUTE_KLING_HISTORY
} from '@/router/constants';
import { CHAT_MODEL_ICON_CHATGPT, CHAT_MODEL_ICON_DEEPSEEK, CHAT_MODEL_ICON_GROK } from '@/constants/chat';
import LogoTiny from './LogoTiny.vue';
import UserCenter from '@/components/user/Center.vue';
@@ -79,7 +80,7 @@ export default defineComponent({
name: ROUTE_CHATGPT_CONVERSATION_NEW
},
displayName: this.$t('common.nav.chatgpt'),
logo: 'https://cdn.acedata.cloud/7dljuv.png',
logo: CHAT_MODEL_ICON_CHATGPT,
routes: [ROUTE_CHATGPT_CONVERSATION, ROUTE_CHATGPT_CONVERSATION_NEW]
});
}
@@ -90,7 +91,7 @@ export default defineComponent({
name: ROUTE_DEEPSEEK_CONVERSATION_NEW
},
displayName: this.$t('common.nav.deepseek'),
logo: 'https://cdn.acedata.cloud/4rb23t.jpg',
logo: CHAT_MODEL_ICON_DEEPSEEK,
routes: [ROUTE_DEEPSEEK_CONVERSATION, ROUTE_DEEPSEEK_CONVERSATION_NEW]
});
}
@@ -101,7 +102,7 @@ export default defineComponent({
name: ROUTE_GROK_CONVERSATION_NEW
},
displayName: this.$t('common.nav.grok'),
logo: 'https://cdn.acedata.cloud/p1ge98.png',
logo: CHAT_MODEL_ICON_GROK,
routes: [ROUTE_GROK_CONVERSATION, ROUTE_GROK_CONVERSATION_NEW]
});
}
@@ -11,6 +11,7 @@
name="file"
:limit="5"
class="upload-wrapper"
accept=".png,.jpg,.jpeg,.gif,.bmp,.webp"
:multiple="true"
list-type="picture"
:action="uploadUrl"
@@ -72,25 +73,16 @@ export default defineComponent({
urls() {
// @ts-ignore
return this.fileList.map((file: UploadFile) => file?.response?.file_url);
},
value: {
get() {
return this.$store.state.midjourney.config.references || [];
},
set(val: string[]) {
console.debug('Setting references:', val);
this.$store.commit('midjourney/setConfig', {
...this.$store.state.midjourney.config,
references: val
});
}
}
},
watch: {
urls: {
handler(val) {
console.debug('URLs changed:', val);
this.$emit('change', val);
this.$store.commit('midjourney/setConfig', {
...this.$store.state.midjourney.config,
references: val
});
}
}
},
+4 -4
View File
@@ -9,19 +9,19 @@
<el-divider v-if="user.email" class="mb-1 mt-1" />
<el-dropdown-menu>
<el-dropdown-item class="py-2" @click="onSettings">
<font-awesome-icon icon="fa-solid fa-cog" class="mr-1" />
<font-awesome-icon icon="fa-solid fa-cog" class="mr-2" />
{{ $t('common.nav.setting') }}
</el-dropdown-item>
<el-dropdown-item class="py-2" @click="onDistribution">
<font-awesome-icon icon="fa-solid fa-coins" class="mr-1" />
<font-awesome-icon icon="fa-solid fa-coins" class="mr-2" />
{{ $t('common.nav.distribution') }}
</el-dropdown-item>
<el-dropdown-item class="py-2" @click="onConsole">
<font-awesome-icon icon="fa-solid fa-compass" class="mr-1" />
<font-awesome-icon icon="fa-solid fa-compass" class="mr-2" />
{{ $t('common.nav.console') }}
</el-dropdown-item>
<el-dropdown-item class="py-2" @click="onLogout">
<font-awesome-icon icon="fa-solid fa-arrow-right-from-bracket" class="mr-1" />
<font-awesome-icon icon="fa-solid fa-arrow-right-from-bracket" class="mr-2" />
{{ $t('common.nav.logOut') }}
</el-dropdown-item>
</el-dropdown-menu>