Skip to content

Commit

Permalink
fix(client): fix can not show messages in mqtt v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ysfscream authored and Kinplemelon committed Mar 8, 2024
1 parent a1c9855 commit ed2c6e8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/Clients/ClientDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ const props = defineProps({
},
})
type ClientTypes = 'MQTT' | 'LWM2M' | 'others' | 'MQISDP'
const emit = defineEmits(['refreshGateway'])
const dialogVisible = ref(false)
Expand Down Expand Up @@ -370,12 +372,15 @@ const backRoute = computed(() => {
const clientId = computed<string>((): string => {
return (route.params.clientId as string) || (props.clientid as string)
})
const clientType = computed<'MQTT' | 'LWM2M' | 'others'>((): 'MQTT' | 'LWM2M' | 'others' => {
const clientType = computed<ClientTypes>((): ClientTypes => {
const proto_name = String(record.value.proto_name)
return proto_name.toUpperCase() as 'MQTT' | 'LWM2M' | 'others'
return proto_name.toUpperCase() as ClientTypes
})
const clientDetailParts = computed(() => {
let allParts = Object.keys(clientsOrganizied)
if (clientType.value === 'MQISDP') {
return clientsOrganizied.MQTT
}
if (Array.prototype.includes.call(allParts, clientType.value)) {
return clientsOrganizied[clientType.value]
}
Expand Down

0 comments on commit ed2c6e8

Please sign in to comment.