Fix midjourney error (#226)
Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
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
@@ -19,7 +19,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="lds-ellipsis">
|
||||
<div class="loading">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
@@ -29,11 +29,11 @@
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
<style>
|
||||
.lds-ellipsis,
|
||||
.lds-ellipsis div {
|
||||
.loading,
|
||||
.loading div {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.lds-ellipsis {
|
||||
.loading {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 80px;
|
||||
@@ -43,7 +43,7 @@
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%) scale(1);
|
||||
}
|
||||
.lds-ellipsis div {
|
||||
.loading div {
|
||||
position: absolute;
|
||||
top: 33.33333px;
|
||||
width: 13.33333px;
|
||||
@@ -52,23 +52,23 @@
|
||||
background-color: #277186;
|
||||
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
||||
}
|
||||
.lds-ellipsis div:nth-child(1) {
|
||||
.loading div:nth-child(1) {
|
||||
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;
|
||||
animation: lds-ellipsis2 0.6s infinite;
|
||||
animation: loading2 0.6s infinite;
|
||||
}
|
||||
.lds-ellipsis div:nth-child(3) {
|
||||
.loading div:nth-child(3) {
|
||||
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;
|
||||
animation: lds-ellipsis3 0.6s infinite;
|
||||
animation: loading3 0.6s infinite;
|
||||
}
|
||||
@keyframes lds-ellipsis1 {
|
||||
@keyframes loading1 {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
}
|
||||
@@ -76,7 +76,7 @@
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
@keyframes lds-ellipsis3 {
|
||||
@keyframes loading3 {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
@@ -84,7 +84,7 @@
|
||||
transform: scale(0);
|
||||
}
|
||||
}
|
||||
@keyframes lds-ellipsis2 {
|
||||
@keyframes loading2 {
|
||||
0% {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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_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_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_MODEL_GPT_4_ALL: IChatModel = {
|
||||
name: CHAT_MODEL_NAME_GPT_4_ALL,
|
||||
icon: CHAT_MODEL_ICON_OPENAI,
|
||||
icon: CHAT_MODEL_ICON_CHATGPT,
|
||||
modelGroup: 'chatgpt',
|
||||
isFileSupported: true,
|
||||
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 = {
|
||||
name: CHAT_MODEL_NAME_GPT_4O,
|
||||
icon: CHAT_MODEL_ICON_OPENAI,
|
||||
icon: CHAT_MODEL_ICON_CHATGPT,
|
||||
modelGroup: 'chatgpt',
|
||||
isFileSupported: true,
|
||||
getDisplayName: () => i18n.global.t('chat.model.4O'),
|
||||
@@ -58,7 +58,7 @@ export const CHAT_MODEL_DEEPSEEK_REASONER: IChatModel = {
|
||||
|
||||
export const CHAT_MODEL_O1: IChatModel = {
|
||||
name: CHAT_MODEL_NAME_O1,
|
||||
icon: CHAT_MODEL_ICON_OPENAI,
|
||||
icon: CHAT_MODEL_ICON_CHATGPT,
|
||||
modelGroup: 'chatgpt',
|
||||
getDisplayName: () => i18n.global.t('chat.model.o1'),
|
||||
getDescription: () => i18n.global.t('chat.model.o1Description')
|
||||
@@ -66,7 +66,7 @@ export const CHAT_MODEL_O1: IChatModel = {
|
||||
|
||||
export const CHAT_MODEL_O1_MINI: IChatModel = {
|
||||
name: CHAT_MODEL_NAME_O1_MINI,
|
||||
icon: CHAT_MODEL_ICON_OPENAI,
|
||||
icon: CHAT_MODEL_ICON_CHATGPT,
|
||||
modelGroup: 'chatgpt',
|
||||
getDisplayName: () => i18n.global.t('chat.model.o1Mini'),
|
||||
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 = {
|
||||
name: CHAT_MODEL_NAME_O3_MINI,
|
||||
icon: CHAT_MODEL_ICON_OPENAI,
|
||||
icon: CHAT_MODEL_ICON_CHATGPT,
|
||||
modelGroup: 'chatgpt',
|
||||
getDisplayName: () => i18n.global.t('chat.model.o3Mini'),
|
||||
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 = {
|
||||
icon: CHAT_MODEL_ICON_OPENAI,
|
||||
icon: CHAT_MODEL_ICON_CHATGPT,
|
||||
name: 'chatgpt',
|
||||
getDisplayName: () => i18n.global.t('chat.modelGroup.chatgpt'),
|
||||
getDescription: () => i18n.global.t('chat.modelGroup.chatgptDescription'),
|
||||
|
||||
@@ -44,13 +44,13 @@ export default defineComponent({
|
||||
return this.$store.state[this.appName]?.status.getApplications === Status.Request;
|
||||
},
|
||||
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() {
|
||||
return this.$store.state[this.appName].application;
|
||||
return this.$store.state[this.appName]?.application;
|
||||
},
|
||||
applications() {
|
||||
return this.$store.state[this.appName].applications;
|
||||
return this.$store.state[this.appName]?.applications;
|
||||
},
|
||||
loading() {
|
||||
return this.$store.state[this.appName]?.status?.getApplications === Status.Request;
|
||||
|
||||
@@ -54,7 +54,6 @@ const main = async () => {
|
||||
formatString: 'YYYY-MM-DD HH:mm:ss'
|
||||
});
|
||||
app.directive('loading', vLoading);
|
||||
// app.use(createMotionPlugin());
|
||||
app.mount('#app');
|
||||
console.debug('app mounted');
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ interface IOptions {
|
||||
export default {
|
||||
install: (app: App, options: IOptions) => {
|
||||
app.config.globalProperties.$dayjs = {
|
||||
format(v: string, formatString: string = '') {
|
||||
return dayjs(v).format(formatString || options.formatString);
|
||||
format(v: string | undefined, formatString?: string) {
|
||||
return v ? dayjs(v).format(formatString || options.formatString) : '';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -5,9 +5,6 @@ export const ROUTE_AUTH_CALLBACK = 'auth-callback';
|
||||
|
||||
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_NEW = 'chatgpt-conversation-new';
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import auth from './auth';
|
||||
import console from './console';
|
||||
import chat from './chat';
|
||||
import grok from './grok';
|
||||
import deepseek from './deepseek';
|
||||
import chatgpt from './chatgpt';
|
||||
@@ -31,7 +30,6 @@ const routes = [
|
||||
console,
|
||||
chatdoc,
|
||||
auth,
|
||||
chat,
|
||||
chatgpt,
|
||||
grok,
|
||||
deepseek,
|
||||
|
||||
@@ -170,7 +170,7 @@ export const initializeToken = async () => {
|
||||
* Initialize theme
|
||||
*/
|
||||
export const initializeTheme = async () => {
|
||||
const theme = getCookie('THEME') || 'light';
|
||||
const theme = getCookie('THEME') || 'dark';
|
||||
console.debug('initialize theme', theme);
|
||||
applyTheme(theme);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user