Refactor: Refine navigation (#214)
This commit is contained in:
1 parent
f000fc2233
commit
9d014e21d2
24 files changed
+300
-195
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"type": "major",
|
||||||
|
"comment": "refactor navigator ",
|
||||||
|
"packageName": "@acedatacloud/nexior",
|
||||||
|
"email": "cqc@cuiqingcai.com",
|
||||||
|
"dependentChangeType": "patch"
|
||||||
|
}
|
||||||
@@ -56,5 +56,5 @@ pre button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body hr {
|
.markdown-body hr {
|
||||||
height: 1px;
|
height: 1px !important;
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="selector">
|
<div class="selector">
|
||||||
<el-dropdown trigger="click" popper-class="popper">
|
<el-dropdown v-show="false" trigger="click" popper-class="popper">
|
||||||
<div class="flex justify-center mr-1">
|
<div class="flex justify-center mr-1">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<img :src="modelGroup.icon" />
|
<img :src="modelGroup.icon" />
|
||||||
@@ -79,34 +79,31 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
modelGroup() {
|
|
||||||
console.log('modelGroup', this.$store.state.chat.modelGroup);
|
|
||||||
return this.$store.state.chat.modelGroup;
|
|
||||||
},
|
|
||||||
model() {
|
model() {
|
||||||
console.log('model', this.$store.state.chat.model);
|
console.log('model', this.$store.state.chat.model);
|
||||||
return this.$store.state.chat.model;
|
return this.$store.state.chat.model;
|
||||||
|
},
|
||||||
|
modelGroup(): IChatModelGroup {
|
||||||
|
return (this.$route.meta?.modelGroup as IChatModelGroup) || CHAT_MODEL_GROUP_CHATGPT;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// set first model when modelGroup changes
|
// set first model when modelGroup changes
|
||||||
modelGroup(newValue: IChatModelGroup) {
|
modelGroup(newValue: IChatModelGroup) {
|
||||||
console.debug('ModelSelector modelGroup changed', newValue);
|
console.debug('modelGroup from route changed', newValue);
|
||||||
|
this.$store.dispatch('chat/setModelGroup', newValue);
|
||||||
this.$store.dispatch('chat/setModel', newValue.models[0]);
|
this.$store.dispatch('chat/setModel', newValue.models[0]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (!this.modelGroup) {
|
// renew models if modelGroup is already set
|
||||||
console.debug('ModelSelector mounted, setting default model group');
|
console.debug('ModelSelector mounted, checking model group');
|
||||||
this.$store.dispatch('chat/setModelGroup', CHAT_MODEL_GROUP_CHATGPT);
|
const modelGroups = [CHAT_MODEL_GROUP_CHATGPT, CHAT_MODEL_GROUP_DEEPSEEK, CHAT_MODEL_GROUP_GROK];
|
||||||
} else {
|
const foundGroup = modelGroups.find((group) => group.name === this.modelGroup.name);
|
||||||
// renew models if modelGroup is already set
|
console.debug('Found model group:', foundGroup);
|
||||||
console.debug('ModelSelector mounted, checking model group');
|
if (foundGroup) {
|
||||||
const modelGroups = [CHAT_MODEL_GROUP_CHATGPT, CHAT_MODEL_GROUP_DEEPSEEK, CHAT_MODEL_GROUP_GROK];
|
this.$store.dispatch('chat/setModelGroup', foundGroup);
|
||||||
const foundGroup = modelGroups.find((group) => group.name === this.modelGroup.name);
|
this.$store.dispatch('chat/setModel', foundGroup.models[0]);
|
||||||
if (foundGroup) {
|
|
||||||
this.$store.dispatch('chat/setModelGroup', foundGroup);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -74,7 +74,6 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElSkeleton, ElInput } from 'element-plus';
|
import { ElSkeleton, ElInput } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from '@/router/constants';
|
|
||||||
import { chatOperator } from '@/operators';
|
import { chatOperator } from '@/operators';
|
||||||
import { IChatConversation } from '@/models';
|
import { IChatConversation } from '@/models';
|
||||||
import { Status } from '@/models';
|
import { Status } from '@/models';
|
||||||
@@ -89,12 +88,23 @@ export default defineComponent({
|
|||||||
props: {},
|
props: {},
|
||||||
emits: ['change-conversation'],
|
emits: ['change-conversation'],
|
||||||
computed: {
|
computed: {
|
||||||
|
modelGroup() {
|
||||||
|
return this.$store.state.chat.modelGroup;
|
||||||
|
},
|
||||||
conversationId() {
|
conversationId() {
|
||||||
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() {
|
conversationGroups() {
|
||||||
const conversations = this.$store.state.chat.conversations;
|
let conversations = this.$store.state.chat.conversations;
|
||||||
|
console.debug('conversations', conversations);
|
||||||
|
console.debug('modelGroup', this.modelGroup);
|
||||||
|
// filter by model group
|
||||||
|
conversations = conversations?.filter(
|
||||||
|
(conversation: IChatConversation) =>
|
||||||
|
conversation.model && this.modelGroup.models?.map((item) => item.name as string)?.includes(conversation.model)
|
||||||
|
);
|
||||||
|
console.debug('filtered conversations', conversations);
|
||||||
// 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) {
|
// if (conversations) {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
@@ -107,7 +117,7 @@ export default defineComponent({
|
|||||||
earlier.setDate(earlier.getDate() - 7);
|
earlier.setDate(earlier.getDate() - 7);
|
||||||
const groups = conversations?.reduce(
|
const groups = 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) {
|
||||||
(acc.today as IChatConversation[]).push(conversation);
|
(acc.today as IChatConversation[]).push(conversation);
|
||||||
} else if (updatedAt >= yesterday) {
|
} else if (updatedAt >= yesterday) {
|
||||||
@@ -123,15 +133,15 @@ export default defineComponent({
|
|||||||
) as Record<string, IChatConversation[]>;
|
) as Record<string, IChatConversation[]>;
|
||||||
// sort every group by `updated_at` field.
|
// sort every group by `updated_at` field.
|
||||||
return {
|
return {
|
||||||
...(groups?.today?.length > 0 ? { today: groups?.today?.sort((a, b) => b.updated_at - a.updated_at) } : {}),
|
...(groups?.today?.length > 0 ? { today: groups?.today?.sort((a, b) => b.updated_at! - a.updated_at!) } : {}),
|
||||||
...(groups?.yesterday?.length > 0
|
...(groups?.yesterday?.length > 0
|
||||||
? { yesterday: groups?.yesterday?.sort((a, b) => b.updated_at - a.updated_at) }
|
? { yesterday: groups?.yesterday?.sort((a, b) => b.updated_at! - a.updated_at!) }
|
||||||
: {}),
|
: {}),
|
||||||
...(groups?.thisWeek?.length > 0
|
...(groups?.thisWeek?.length > 0
|
||||||
? { thisWeek: groups?.thisWeek?.sort((a, b) => b.updated_at - a.updated_at) }
|
? { thisWeek: groups?.thisWeek?.sort((a, b) => b.updated_at! - a.updated_at!) }
|
||||||
: {}),
|
: {}),
|
||||||
...(groups?.earlier?.length > 0
|
...(groups?.earlier?.length > 0
|
||||||
? { earlier: groups?.earlier?.sort((a, b) => b.updated_at - a.updated_at) }
|
? { earlier: groups?.earlier?.sort((a, b) => b.updated_at! - a.updated_at!) }
|
||||||
: {})
|
: {})
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
+108
-116
@@ -10,26 +10,19 @@
|
|||||||
:class="{link: true, active: link.routes.includes($route.name as string)}"
|
:class="{link: true, active: link.routes.includes($route.name as string)}"
|
||||||
>
|
>
|
||||||
<el-tooltip v-if="direction === 'column'" effect="dark" :content="link.displayName" placement="right">
|
<el-tooltip v-if="direction === 'column'" effect="dark" :content="link.displayName" placement="right">
|
||||||
<el-button
|
<el-image v-if="link.logo" :src="link.logo" class="avatar" @click="$router.push(link.route)" />
|
||||||
:class="{button: true, active: link.routes.includes($route.name as string)}"
|
|
||||||
@click="$router.push(link.route)"
|
|
||||||
>
|
|
||||||
<font-awesome-icon :icon="link.icon" />
|
|
||||||
</el-button>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<div v-else class="cursor-pointer" @click="$router.push(link.route)">
|
|
||||||
<font-awesome-icon :icon="link.icon" />
|
|
||||||
<p class="description">{{ link.displayName }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="bottom">
|
||||||
|
<user-center />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElButton, ElTooltip } from 'element-plus';
|
import { ElTooltip, ElImage } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
||||||
import {
|
import {
|
||||||
ROUTE_CHAT_CONVERSATION,
|
ROUTE_CHAT_CONVERSATION,
|
||||||
ROUTE_CHAT_CONVERSATION_NEW,
|
ROUTE_CHAT_CONVERSATION_NEW,
|
||||||
@@ -38,8 +31,6 @@ import {
|
|||||||
ROUTE_DISTRIBUTION_INDEX,
|
ROUTE_DISTRIBUTION_INDEX,
|
||||||
ROUTE_INDEX,
|
ROUTE_INDEX,
|
||||||
ROUTE_MIDJOURNEY_INDEX,
|
ROUTE_MIDJOURNEY_INDEX,
|
||||||
ROUTE_QRART_INDEX,
|
|
||||||
ROUTE_QRART_HISTORY,
|
|
||||||
ROUTE_LUMA_INDEX,
|
ROUTE_LUMA_INDEX,
|
||||||
ROUTE_LUMA_HISTORY,
|
ROUTE_LUMA_HISTORY,
|
||||||
ROUTE_PIKA_INDEX,
|
ROUTE_PIKA_INDEX,
|
||||||
@@ -50,18 +41,24 @@ import {
|
|||||||
ROUTE_HEADSHOTS_HISTORY,
|
ROUTE_HEADSHOTS_HISTORY,
|
||||||
ROUTE_SUNO_INDEX,
|
ROUTE_SUNO_INDEX,
|
||||||
ROUTE_SUNO_HISTORY,
|
ROUTE_SUNO_HISTORY,
|
||||||
ROUTE_SITE_INDEX
|
ROUTE_FLUX_INDEX,
|
||||||
|
ROUTE_CHATGPT_CONVERSATION_NEW,
|
||||||
|
ROUTE_CHATGPT_CONVERSATION,
|
||||||
|
ROUTE_DEEPSEEK_CONVERSATION_NEW,
|
||||||
|
ROUTE_DEEPSEEK_CONVERSATION,
|
||||||
|
ROUTE_GROK_CONVERSATION_NEW,
|
||||||
|
ROUTE_GROK_CONVERSATION
|
||||||
} from '@/router/constants';
|
} from '@/router/constants';
|
||||||
import LogoTiny from './LogoTiny.vue';
|
import LogoTiny from './LogoTiny.vue';
|
||||||
import HelpEntry from '@/components/common/HelpEntry.vue';
|
import UserCenter from '@/components/user/Center.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Navigator',
|
name: 'Navigator',
|
||||||
components: {
|
components: {
|
||||||
ElButton,
|
ElImage,
|
||||||
LogoTiny,
|
LogoTiny,
|
||||||
ElTooltip,
|
ElTooltip,
|
||||||
FontAwesomeIcon
|
UserCenter
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
direction: {
|
direction: {
|
||||||
@@ -81,15 +78,37 @@ export default defineComponent({
|
|||||||
computed: {
|
computed: {
|
||||||
links() {
|
links() {
|
||||||
const result = [];
|
const result = [];
|
||||||
// Add chat's leftmost icon
|
// Add chatgpt's leftmost icon
|
||||||
if (this.$store?.state?.site?.features?.chat?.enabled) {
|
if (this.$store?.state?.site?.features?.chatgpt?.enabled) {
|
||||||
result.push({
|
result.push({
|
||||||
route: {
|
route: {
|
||||||
name: ROUTE_CHAT_CONVERSATION_NEW
|
name: ROUTE_CHATGPT_CONVERSATION_NEW
|
||||||
},
|
},
|
||||||
displayName: this.$t('common.nav.chat'),
|
displayName: this.$t('common.nav.chatgpt'),
|
||||||
icon: 'fa-regular fa-comment',
|
logo: 'https://cdn.acedata.cloud/7dljuv.png',
|
||||||
routes: [ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW]
|
routes: [ROUTE_CHATGPT_CONVERSATION, ROUTE_CHATGPT_CONVERSATION_NEW]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Add deepseek's leftmost icon
|
||||||
|
if (this.$store?.state?.site?.features?.deepseek?.enabled) {
|
||||||
|
result.push({
|
||||||
|
route: {
|
||||||
|
name: ROUTE_DEEPSEEK_CONVERSATION_NEW
|
||||||
|
},
|
||||||
|
displayName: this.$t('common.nav.deepseek'),
|
||||||
|
logo: 'https://cdn.acedata.cloud/bc71ae.png',
|
||||||
|
routes: [ROUTE_DEEPSEEK_CONVERSATION, ROUTE_DEEPSEEK_CONVERSATION_NEW]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Add grok's leftmost icon
|
||||||
|
if (this.$store?.state?.site?.features?.grok?.enabled) {
|
||||||
|
result.push({
|
||||||
|
route: {
|
||||||
|
name: ROUTE_GROK_CONVERSATION_NEW
|
||||||
|
},
|
||||||
|
displayName: this.$t('common.nav.grok'),
|
||||||
|
logo: 'https://cdn.acedata.cloud/p1ge98.png',
|
||||||
|
routes: [ROUTE_GROK_CONVERSATION, ROUTE_GROK_CONVERSATION_NEW]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Add midjourney's leftmost icon
|
// Add midjourney's leftmost icon
|
||||||
@@ -98,70 +117,76 @@ export default defineComponent({
|
|||||||
route: {
|
route: {
|
||||||
name: ROUTE_MIDJOURNEY_INDEX
|
name: ROUTE_MIDJOURNEY_INDEX
|
||||||
},
|
},
|
||||||
displayName: this.$t('common.nav.image'),
|
displayName: this.$t('common.nav.midjourney'),
|
||||||
icon: 'fa-solid fa-palette',
|
logo: 'https://cdn.acedata.cloud/wto43b.png',
|
||||||
routes: [ROUTE_MIDJOURNEY_INDEX]
|
routes: [ROUTE_MIDJOURNEY_INDEX]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Add chatdoc's leftmost icon
|
// Add flux's leftmost icon
|
||||||
/*
|
if (this.$store?.state?.site?.features?.flux?.enabled) {
|
||||||
if (this.$store?.state?.site?.features?.chatdoc?.enabled) {
|
|
||||||
result.push({
|
result.push({
|
||||||
route: {
|
route: {
|
||||||
name: ROUTE_CHATDOC_INDEX
|
name: ROUTE_FLUX_INDEX
|
||||||
},
|
},
|
||||||
displayName: this.$t('common.nav.chatdoc'),
|
displayName: this.$t('common.nav.flux'),
|
||||||
icon: 'fa-solid fa-file-lines',
|
logo: 'https://cdn.acedata.cloud/ogm2oa.png',
|
||||||
routes: [ROUTE_CHATDOC_INDEX, ROUTE_CHATDOC_CONVERSATION, ROUTE_CHATDOC_MANAGE, ROUTE_CHATDOC_SETTING]
|
routes: [ROUTE_FLUX_INDEX]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
// Add qrart's leftmost icon
|
// Add qrart's leftmost icon
|
||||||
if (this.$store?.state?.site?.features?.qrart?.enabled) {
|
// if (this.$store?.state?.site?.features?.qrart?.enabled) {
|
||||||
result.push({
|
// result.push({
|
||||||
route: {
|
// route: {
|
||||||
name: ROUTE_QRART_INDEX
|
// name: ROUTE_QRART_INDEX
|
||||||
},
|
// },
|
||||||
displayName: this.$t('common.nav.qrart'),
|
// displayName: this.$t('common.nav.qrart'),
|
||||||
icon: 'fa-solid fa-qrcode',
|
// icon: 'fa-solid fa-qrcode',
|
||||||
routes: [ROUTE_QRART_INDEX, ROUTE_QRART_HISTORY]
|
// routes: [ROUTE_QRART_INDEX, ROUTE_QRART_HISTORY]
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
// Add suno's leftmost icon
|
// Add suno's leftmost icon
|
||||||
if (this.$store?.state?.site?.features?.suno?.enabled) {
|
if (this.$store?.state?.site?.features?.suno?.enabled) {
|
||||||
result.push({
|
result.push({
|
||||||
route: {
|
route: {
|
||||||
name: ROUTE_SUNO_INDEX
|
name: ROUTE_SUNO_INDEX
|
||||||
},
|
},
|
||||||
displayName: this.$t('common.nav.music'),
|
displayName: this.$t('common.nav.suno'),
|
||||||
icon: 'fa-solid fa-music',
|
logo: 'https://cdn.acedata.cloud/l3ffw7.jpg',
|
||||||
routes: [ROUTE_SUNO_INDEX, ROUTE_SUNO_HISTORY]
|
routes: [ROUTE_SUNO_INDEX, ROUTE_SUNO_HISTORY]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Add luma, pika, hailuo's leftmost icon
|
// Add luma's leftmost icon
|
||||||
if (
|
if (this.$store?.state?.site?.features?.luma?.enabled) {
|
||||||
this.$store?.state?.site?.features?.luma?.enabled ||
|
|
||||||
this.$store?.state?.site?.features?.pika?.enabled ||
|
|
||||||
this.$store?.state?.site?.features?.hailuo?.enabled
|
|
||||||
) {
|
|
||||||
result.push({
|
result.push({
|
||||||
route: {
|
route: {
|
||||||
name: this.$store?.state?.site?.features?.luma?.enabled
|
name: ROUTE_LUMA_INDEX
|
||||||
? ROUTE_LUMA_INDEX
|
|
||||||
: this.$store?.state?.site?.features?.pika?.enabled
|
|
||||||
? ROUTE_PIKA_INDEX
|
|
||||||
: ROUTE_HAILUO_INDEX
|
|
||||||
},
|
},
|
||||||
displayName: this.$t('common.nav.video'),
|
displayName: this.$t('common.nav.luma'),
|
||||||
|
logo: 'https://cdn.acedata.cloud/ahjfwi.png',
|
||||||
|
routes: [ROUTE_LUMA_INDEX, ROUTE_LUMA_HISTORY]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Add pika's leftmost icon
|
||||||
|
if (this.$store?.state?.site?.features?.pika?.enabled) {
|
||||||
|
result.push({
|
||||||
|
route: {
|
||||||
|
name: ROUTE_PIKA_INDEX
|
||||||
|
},
|
||||||
|
displayName: this.$t('common.nav.pika'),
|
||||||
|
logo: 'https://cdn.acedata.cloud/i80tgn.png',
|
||||||
|
routes: [ROUTE_PIKA_INDEX, ROUTE_PIKA_HISTORY]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Add hailuo's leftmost icon
|
||||||
|
if (this.$store?.state?.site?.features?.hailuo?.enabled) {
|
||||||
|
result.push({
|
||||||
|
route: {
|
||||||
|
name: ROUTE_HAILUO_INDEX
|
||||||
|
},
|
||||||
|
displayName: this.$t('common.nav.hailuo'),
|
||||||
icon: 'fa-solid fa-film',
|
icon: 'fa-solid fa-film',
|
||||||
routes: [
|
logo: 'https://cdn.acedata.cloud/4tfwwz.png',
|
||||||
ROUTE_LUMA_INDEX,
|
routes: [ROUTE_HAILUO_INDEX, ROUTE_HAILUO_HISTORY]
|
||||||
ROUTE_LUMA_HISTORY,
|
|
||||||
ROUTE_PIKA_INDEX,
|
|
||||||
ROUTE_PIKA_HISTORY,
|
|
||||||
ROUTE_HAILUO_INDEX,
|
|
||||||
ROUTE_HAILUO_HISTORY
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Add headshots's leftmost icon
|
// Add headshots's leftmost icon
|
||||||
@@ -175,7 +200,6 @@ export default defineComponent({
|
|||||||
routes: [ROUTE_HEADSHOTS_INDEX, ROUTE_HEADSHOTS_HISTORY]
|
routes: [ROUTE_HEADSHOTS_INDEX, ROUTE_HEADSHOTS_HISTORY]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.direction === 'row') {
|
if (this.direction === 'row') {
|
||||||
result.push({
|
result.push({
|
||||||
route: {
|
route: {
|
||||||
@@ -190,24 +214,6 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
authenticated() {
|
authenticated() {
|
||||||
return !!this.$store.state.token.access;
|
return !!this.$store.state.token.access;
|
||||||
},
|
|
||||||
showSite() {
|
|
||||||
return this.$store?.state?.site?.admins?.includes(this.$store.getters.user?.id);
|
|
||||||
},
|
|
||||||
showSupport() {
|
|
||||||
return (
|
|
||||||
this.$store?.state?.site?.features?.support?.enabled &&
|
|
||||||
(this.$store?.state?.site?.features?.support?.discord?.enabled ||
|
|
||||||
this.$store?.state?.site?.features?.support?.wechat?.enabled)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
showDistribution() {
|
|
||||||
return (
|
|
||||||
// if forcedInviterId is set, only the forced inviter can see the distribution menu
|
|
||||||
// if forcedInviterId is not set, everyone can see the distribution menu
|
|
||||||
!this.$store?.state?.site?.distribution?.force_inviter_id ||
|
|
||||||
this.$store.getters.user?.id === this.$store?.state?.site?.distribution?.force_inviter_id
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -215,22 +221,6 @@ export default defineComponent({
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: ROUTE_INDEX
|
name: ROUTE_INDEX
|
||||||
});
|
});
|
||||||
},
|
|
||||||
onSite() {
|
|
||||||
this.$router.push({
|
|
||||||
name: ROUTE_SITE_INDEX
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onDistribution() {
|
|
||||||
this.$router.push({
|
|
||||||
name: ROUTE_DISTRIBUTION_INDEX
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async onLogout() {
|
|
||||||
await this.$store.dispatch('logout');
|
|
||||||
},
|
|
||||||
onConsole() {
|
|
||||||
this.$router.push({ name: ROUTE_CONSOLE_ROOT });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -241,6 +231,7 @@ export default defineComponent({
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&[direction='row'] {
|
&[direction='row'] {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
@@ -316,28 +307,29 @@ export default defineComponent({
|
|||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
min-width: 60px;
|
min-width: 60px;
|
||||||
.link {
|
.link {
|
||||||
width: 40px;
|
width: 100%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin: 0 10px 10px 10px;
|
margin-bottom: 10px;
|
||||||
.button {
|
.avatar {
|
||||||
width: 40px;
|
display: block;
|
||||||
height: 40px;
|
margin: auto;
|
||||||
border-radius: 10px;
|
width: 35px;
|
||||||
border: none;
|
height: 35px;
|
||||||
color: var(--el-text-color-primary);
|
border-radius: 50%;
|
||||||
background-color: var(--el-bg-color-page);
|
cursor: pointer;
|
||||||
&.active,
|
border: 1px solid var(--el-border-color);
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
color: var(--el-button-active-text-color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.bottom {
|
.bottom {
|
||||||
display: block;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<el-form :model="site" class="form" label-width="auto" style="max-width: 600px">
|
<el-form :model="site" class="form" label-width="auto" style="max-width: 600px">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-for="(feature, featureIndex) in [
|
v-for="(feature, featureIndex) in [
|
||||||
'chat',
|
'chatgpt',
|
||||||
|
'grok',
|
||||||
|
'deepseek',
|
||||||
'midjourney',
|
'midjourney',
|
||||||
'qrart',
|
'qrart',
|
||||||
'suno',
|
'suno',
|
||||||
@@ -11,8 +13,7 @@
|
|||||||
'kling',
|
'kling',
|
||||||
'flux',
|
'flux',
|
||||||
'hailuo',
|
'hailuo',
|
||||||
'headshots',
|
'headshots'
|
||||||
'support'
|
|
||||||
]"
|
]"
|
||||||
:key="featureIndex"
|
:key="featureIndex"
|
||||||
:label="$t('site.field.features' + feature.charAt(0).toUpperCase() + feature.slice(1))"
|
:label="$t('site.field.features' + feature.charAt(0).toUpperCase() + feature.slice(1))"
|
||||||
|
|||||||
@@ -23,8 +23,10 @@ export default defineComponent({
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.avatar {
|
.avatar {
|
||||||
width: 30px;
|
width: 35px;
|
||||||
height: 30px;
|
height: 35px;
|
||||||
|
max-width: initial;
|
||||||
|
max-height: initial;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<user-setting v-model:visible="showSetting" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<user-setting v-model:visible="showSetting" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -291,6 +291,18 @@
|
|||||||
"message": "控制台",
|
"message": "控制台",
|
||||||
"description": "网站导航栏中的文本,用于显示控制台页面"
|
"description": "网站导航栏中的文本,用于显示控制台页面"
|
||||||
},
|
},
|
||||||
|
"nav.chatgpt": {
|
||||||
|
"message": "ChatGPT",
|
||||||
|
"description": "网站导航栏中的文本,用于显示ChatGPT页面,请不要翻译此字段,必须保持为'ChatGPT'"
|
||||||
|
},
|
||||||
|
"nav.deepseek": {
|
||||||
|
"message": "Deepspeak",
|
||||||
|
"description": "网站导航栏中的文本,用于显示Deepspeak页面,请不要翻译此字段,必须保持为'Deepspeak'"
|
||||||
|
},
|
||||||
|
"nav.grok": {
|
||||||
|
"message": "Grok",
|
||||||
|
"description": "网站导航栏中的文本,用于显示Grok页面,请不要翻译此字段,必须保持为'Grok'"
|
||||||
|
},
|
||||||
"nav.chat": {
|
"nav.chat": {
|
||||||
"message": "Chat",
|
"message": "Chat",
|
||||||
"description": "网站导航栏中的文本,用于显示聊天页面,请不要翻译此字段,必须保持为'Chat'"
|
"description": "网站导航栏中的文本,用于显示聊天页面,请不要翻译此字段,必须保持为'Chat'"
|
||||||
|
|||||||
@@ -47,6 +47,18 @@
|
|||||||
"message": "Chat",
|
"message": "Chat",
|
||||||
"description": "展示在编辑框的标题"
|
"description": "展示在编辑框的标题"
|
||||||
},
|
},
|
||||||
|
"field.featuresGrok": {
|
||||||
|
"message": "Grok",
|
||||||
|
"description": "展示在编辑框的标题"
|
||||||
|
},
|
||||||
|
"field.featuresDeepseek": {
|
||||||
|
"message": "Deepseek",
|
||||||
|
"description": "展示在编辑框的标题"
|
||||||
|
},
|
||||||
|
"field.featuresChatgpt": {
|
||||||
|
"message": "ChatGPT",
|
||||||
|
"description": "展示在编辑框的标题"
|
||||||
|
},
|
||||||
"field.featuresMidjourney": {
|
"field.featuresMidjourney": {
|
||||||
"message": "Midjourney",
|
"message": "Midjourney",
|
||||||
"description": "展示在编辑框的标题"
|
"description": "展示在编辑框的标题"
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
<div class="chat">
|
<div class="chat">
|
||||||
<slot name="chat" />
|
<slot name="chat" />
|
||||||
</div>
|
</div>
|
||||||
<user-center class="absolute right-2 top-2" />
|
|
||||||
<el-button round class="menu" @click="drawer = true">
|
<el-button round class="menu" @click="drawer = true">
|
||||||
<font-awesome-icon icon="fa-solid fa-bars" class="icon-menu" />
|
<font-awesome-icon icon="fa-solid fa-bars" class="icon-menu" />
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -20,18 +19,15 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import UserCenter from '@/components/user/Center.vue';
|
|
||||||
import SidePanel from '@/components/chat/SidePanel.vue';
|
import SidePanel from '@/components/chat/SidePanel.vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import { on } from 'events';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutChat',
|
name: 'LayoutChat',
|
||||||
components: {
|
components: {
|
||||||
SidePanel,
|
SidePanel,
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
UserCenter,
|
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon
|
FontAwesomeIcon
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="config">
|
<div class="config">
|
||||||
<image-navigator />
|
|
||||||
<slot name="config" />
|
<slot name="config" />
|
||||||
</div>
|
</div>
|
||||||
<div class="result">
|
<div class="result">
|
||||||
@@ -20,15 +19,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import ImageNavigator from '@/components/common/ImageNavigator.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutFlux',
|
name: 'LayoutFlux',
|
||||||
components: {
|
components: {
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon
|
||||||
ImageNavigator
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="config">
|
<div class="config">
|
||||||
<video-navigator />
|
|
||||||
<slot name="config" />
|
<slot name="config" />
|
||||||
</div>
|
</div>
|
||||||
<div class="result">
|
<div class="result">
|
||||||
@@ -20,15 +19,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import VideoNavigator from '@/components/common/VideoNavigator.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutHailuo',
|
name: 'LayoutHailuo',
|
||||||
components: {
|
components: {
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon
|
||||||
VideoNavigator
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="config">
|
<div class="config">
|
||||||
<video-navigator />
|
|
||||||
<slot name="config" />
|
<slot name="config" />
|
||||||
</div>
|
</div>
|
||||||
<div class="result">
|
<div class="result">
|
||||||
@@ -20,15 +19,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import VideoNavigator from '@/components/common/VideoNavigator.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutKling',
|
name: 'LayoutKling',
|
||||||
components: {
|
components: {
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon
|
||||||
VideoNavigator
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="config">
|
<div class="config">
|
||||||
<video-navigator />
|
|
||||||
<slot name="config" />
|
<slot name="config" />
|
||||||
</div>
|
</div>
|
||||||
<div class="result">
|
<div class="result">
|
||||||
@@ -20,15 +19,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import VideoNavigator from '@/components/common/VideoNavigator.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutLuma',
|
name: 'LayoutLuma',
|
||||||
components: {
|
components: {
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon
|
||||||
VideoNavigator
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="presets">
|
<div class="presets">
|
||||||
<image-navigator />
|
|
||||||
<slot name="presets" />
|
<slot name="presets" />
|
||||||
</div>
|
</div>
|
||||||
<div class="operation">
|
<div class="operation">
|
||||||
@@ -20,15 +19,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import ImageNavigator from '@/components/common/ImageNavigator.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutMidjourney',
|
name: 'LayoutMidjourney',
|
||||||
components: {
|
components: {
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon
|
||||||
ImageNavigator
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="config">
|
<div class="config">
|
||||||
<video-navigator />
|
|
||||||
<slot name="config" />
|
<slot name="config" />
|
||||||
</div>
|
</div>
|
||||||
<div class="result">
|
<div class="result">
|
||||||
@@ -20,15 +19,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElDrawer, ElButton } from 'element-plus';
|
import { ElDrawer, ElButton } from 'element-plus';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
import VideoNavigator from '@/components/common/VideoNavigator.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutPika',
|
name: 'LayoutPika',
|
||||||
components: {
|
components: {
|
||||||
ElDrawer,
|
ElDrawer,
|
||||||
ElButton,
|
ElButton,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon
|
||||||
VideoNavigator
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
+4
-1
@@ -1,7 +1,10 @@
|
|||||||
export interface ISiteFeatures {
|
export interface ISiteFeatures {
|
||||||
chat?: any;
|
chatgpt?: any;
|
||||||
|
deepseek?: any;
|
||||||
|
grok?: any;
|
||||||
midjourney?: any;
|
midjourney?: any;
|
||||||
chatdoc?: any;
|
chatdoc?: any;
|
||||||
|
flux?: any;
|
||||||
qrart?: any;
|
qrart?: any;
|
||||||
luma?: any;
|
luma?: any;
|
||||||
pika?: any;
|
pika?: any;
|
||||||
|
|||||||
@@ -35,14 +35,13 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { defineComponent, ref } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import Message from '@/components/chat/Message.vue';
|
import Message from '@/components/chat/Message.vue';
|
||||||
import { CHAT_MODEL_GROUPS, CHAT_MODELS, ROLE_ASSISTANT, ROLE_USER } from '@/constants';
|
import { CHAT_MODEL_GROUPS, CHAT_MODELS, ROLE_ASSISTANT, ROLE_USER } from '@/constants';
|
||||||
import { IChatMessageState, IChatConversationResponse, IChatConversation, IChatMessage, BaseError } from '@/models';
|
import { IChatMessageState, IChatConversationResponse, IChatConversation, IChatMessage, BaseError } from '@/models';
|
||||||
import Composer from '@/components/chat/Composer.vue';
|
import Composer from '@/components/chat/Composer.vue';
|
||||||
import ModelSelector from '@/components/chat/ModelSelector.vue';
|
import ModelSelector from '@/components/chat/ModelSelector.vue';
|
||||||
import { ERROR_CODE_CANCELED, ERROR_CODE_NOT_APPLIED, ERROR_CODE_UNKNOWN } from '@/constants/errorCode';
|
import { ERROR_CODE_CANCELED, ERROR_CODE_NOT_APPLIED, ERROR_CODE_UNKNOWN } from '@/constants/errorCode';
|
||||||
import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from '@/router';
|
|
||||||
import { Status } from '@/models';
|
import { Status } from '@/models';
|
||||||
import Disclaimer from '@/components/chat/Disclaimer.vue';
|
import Disclaimer from '@/components/chat/Disclaimer.vue';
|
||||||
import Layout from '@/layouts/Chat.vue';
|
import Layout from '@/layouts/Chat.vue';
|
||||||
@@ -296,19 +295,20 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
async onNewConversation() {
|
async onNewConversation() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: ROUTE_CHAT_CONVERSATION_NEW
|
params: {
|
||||||
|
id: ''
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.messages = [];
|
this.messages = [];
|
||||||
this.question = '';
|
this.question = '';
|
||||||
this.references = [];
|
this.references = [];
|
||||||
},
|
},
|
||||||
async onRestoreConversation(id: string) {
|
async onRestoreConversation(id: string) {
|
||||||
this.$router.push({
|
console.debug('onRestoreConversation id', id);
|
||||||
name: ROUTE_CHAT_CONVERSATION,
|
console.debug('onRestoreConversation route', this.$route);
|
||||||
params: {
|
const newRoute = this.$router.resolve({ path: this.$route.path, params: { id } });
|
||||||
id
|
console.debug('onRestoreConversation newRoute', newRoute);
|
||||||
}
|
this.$router.push(newRoute);
|
||||||
});
|
|
||||||
const conversation = this.conversations?.find((conversation: IChatConversation) => conversation.id === id);
|
const conversation = this.conversations?.find((conversation: IChatConversation) => conversation.id === id);
|
||||||
// change the model and model group
|
// change the model and model group
|
||||||
const model = conversation?.model;
|
const model = conversation?.model;
|
||||||
@@ -432,7 +432,6 @@ export default defineComponent({
|
|||||||
this.answering = false;
|
this.answering = false;
|
||||||
if (conversationId) {
|
if (conversationId) {
|
||||||
await this.$router.push({
|
await this.$router.push({
|
||||||
name: ROUTE_CHAT_CONVERSATION,
|
|
||||||
params: {
|
params: {
|
||||||
id: conversationId
|
id: conversationId
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { CHAT_MODEL_GROUP_CHATGPT } from '@/constants';
|
||||||
|
import { ROUTE_CHATGPT_CONVERSATION, ROUTE_CHATGPT_CONVERSATION_NEW } from './constants';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/chatgpt',
|
||||||
|
meta: {
|
||||||
|
modelGroup: CHAT_MODEL_GROUP_CHATGPT
|
||||||
|
},
|
||||||
|
component: () => import('@/layouts/Main.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirect: {
|
||||||
|
name: ROUTE_CHATGPT_CONVERSATION_NEW
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'conversations',
|
||||||
|
name: ROUTE_CHATGPT_CONVERSATION_NEW,
|
||||||
|
component: () => import('@/pages/chat/Conversation.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'conversations/:id',
|
||||||
|
name: ROUTE_CHATGPT_CONVERSATION,
|
||||||
|
component: () => import('@/pages/chat/Conversation.vue')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
@@ -8,6 +8,15 @@ export const ROUTE_SITE_INDEX = 'site-index';
|
|||||||
export const ROUTE_CHAT_CONVERSATION = 'chat-conversation';
|
export const ROUTE_CHAT_CONVERSATION = 'chat-conversation';
|
||||||
export const ROUTE_CHAT_CONVERSATION_NEW = 'chat-conversation-new';
|
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';
|
||||||
|
|
||||||
|
export const ROUTE_DEEPSEEK_CONVERSATION = 'deepseek-conversation';
|
||||||
|
export const ROUTE_DEEPSEEK_CONVERSATION_NEW = 'deepseek-conversation-new';
|
||||||
|
|
||||||
|
export const ROUTE_GROK_CONVERSATION = 'grok-conversation';
|
||||||
|
export const ROUTE_GROK_CONVERSATION_NEW = 'grok-conversation-new';
|
||||||
|
|
||||||
export const ROUTE_MIDJOURNEY_INDEX = 'midjourney-index';
|
export const ROUTE_MIDJOURNEY_INDEX = 'midjourney-index';
|
||||||
|
|
||||||
export const ROUTE_QRART_INDEX = 'qrart-index';
|
export const ROUTE_QRART_INDEX = 'qrart-index';
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { CHAT_MODEL_GROUP_DEEPSEEK } from '@/constants';
|
||||||
|
import { ROUTE_DEEPSEEK_CONVERSATION, ROUTE_DEEPSEEK_CONVERSATION_NEW } from './constants';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/deepseek',
|
||||||
|
meta: {
|
||||||
|
modelGroup: CHAT_MODEL_GROUP_DEEPSEEK
|
||||||
|
},
|
||||||
|
component: () => import('@/layouts/Main.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirect: {
|
||||||
|
name: ROUTE_DEEPSEEK_CONVERSATION_NEW
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'conversations/:id',
|
||||||
|
name: ROUTE_DEEPSEEK_CONVERSATION,
|
||||||
|
component: () => import('@/pages/chat/Conversation.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'conversations',
|
||||||
|
name: ROUTE_DEEPSEEK_CONVERSATION_NEW,
|
||||||
|
component: () => import('@/pages/chat/Conversation.vue')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { CHAT_MODEL_GROUP_GROK } from '@/constants';
|
||||||
|
import { ROUTE_GROK_CONVERSATION, ROUTE_GROK_CONVERSATION_NEW } from './constants';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/grok',
|
||||||
|
meta: {
|
||||||
|
modelGroup: CHAT_MODEL_GROUP_GROK
|
||||||
|
},
|
||||||
|
component: () => import('@/layouts/Main.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirect: {
|
||||||
|
name: ROUTE_GROK_CONVERSATION_NEW
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'conversations',
|
||||||
|
name: ROUTE_GROK_CONVERSATION_NEW,
|
||||||
|
component: () => import('@/pages/chat/Conversation.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'conversations/:id',
|
||||||
|
name: ROUTE_GROK_CONVERSATION,
|
||||||
|
component: () => import('@/pages/chat/Conversation.vue')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
+8
-9
@@ -2,6 +2,9 @@ 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 chat from './chat';
|
||||||
|
import grok from './grok';
|
||||||
|
import deepseek from './deepseek';
|
||||||
|
import chatgpt from './chatgpt';
|
||||||
import midjourney from './midjourney';
|
import midjourney from './midjourney';
|
||||||
import distribution from './distribution';
|
import distribution from './distribution';
|
||||||
import chatdoc from './chatdoc';
|
import chatdoc from './chatdoc';
|
||||||
@@ -16,26 +19,22 @@ import suno from './suno';
|
|||||||
import site from './site';
|
import site from './site';
|
||||||
import profile from './profile';
|
import profile from './profile';
|
||||||
|
|
||||||
import { ROUTE_INDEX } from './constants';
|
import { ROUTE_CHATGPT_CONVERSATION_NEW } from './constants';
|
||||||
import { DEFAULT_LOCALE, setI18nLanguage } from '@/i18n';
|
import { DEFAULT_LOCALE, setI18nLanguage } from '@/i18n';
|
||||||
import { getCookie } from 'typescript-cookie';
|
import { getCookie } from 'typescript-cookie';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
component: () => import('@/layouts/Index.vue'),
|
redirect: { name: ROUTE_CHATGPT_CONVERSATION_NEW }
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
name: ROUTE_INDEX,
|
|
||||||
component: () => import('@/pages/index/Index.vue')
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
console,
|
console,
|
||||||
chatdoc,
|
chatdoc,
|
||||||
auth,
|
auth,
|
||||||
chat,
|
chat,
|
||||||
|
chatgpt,
|
||||||
|
grok,
|
||||||
|
deepseek,
|
||||||
qrart,
|
qrart,
|
||||||
luma,
|
luma,
|
||||||
pika,
|
pika,
|
||||||
|
|||||||
Reference in new issue
Block a user