Skip to content

Commit 3fd2ee5

Browse files
committed
Feature: add enableChat setting
1 parent 1e2c2ea commit 3fd2ee5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/components/Check.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@
239239
</div>
240240

241241
<div class="left-icons">
242-
<a-tooltip :title="t('CHAT')" placement="bottom">
242+
<a-tooltip
243+
:title="t('CHAT')"
244+
placement="bottom"
245+
v-if="enableChat"
246+
>
243247
<a @click="goChat()" class="icon-button">
244248
<MessageOutlined />
245249
</a>
@@ -308,6 +312,7 @@
308312
<MessageOutlined
309313
style="margin-right: 8px; cursor: pointer"
310314
@click="goChat(record.model)"
315+
v-if="enableChat"
311316
/>
312317
{{ record.model }}
313318
</span>
@@ -1167,6 +1172,8 @@ const tableData = ref([]);
11671172
const totalModels = ref(0);
11681173
const completedModels = ref(0);
11691174
const progressPercent = ref(0);
1175+
const chatSite = ref('https://chat.crond.dev');
1176+
const enableChat = ref(true);
11701177
const pagination = reactive({
11711178
current: 1,
11721179
pageSize: 8, // 默认每页显示8条,可以根据需要调整
@@ -1320,6 +1327,12 @@ const getQueryParams = async () => {
13201327
if (settingsObj.concurrency) {
13211328
modelConcurrency.value = settingsObj.concurrency;
13221329
}
1330+
if (settingsObj.chatSite) {
1331+
chatSite.value = settingsObj.chatSite;
1332+
}
1333+
if (settingsObj.enableChat) {
1334+
enableChat.value = settingsObj.enableChat;
1335+
}
13231336
if (!settingsObj.closeAnnouncement) {
13241337
showAnnouncement();
13251338
const updateInfo = await checkForUpdates(
@@ -2674,9 +2687,9 @@ function goChat(modelName) {
26742687
return;
26752688
}
26762689
//判断是否有modelName 没有就不给url 传值
2677-
let url = `https://chat.crond.dev/#/?settings={"key":"${apiKey.value}","url":"${apiUrl.value}"}`;
2690+
let url = `${chatSite.value}/#/?settings={"key":"${apiKey.value}","url":"${apiUrl.value}"}`;
26782691
if (modelName) {
2679-
url = `https://chat.crond.dev/#/?settings={"key":"${apiKey.value}","url":"${apiUrl.value}","model":"${modelName}"}`;
2692+
url = `${chatSite.value}/#/?settings={"key":"${apiKey.value}","url":"${apiUrl.value}","model":"${modelName}"}`;
26802693
}
26812694
window.open(url);
26822695
}

0 commit comments

Comments
 (0)