Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/common/Setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const show = computed({
</div>
</NTabPane>

<NTabPane name="server" tab="server" v-if=" ! homeStore.myData.session.isHideServer">
<NTabPane name="server" tab="server">
<template #tab>
<SvgIcon class="text-lg" icon="mingcute:server-line" />
<span class="ml-2">{{ $t('mjset.server') }}</span>
Expand Down
20 changes: 11 additions & 9 deletions src/views/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const { usingContext, toggleUsingContext } = useUsingContext();

const { uuid } = route.params as { uuid: string };

const dataSources = computed(() => chatStore.getChatByUuid(+uuid));
const dataSources = computed(() => chatStore.getChatByUuid(+uuid) ?? []);
const conversationList = computed(() =>
dataSources.value.filter(
(item) => !item.inversion && !!item.conversationOptions
Expand All @@ -78,9 +78,11 @@ const promptStore = usePromptStore();
const { promptList: promptTemplate } = storeToRefs<any>(promptStore);

// 未知原因刷新页面,loading 状态不会重置,手动重置
dataSources.value.forEach((item, index) => {
if (item.loading) updateChatSome(+uuid, index, { loading: false });
});
if (dataSources.value) {
dataSources.value.forEach((item, index) => {
if (item.loading) updateChatSome(+uuid, index, { loading: false });
});
}

const userStore = useUserStore();

Expand Down Expand Up @@ -659,11 +661,11 @@ const ychat = computed(() => {
<Message
v-for="(item, index) of dataSources"
:key="index"
:date-time="item.dateTime"
:text="item.text"
:inversion="item.inversion"
:error="item.error"
:loading="item.loading"
:date-time="item?.dateTime ?? ''"
:text="item?.text ?? ''"
:inversion="item?.inversion ?? false"
:error="item?.error ?? false"
:loading="item?.loading ?? false"
@regenerate="onRegenerate(index)"
@delete="handleDelete(index)"
@edit="handleEdit(index)"
Expand Down
7 changes: 4 additions & 3 deletions src/views/mj/drawList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async function onConversation() {
addChat( +uuid, promptMsg );


}else if( message.action && ['gpt.dall-e-3','shorten'].indexOf(message.action) >-1 ){ //gpt.dall-e-3 //subTas
}else if( message.action && ['gpt.dall-e-3','shorten','gpt.seedream'].indexOf(message.action) >-1 ){ //gpt.dall-e-3 //subTas
let promptMsg: Chat.Chat= getInitChat( message.data.prompt );
mlog( 'gpt.dall-e-3' , message.data.fileBase64 );
if( message.data.fileBase64 && message.data.fileBase64.length>0 ){
Expand Down Expand Up @@ -148,17 +148,18 @@ async function onConversation() {

if (lastContext && usingContext.value)
options = { ...lastContext }
const isGptAction= message.action && message.action.indexOf('gpt.')==0
let outMsg: Chat.Chat={
dateTime: new Date().toLocaleString(),
text: message.action=='gpt.dall-e-3'? t('mjchat.wait3'): t('mjchat.submiting'),
text: isGptAction?( message.action=='gpt.dall-e-3'? t('mjchat.wait3'): t('mjchat.submiting')): t('mjchat.submiting'),
loading: true,
inversion: false,
error: false,
conversationOptions: null,
requestOptions: { prompt: t('mjchat.submiting'), options: { ...options } },
uuid:+uuid,
myid: `${Date.now()}`
,model:message.action=='gpt.dall-e-3'? message.data.model :'midjourney'
,model:isGptAction? (message.data?.model??'midjourney') :'midjourney'

}
//mlog('outMsg model',outMsg.model );
Expand Down