mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-18 10:47:37 +08:00
add gtag for mock chat
This commit is contained in:
@@ -51,6 +51,7 @@ import {
|
||||
} from '../../../window/readNoReplyReminderLlmMockWindow'
|
||||
import { RequestSceneEnum } from '../../../features/llm-request-log'
|
||||
import { checkUpdateForUi } from '../../../features/updater'
|
||||
import gtag from '../../../utils/gtag'
|
||||
|
||||
export default function initIpc() {
|
||||
ipcMain.handle('fetch-config-file-content', async () => {
|
||||
@@ -577,9 +578,10 @@ export default function initIpc() {
|
||||
ipcMain.removeHandler('get-llm-config-for-test')
|
||||
})
|
||||
})
|
||||
ipcMain.on('close-read-no-reply-reminder-llm-mock-window', () =>
|
||||
ipcMain.on('close-read-no-reply-reminder-llm-mock-window', () => {
|
||||
readNoReplyReminderLlmMockWindow?.close()
|
||||
)
|
||||
gtag('mock_chat_window_closed')
|
||||
})
|
||||
ipcMain.handle('check-update', async () => {
|
||||
const newRelease = await checkUpdateForUi()
|
||||
return newRelease
|
||||
|
||||
@@ -470,6 +470,7 @@ const rechatLlmFallbackOptions = [
|
||||
]
|
||||
|
||||
async function handleTestEffectClicked() {
|
||||
gtagRenderer('goto_mock_chat_clicked')
|
||||
if (!(await checkIsCanRun())) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -143,9 +143,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { sleep } from '@geekgeekrun/utils/sleep.mjs'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { gtagRenderer } from '@renderer/utils/gtag'
|
||||
type MessageItem = {
|
||||
text: string
|
||||
usedLlmConfig: string
|
||||
@@ -176,10 +177,19 @@ async function getLlmConfigList() {
|
||||
}
|
||||
getLlmConfigList().catch(() => {})
|
||||
const selectedLlmConfig = ref(null)
|
||||
watch(
|
||||
() => selectedLlmConfig.value,
|
||||
() => {
|
||||
gtagRenderer('change_mock_chat_llm_model', {
|
||||
model: selectedLlmConfig.value?.model ?? ''
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
const scrollElRef = ref(null)
|
||||
const isLoading = ref(false)
|
||||
async function sendLlmGeneratedContent() {
|
||||
gtagRenderer('click_mock_chat_send')
|
||||
isLoading.value = true
|
||||
try {
|
||||
const response = await electron.ipcRenderer.invoke('request-llm-for-test', {
|
||||
@@ -223,6 +233,8 @@ function formatApiSecret(text) {
|
||||
}
|
||||
return `***`
|
||||
}
|
||||
|
||||
gtagRenderer('enter_mock_chat_page')
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user