Skip to content

Commit 53dad67

Browse files
committed
1
1 parent 5661839 commit 53dad67

File tree

6 files changed

+38
-30
lines changed

6 files changed

+38
-30
lines changed

Diff for: .env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Glob API URL
22
VITE_GLOB_API_URL=/api
33

4-
VITE_APP_API_BASE_URL=http:///159.138.5.80:5610/
4+
VITE_APP_API_BASE_URL=http://159.138.5.80:5610/
55

66
# # Whether long replies are supported, which may result in higher API fees
77
# VITE_GLOB_OPEN_LONG_REPLY=false

Diff for: components.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ declare module 'vue' {
1313
ElButton: typeof import('element-plus/es')['ElButton']
1414
ElCarousel: typeof import('element-plus/es')['ElCarousel']
1515
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
16+
ElDialog: typeof import('element-plus/es')['ElDialog']
1617
ElIcon: typeof import('element-plus/es')['ElIcon']
1718
ElInput: typeof import('element-plus/es')['ElInput']
1819
ElOption: typeof import('element-plus/es')['ElOption']
1920
ElSelect: typeof import('element-plus/es')['ElSelect']
21+
ElTable: typeof import('element-plus/es')['ElTable']
22+
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
2023
ElTabPane: typeof import('element-plus/es')['ElTabPane']
2124
ElTabs: typeof import('element-plus/es')['ElTabs']
2225
ElTooltip: typeof import('element-plus/es')['ElTooltip']

Diff for: src/components/Bot/MessageBox.vue

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@ import { log } from 'console';
22
<script setup lang="ts">
33
import { ref } from "vue"
44
import { CompareItem } from "@/store"
5-
import BotBattle from "@/components/Bot/BotBattle.vue"
65
import { useChatStore } from "@/store"
76
87
const { bot } = defineProps<{ bot: CompareItem }>()
98
const chatStore = useChatStore()
109
chatStore.addChatSources(bot.name)
1110
const dataSources = chatStore.getChatByName(bot.name)
1211
console.log(dataSources)
13-
const modelA = ref<string>("")
14-
const activeName = ref("first")
15-
const showName = ref<boolean>(false)
16-
const handleClick = (tab: TabsPaneContext, event: Event) => {
17-
console.log(tab, event)
18-
}
1912
</script>
2013

2114
<template>
@@ -26,7 +19,9 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
2619
<div class="overflow-auto h-[560px]">
2720
<Message
2821
v-for="(item, index) of dataSources.chatList"
22+
:botName="bot.name"
2923
:key="index"
24+
:id="item.id"
3025
:date-time="item.dateTime"
3126
:text="item.text"
3227
:inversion="item.inversion"

Diff for: src/components/Message/index.vue

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
11
<script setup lang="ts">
22
import { computed, ref } from "vue"
33
import TextComponent from "./Text.vue"
4+
import { ChatLineRound } from "@element-plus/icons-vue"
45
56
interface Props {
67
dateTime?: string
78
text?: string
89
inversion?: boolean
910
error?: boolean
1011
loading?: boolean
12+
id?: string
13+
botName?: string
1114
}
1215
1316
interface Emit {
1417
(ev: "regenerate"): void
1518
(ev: "delete"): void
1619
}
1720
21+
const showDialog = ref(false)
1822
const props = defineProps<Props>()
19-
2023
const emit = defineEmits<Emit>()
21-
2224
const textRef = ref<HTMLElement>()
23-
2425
const asRawText = ref(props.inversion)
25-
2626
const messageRef = ref<HTMLElement>()
27-
28-
function handleRegenerate() {
29-
messageRef.value?.scrollIntoView()
30-
emit("regenerate")
31-
}
32-
33-
async function handleCopy() {
34-
try {
35-
// await copyToClip(props.text || '')
36-
} catch {}
27+
console.log(props.botName)
28+
const handleShowDialog = () => {
29+
console.log(props.botName)
30+
showDialog.value = true
3731
}
3832
</script>
3933

@@ -55,13 +49,24 @@ async function handleCopy() {
5549
:loading="loading"
5650
:as-raw-text="asRawText"
5751
/>
58-
<!-- <div class="flex flex-col">
59-
<button
60-
v-if="!inversion"
61-
class="mb-2 transition text-neutral-300 hover:text-neutral-800 dark:hover:text-neutral-300"
62-
@click="handleRegenerate"
63-
></button>
64-
</div> -->
52+
<div class="flex flex-col-reverse">
53+
<el-tooltip effect="dark" content="评论" placement="top">
54+
<button
55+
v-if="!inversion"
56+
class="mb-1 ml-2 p-0 border-0 bg-white text-[#b4bbc4] transition hover:text-[#1a73e8] hover:border-0 focus:outline-0"
57+
@click="handleShowDialog"
58+
>
59+
<ChatLineRound style="width: 16px; height: 16px" />
60+
</button>
61+
</el-tooltip>
62+
</div>
6563
</div>
6664
</div>
65+
<el-dialog v-model="showDialog">
66+
<template #header="{ titleId, titleClass }">
67+
<div class="my-header text-center">
68+
<h3 :id="titleId" :class="titleClass">评论</h3>
69+
</div>
70+
</template>
71+
</el-dialog>
6772
</template>

Diff for: src/store/modules/chat/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface Chat {
77
error?: boolean
88
loading?: boolean
99
conversationOptions?: null
10+
id?: string
1011
requestOptions: { prompt: string; options?: null }
1112
}
1213
export interface ChatSources {
@@ -42,11 +43,13 @@ export const useChatStore = defineStore("chat-store", {
4243
},
4344
addChatByName(botName: string, chat: Chat) {
4445
const item = this.chatStoreList.find((item: ChatSources) => item.name === botName)
46+
!chat.id && (chat.id = String(item?.chatList.length))
4547
item?.chatList.push(chat)
4648
},
4749
updateChatByName(botName: string, chat: Chat) {
4850
const item = this.chatStoreList.find((item: ChatSources) => item.name === botName)
4951
const chatList = item!.chatList
52+
!chat.id && (chat.id = String(chatList.length))
5053
item!.chatList[chatList.length - 1] = chat
5154
},
5255
clearChat() {

Diff for: src/views/ModelDetail.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ const modelInfo = {
8989
<div>
9090
<div class="mt-6">模型类型</div>
9191
<div class="mt-2 flex justify-between">
92-
<div class="bg-[#252525] rounded-md text-center py-2 w-32 text-[#fff]">ensorFlow</div>
92+
<div class="bg-[#252525] rounded-md text-center py-2 w-32 text-[#fff]">
93+
tensorFlow
94+
</div>
9395
<div class="bg-[#252525] rounded-md text-center py-2 w-32 text-[#fff]">PyTorch</div>
9496
<div class="bg-[#252525] rounded-md text-center py-2 w-32 text-[#fff]">Keras</div>
9597
</div>

0 commit comments

Comments
 (0)