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

@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix mj upload error",
"packageName": "@acedatacloud/nexior",
"email": "office@acedata.cloud",
"dependentChangeType": "patch"
}
+16 -16
View File
@@ -19,7 +19,7 @@
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<div class="lds-ellipsis"> <div class="loading">
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
@@ -29,11 +29,11 @@
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>
<style> <style>
.lds-ellipsis, .loading,
.lds-ellipsis div { .loading div {
box-sizing: border-box; box-sizing: border-box;
} }
.lds-ellipsis { .loading {
display: inline-block; display: inline-block;
position: relative; position: relative;
width: 80px; width: 80px;
@@ -43,7 +43,7 @@
left: 50%; left: 50%;
transform: translate(-50%, -50%) scale(1); transform: translate(-50%, -50%) scale(1);
} }
.lds-ellipsis div { .loading div {
position: absolute; position: absolute;
top: 33.33333px; top: 33.33333px;
width: 13.33333px; width: 13.33333px;
@@ -52,23 +52,23 @@
background-color: #277186; background-color: #277186;
animation-timing-function: cubic-bezier(0, 1, 1, 0); animation-timing-function: cubic-bezier(0, 1, 1, 0);
} }
.lds-ellipsis div:nth-child(1) { .loading div:nth-child(1) {
left: 8px; left: 8px;
animation: lds-ellipsis1 0.6s infinite; animation: loading1 0.6s infinite;
} }
.lds-ellipsis div:nth-child(2) { .loading div:nth-child(2) {
left: 8px; left: 8px;
animation: lds-ellipsis2 0.6s infinite; animation: loading2 0.6s infinite;
} }
.lds-ellipsis div:nth-child(3) { .loading div:nth-child(3) {
left: 32px; left: 32px;
animation: lds-ellipsis2 0.6s infinite; animation: loading2 0.6s infinite;
} }
.lds-ellipsis div:nth-child(4) { .loading div:nth-child(4) {
left: 56px; left: 56px;
animation: lds-ellipsis3 0.6s infinite; animation: loading3 0.6s infinite;
} }
@keyframes lds-ellipsis1 { @keyframes loading1 {
0% { 0% {
transform: scale(0); transform: scale(0);
} }
@@ -76,7 +76,7 @@
transform: scale(1); transform: scale(1);
} }
} }
@keyframes lds-ellipsis3 { @keyframes loading3 {
0% { 0% {
transform: scale(1); transform: scale(1);
} }
@@ -84,7 +84,7 @@
transform: scale(0); transform: scale(0);
} }
} }
@keyframes lds-ellipsis2 { @keyframes loading2 {
0% { 0% {
transform: translate(0, 0); transform: translate(0, 0);
} }
+16 -5
View File
@@ -10,12 +10,12 @@
{{ $t('chat.message.startNewChat') }} {{ $t('chat.message.startNewChat') }}
</div> </div>
</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"> <div class="key">
{{ $t(`chat.group.${groupKey}`) }} {{ $t(`chat.group.${groupKey}`) }}
</div> </div>
<div <div
v-for="(conversation, conversationIndex) in conversations" v-for="(conversation, conversationIndex) in group"
:key="conversationIndex" :key="conversationIndex"
:class="{ conversation: true, active: conversation.id === conversationId }" :class="{ conversation: true, active: conversation.id === conversationId }"
@click="onClickConversation(conversation.id)" @click="onClickConversation(conversation.id)"
@@ -95,7 +95,7 @@ export default defineComponent({
console.debug('conversationId in side', this.$route.params?.id); console.debug('conversationId in side', this.$route.params?.id);
return this.$route.params?.id?.toString(); return this.$route.params?.id?.toString();
}, },
conversationGroups() { conversations() {
let conversations = this.$store.state.chat.conversations; let conversations = this.$store.state.chat.conversations;
console.debug('conversations', conversations); console.debug('conversations', conversations);
console.debug('modelGroup', this.modelGroup); 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) conversation.model && this.modelGroup.models?.map((item) => item.name as string)?.includes(conversation.model)
); );
console.debug('filtered conversations', conversations); console.debug('filtered conversations', conversations);
return conversations;
},
conversationGroups() {
// split our 4 groups according to the `updated_at` field, to 'today', 'yesterday', 'this week', 'earlier'. // split our 4 groups according to the `updated_at` field, to 'today', 'yesterday', 'this week', 'earlier'.
// if (conversations) {
const today = new Date(); const today = new Date();
today.setHours(0, 0, 0, 0); today.setHours(0, 0, 0, 0);
const yesterday = new Date(today); const yesterday = new Date(today);
@@ -115,7 +117,7 @@ export default defineComponent({
thisWeek.setDate(thisWeek.getDate() - today.getDay()); thisWeek.setDate(thisWeek.getDate() - today.getDay());
const earlier = new Date(thisWeek); const earlier = new Date(thisWeek);
earlier.setDate(earlier.getDate() - 7); earlier.setDate(earlier.getDate() - 7);
const groups = conversations?.reduce( const groups = this.conversations?.reduce(
(acc, conversation: IChatConversation) => { (acc, conversation: IChatConversation) => {
const updatedAt = new Date(conversation.updated_at! * 1000); const updatedAt = new Date(conversation.updated_at! * 1000);
if (updatedAt >= today) { if (updatedAt >= today) {
@@ -155,6 +157,15 @@ export default defineComponent({
return this.$store.state.chat?.credential?.token; 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: { methods: {
async onNewConversation() { async onNewConversation() {
console.debug('onNewConversation from side panel'); console.debug('onNewConversation from side panel');
+4 -3
View File
@@ -43,6 +43,7 @@ import {
ROUTE_KLING_INDEX, ROUTE_KLING_INDEX,
ROUTE_KLING_HISTORY ROUTE_KLING_HISTORY
} from '@/router/constants'; } 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 LogoTiny from './LogoTiny.vue';
import UserCenter from '@/components/user/Center.vue'; import UserCenter from '@/components/user/Center.vue';
@@ -79,7 +80,7 @@ export default defineComponent({
name: ROUTE_CHATGPT_CONVERSATION_NEW name: ROUTE_CHATGPT_CONVERSATION_NEW
}, },
displayName: this.$t('common.nav.chatgpt'), 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] routes: [ROUTE_CHATGPT_CONVERSATION, ROUTE_CHATGPT_CONVERSATION_NEW]
}); });
} }
@@ -90,7 +91,7 @@ export default defineComponent({
name: ROUTE_DEEPSEEK_CONVERSATION_NEW name: ROUTE_DEEPSEEK_CONVERSATION_NEW
}, },
displayName: this.$t('common.nav.deepseek'), 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] routes: [ROUTE_DEEPSEEK_CONVERSATION, ROUTE_DEEPSEEK_CONVERSATION_NEW]
}); });
} }
@@ -101,7 +102,7 @@ export default defineComponent({
name: ROUTE_GROK_CONVERSATION_NEW name: ROUTE_GROK_CONVERSATION_NEW
}, },
displayName: this.$t('common.nav.grok'), 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] routes: [ROUTE_GROK_CONVERSATION, ROUTE_GROK_CONVERSATION_NEW]
}); });
} }
@@ -11,6 +11,7 @@
name="file" name="file"
:limit="5" :limit="5"
class="upload-wrapper" class="upload-wrapper"
accept=".png,.jpg,.jpeg,.gif,.bmp,.webp"
:multiple="true" :multiple="true"
list-type="picture" list-type="picture"
:action="uploadUrl" :action="uploadUrl"
@@ -72,25 +73,16 @@ export default defineComponent({
urls() { urls() {
// @ts-ignore // @ts-ignore
return this.fileList.map((file: UploadFile) => file?.response?.file_url); 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: { watch: {
urls: { urls: {
handler(val) { handler(val) {
console.debug('URLs changed:', 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-divider v-if="user.email" class="mb-1 mt-1" />
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item class="py-2" @click="onSettings"> <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') }} {{ $t('common.nav.setting') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item class="py-2" @click="onDistribution"> <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') }} {{ $t('common.nav.distribution') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item class="py-2" @click="onConsole"> <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') }} {{ $t('common.nav.console') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item class="py-2" @click="onLogout"> <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') }} {{ $t('common.nav.logOut') }}
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
+8 -8
View File
@@ -16,15 +16,15 @@ export const CHAT_MODEL_NAME_GROK_3 = 'grok-3';
export const CHAT_MODEL_NAME_GROK_3_REASONER = 'grok-3-reasoning'; export const CHAT_MODEL_NAME_GROK_3_REASONER = 'grok-3-reasoning';
export const CHAT_MODEL_NAME_GROK_3_DEEPSEARCH = 'grok-3-deepsearch'; export const CHAT_MODEL_NAME_GROK_3_DEEPSEARCH = 'grok-3-deepsearch';
export const CHAT_MODEL_ICON_OPENAI = 'https://cdn.acedata.cloud/7dljuv.png'; export const CHAT_MODEL_ICON_CHATGPT = 'https://cdn.acedata.cloud/7dljuv.png';
export const CHAT_MODEL_ICON_GROK = 'https://cdn.acedata.cloud/p1ge98.png'; export const CHAT_MODEL_ICON_GROK = 'https://cdn.acedata.cloud/p1ge98.png';
export const CHAT_MODEL_ICON_DEEPSEEK = 'https://cdn.acedata.cloud/bc71ae.png'; export const CHAT_MODEL_ICON_DEEPSEEK = 'https://cdn.acedata.cloud/4rb23t.jpg';
export const CHAT_SERVICE_ID = 'b1fbcc32-e218-4253-9dc3-4fe600a1bfb9'; export const CHAT_SERVICE_ID = 'b1fbcc32-e218-4253-9dc3-4fe600a1bfb9';
export const CHAT_MODEL_GPT_4_ALL: IChatModel = { export const CHAT_MODEL_GPT_4_ALL: IChatModel = {
name: CHAT_MODEL_NAME_GPT_4_ALL, name: CHAT_MODEL_NAME_GPT_4_ALL,
icon: CHAT_MODEL_ICON_OPENAI, icon: CHAT_MODEL_ICON_CHATGPT,
modelGroup: 'chatgpt', modelGroup: 'chatgpt',
isFileSupported: true, isFileSupported: true,
getDisplayName: () => i18n.global.t('chat.model.4All'), getDisplayName: () => i18n.global.t('chat.model.4All'),
@@ -33,7 +33,7 @@ export const CHAT_MODEL_GPT_4_ALL: IChatModel = {
export const CHAT_MODEL_GPT_4O: IChatModel = { export const CHAT_MODEL_GPT_4O: IChatModel = {
name: CHAT_MODEL_NAME_GPT_4O, name: CHAT_MODEL_NAME_GPT_4O,
icon: CHAT_MODEL_ICON_OPENAI, icon: CHAT_MODEL_ICON_CHATGPT,
modelGroup: 'chatgpt', modelGroup: 'chatgpt',
isFileSupported: true, isFileSupported: true,
getDisplayName: () => i18n.global.t('chat.model.4O'), getDisplayName: () => i18n.global.t('chat.model.4O'),
@@ -58,7 +58,7 @@ export const CHAT_MODEL_DEEPSEEK_REASONER: IChatModel = {
export const CHAT_MODEL_O1: IChatModel = { export const CHAT_MODEL_O1: IChatModel = {
name: CHAT_MODEL_NAME_O1, name: CHAT_MODEL_NAME_O1,
icon: CHAT_MODEL_ICON_OPENAI, icon: CHAT_MODEL_ICON_CHATGPT,
modelGroup: 'chatgpt', modelGroup: 'chatgpt',
getDisplayName: () => i18n.global.t('chat.model.o1'), getDisplayName: () => i18n.global.t('chat.model.o1'),
getDescription: () => i18n.global.t('chat.model.o1Description') getDescription: () => i18n.global.t('chat.model.o1Description')
@@ -66,7 +66,7 @@ export const CHAT_MODEL_O1: IChatModel = {
export const CHAT_MODEL_O1_MINI: IChatModel = { export const CHAT_MODEL_O1_MINI: IChatModel = {
name: CHAT_MODEL_NAME_O1_MINI, name: CHAT_MODEL_NAME_O1_MINI,
icon: CHAT_MODEL_ICON_OPENAI, icon: CHAT_MODEL_ICON_CHATGPT,
modelGroup: 'chatgpt', modelGroup: 'chatgpt',
getDisplayName: () => i18n.global.t('chat.model.o1Mini'), getDisplayName: () => i18n.global.t('chat.model.o1Mini'),
getDescription: () => i18n.global.t('chat.model.o1MiniDescription') getDescription: () => i18n.global.t('chat.model.o1MiniDescription')
@@ -74,7 +74,7 @@ export const CHAT_MODEL_O1_MINI: IChatModel = {
export const CHAT_MODEL_O3_MINI: IChatModel = { export const CHAT_MODEL_O3_MINI: IChatModel = {
name: CHAT_MODEL_NAME_O3_MINI, name: CHAT_MODEL_NAME_O3_MINI,
icon: CHAT_MODEL_ICON_OPENAI, icon: CHAT_MODEL_ICON_CHATGPT,
modelGroup: 'chatgpt', modelGroup: 'chatgpt',
getDisplayName: () => i18n.global.t('chat.model.o3Mini'), getDisplayName: () => i18n.global.t('chat.model.o3Mini'),
getDescription: () => i18n.global.t('chat.model.o3MiniDescription') getDescription: () => i18n.global.t('chat.model.o3MiniDescription')
@@ -105,7 +105,7 @@ export const CHAT_MODEL_GROK_3_DEEPSEARCH: IChatModel = {
}; };
export const CHAT_MODEL_GROUP_CHATGPT: IChatModelGroup = { export const CHAT_MODEL_GROUP_CHATGPT: IChatModelGroup = {
icon: CHAT_MODEL_ICON_OPENAI, icon: CHAT_MODEL_ICON_CHATGPT,
name: 'chatgpt', name: 'chatgpt',
getDisplayName: () => i18n.global.t('chat.modelGroup.chatgpt'), getDisplayName: () => i18n.global.t('chat.modelGroup.chatgpt'),
getDescription: () => i18n.global.t('chat.modelGroup.chatgptDescription'), getDescription: () => i18n.global.t('chat.modelGroup.chatgptDescription'),
+3 -3
View File
@@ -44,13 +44,13 @@ export default defineComponent({
return this.$store.state[this.appName]?.status.getApplications === Status.Request; return this.$store.state[this.appName]?.status.getApplications === Status.Request;
}, },
needApply() { needApply() {
return this.$store.state[this.appName].status.getApplications === Status.Success && !this.application; return this.$store.state[this.appName]?.status.getApplications === Status.Success && !this.application;
}, },
application() { application() {
return this.$store.state[this.appName].application; return this.$store.state[this.appName]?.application;
}, },
applications() { applications() {
return this.$store.state[this.appName].applications; return this.$store.state[this.appName]?.applications;
}, },
loading() { loading() {
return this.$store.state[this.appName]?.status?.getApplications === Status.Request; return this.$store.state[this.appName]?.status?.getApplications === Status.Request;
-1
View File
@@ -54,7 +54,6 @@ const main = async () => {
formatString: 'YYYY-MM-DD HH:mm:ss' formatString: 'YYYY-MM-DD HH:mm:ss'
}); });
app.directive('loading', vLoading); app.directive('loading', vLoading);
// app.use(createMotionPlugin());
app.mount('#app'); app.mount('#app');
console.debug('app mounted'); console.debug('app mounted');
+2 -2
View File
@@ -12,8 +12,8 @@ interface IOptions {
export default { export default {
install: (app: App, options: IOptions) => { install: (app: App, options: IOptions) => {
app.config.globalProperties.$dayjs = { app.config.globalProperties.$dayjs = {
format(v: string, formatString: string = '') { format(v: string | undefined, formatString?: string) {
return dayjs(v).format(formatString || options.formatString); return v ? dayjs(v).format(formatString || options.formatString) : '';
} }
}; };
} }
-24
View File
@@ -1,24 +0,0 @@
import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from './constants';
export default {
path: '/chat',
component: () => import('@/layouts/Main.vue'),
children: [
{
path: '',
redirect: {
name: ROUTE_CHAT_CONVERSATION_NEW
}
},
{
path: 'conversations',
name: ROUTE_CHAT_CONVERSATION_NEW,
component: () => import('@/pages/chat/Conversation.vue')
},
{
path: 'conversations/:id',
name: ROUTE_CHAT_CONVERSATION,
component: () => import('@/pages/chat/Conversation.vue')
}
]
};
-3
View File
@@ -5,9 +5,6 @@ export const ROUTE_AUTH_CALLBACK = 'auth-callback';
export const ROUTE_SITE_INDEX = 'site-index'; export const ROUTE_SITE_INDEX = 'site-index';
export const ROUTE_CHAT_CONVERSATION = 'chat-conversation';
export const ROUTE_CHAT_CONVERSATION_NEW = 'chat-conversation-new';
export const ROUTE_CHATGPT_CONVERSATION = 'chatgpt-conversation'; export const ROUTE_CHATGPT_CONVERSATION = 'chatgpt-conversation';
export const ROUTE_CHATGPT_CONVERSATION_NEW = 'chatgpt-conversation-new'; export const ROUTE_CHATGPT_CONVERSATION_NEW = 'chatgpt-conversation-new';
-2
View File
@@ -1,7 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router'; import { createRouter, createWebHistory } from 'vue-router';
import auth from './auth'; import auth from './auth';
import console from './console'; import console from './console';
import chat from './chat';
import grok from './grok'; import grok from './grok';
import deepseek from './deepseek'; import deepseek from './deepseek';
import chatgpt from './chatgpt'; import chatgpt from './chatgpt';
@@ -31,7 +30,6 @@ const routes = [
console, console,
chatdoc, chatdoc,
auth, auth,
chat,
chatgpt, chatgpt,
grok, grok,
deepseek, deepseek,
+1 -1
View File
@@ -170,7 +170,7 @@ export const initializeToken = async () => {
* Initialize theme * Initialize theme
*/ */
export const initializeTheme = async () => { export const initializeTheme = async () => {
const theme = getCookie('THEME') || 'light'; const theme = getCookie('THEME') || 'dark';
console.debug('initialize theme', theme); console.debug('initialize theme', theme);
applyTheme(theme); applyTheme(theme);
}; };