完善错误监控详情

This commit is contained in:
xiangheng
2024-10-14 11:36:58 +08:00
parent 69b7407ab1
commit a0dac7f75b
9 changed files with 127 additions and 104 deletions

View File

@@ -18,7 +18,6 @@ export type type_monitor_client = {
Height?: number
Ua?: string
CreateTime?: string
ClientTime?: string
}
// 查询
export type type_monitor_client_query = {
@@ -48,16 +47,21 @@ export type type_monitor_client_edit = {
Width?: number
Height?: number
Ua?: string
ClientTime?: string
}
// 监控-客户端信息列表
export function monitor_client_list(params?: type_monitor_client_query) {
return request.get<Pages<type_monitor_client>>({ url: '/monitor_client/list', params: clearEmpty(params) })
return request.get<Pages<type_monitor_client>>({
url: '/monitor_client/list',
params: clearEmpty(params)
})
}
// 监控-客户端信息列表-所有
export function monitor_client_list_all(params?: type_monitor_client_query) {
return request.get<type_monitor_client[]>({ url: '/monitor_client/listAll', params: clearEmpty(params) })
return request.get<type_monitor_client[]>({
url: '/monitor_client/listAll',
params: clearEmpty(params)
})
}
// 监控-客户端信息详情
@@ -65,6 +69,10 @@ export function monitor_client_detail(Id: number | string) {
return request.get<type_monitor_client>({ url: '/monitor_client/detail', params: { Id } })
}
export function monitor_client_errorUsers(Id: number | string) {
return request.get<type_monitor_client[]>({ url: '/monitor_client/errorUsers', params: { Id } })
}
// 监控-客户端信息新增
export function monitor_client_add(data: type_monitor_client_edit) {
return request.post<null>({ url: '/monitor_client/add', data })
@@ -89,5 +97,7 @@ export const monitor_client_import_file = '/monitor_client/ImportFile'
// 监控-客户端信息导出
export function monitor_client_export_file(params: any) {
return (window.location.href =`${config.baseUrl}${config.urlPrefix}/monitor_client/ExportFile?token=${getToken()}&` + queryString.stringify(clearEmpty(params)))
return (window.location.href =
`${config.baseUrl}${config.urlPrefix}/monitor_client/ExportFile?token=${getToken()}&` +
queryString.stringify(clearEmpty(params)))
}

View File

@@ -126,16 +126,16 @@
<el-table-column label="ua记录" prop="Ua" min-width="130" />
<el-table-column label="创建时间" prop="CreateTime" min-width="130" />
<el-table-column label="操作" width="120" fixed="right">
<el-table-column label="操作" width="80" fixed="right">
<template #default="{ row }">
<el-button
<!-- <el-button
v-perms="['admin:monitor_client:edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
</el-button> -->
<el-button
v-perms="['admin:monitor_client:del']"
type="danger"

View File

@@ -52,9 +52,40 @@
</div>
</template>
<el-scrollbar height="400px">
<p v-for="item in 120" :key="item" class="scrollbar-demo-item">
{{ item }}
</p>
<el-collapse v-model="activeNames">
<el-collapse-item
v-for="(user, index) in users"
:key="user.Id"
:title="user.CreateTime"
:name="index"
>
<template #title>
<div class="flex-1 text-left">
{{ user.UserId }}
</div>
<span class="">
{{ user.CreateTime }}
</span>
</template>
<el-descriptions border>
<el-descriptions-item label="城市:">{{
user.City
}}</el-descriptions-item>
<el-descriptions-item label="OS">{{
user.Os
}}</el-descriptions-item>
<el-descriptions-item label="屏幕尺寸:">
<el-tag size="small"
>{{ user.Width }}*{{ user.Height }}</el-tag
>
</el-descriptions-item>
<el-descriptions-item label="userAgent">
{{ user.Ua }}
</el-descriptions-item>
</el-descriptions>
</el-collapse-item>
</el-collapse>
</el-scrollbar>
</el-card>
</el-col>
@@ -65,6 +96,9 @@
<script lang="ts" setup>
import type { FormInstance } from 'element-plus'
import { monitor_error_add, monitor_error_detail } from '@/api/monitor/error'
import { monitor_client_errorUsers } from '@/api/monitor/client'
import type { type_monitor_client } from '@/api/monitor/client'
import Popup from '@/components/popup/index.vue'
import feedback from '@/utils/feedback'
import type { PropType } from 'vue'
@@ -86,6 +120,8 @@ const popupTitle = computed(() => {
return '监控详情'
})
const activeNames = ref<string[]>(['1'])
const formData = reactive({
Id: null,
ProjectKey: null,
@@ -97,6 +133,7 @@ const formData = reactive({
Md5: null,
ClientTime: null
})
const users = ref<type_monitor_client[]>([])
const handleSubmit = async () => {
try {
@@ -126,6 +163,10 @@ const setFormData = async (data: Record<string, any>) => {
const getDetail = async (row: Record<string, any>) => {
try {
const data = await monitor_error_detail(row.Id)
users.value = await monitor_client_errorUsers(row.Id)
console.log('user', users.value)
setFormData(data)
} catch (error) {}
}