Skip to content

Commit

Permalink
Decode payload
Browse files Browse the repository at this point in the history
Signed-off-by: rovast <rovast@163.com>
  • Loading branch information
rovast committed Sep 1, 2023
1 parent 0a8d4df commit e2781db
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/IgntCrudRead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ const refetch = async () => {
};
defineExpose({ refetch });
await refetch();
const showContent = (str, key) => {
if (route.name === "iot.device.events") {
if (key === "payload") {
return window.atob(str);
}
}
return str;
};
</script>

<template>
Expand All @@ -97,7 +107,9 @@ await refetch();
<div class="text-sm text-gray-400 font-semibold capitalize">
{{ field.name }}
</div>
<div class="mb-3 text-base">{{ item[field.name] }}</div>
<div class="mb-3 text-base">
{{ showContent(item[field.name], field.name) }}
</div>
</div>
</div>
<div class="relative" v-if="address">
Expand Down

0 comments on commit e2781db

Please sign in to comment.