Browse Source

fix: 调试socket推送参数变更

feature/three
guoapeng 3 months ago
parent
commit
a4ad932fb8
  1. 4
      src/components/common/FTStream/index.vue
  2. 8
      src/views/debug/index.vue

4
src/components/common/FTStream/index.vue

@ -20,9 +20,7 @@ const maskRef = ref<HTMLElement | null>(null)
const maskHeaderRef = ref<HTMLElement | null>(null)
const statusMap = {
info: 'info',
error: 'danger',
warn: 'warning',
success: 'success',
finish: 'primary',
SEND: 'primary',
@ -112,7 +110,7 @@ const handleMouseUp = () => {
v-for="item in systemStore.systemList" :key="item"
:timestamp="JSON.stringify(item.content)"
>
<el-tag :type="statusMap[item.level as keyof typeof statusMap]" class="mask-tag">
<el-tag :type="statusMap[item.status as keyof typeof statusMap]" class="mask-tag">
{{ item.title }}
</el-tag>
</el-timeline-item>

8
src/views/debug/index.vue

@ -11,14 +11,16 @@ const debugStore = useDebugStore()
let currentCommandId = ''
onMounted(() => {
socket.init(receiveMessage, 'notification')
socket.init(receiveMessage, 'cmd_debug')
socket.init(receiveMessage, 'cmd_response')
})
onUnmounted(() => {
socket.unregisterCallback(receiveMessage, 'notification')
socket.unregisterCallback(receiveMessage, 'cmd_debug')
socket.unregisterCallback(receiveMessage, 'cmd_response')
})
const receiveMessage = (data: Socket.NotificationData) => {
const receiveMessage = (data: Socket.cmdData) => {
data.commandId === currentCommandId && systemStore.pushSystemList(data)
}

Loading…
Cancel
Save