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