+ {title}
- try {
- const { timestamp, severity, message } = JSON.parse(data)
- const decryptMessage = atob(message)
+
- return (
-
- )
- } catch {
- const severity = data.includes(DEBUG_LEVEL.ERROR)
- ? DEBUG_LEVEL.ERROR
- : data.includes(DEBUG_LEVEL.INFO)
- ? DEBUG_LEVEL.INFO
- : data.includes(DEBUG_LEVEL.WARN)
- ? DEBUG_LEVEL.WARN
- : DEBUG_LEVEL.DEBUG
-
- return (
-
- )
- }
- })
- )
- )}
-
-
+
+
)
}, (prev, next) => prev.uuid === next.uuid)
@@ -88,7 +73,11 @@ DebugLog.propTypes = {
on: PropTypes.func.isRequired,
off: PropTypes.func.isRequired
}).isRequired,
- logDefault: PropTypes.object
+ logDefault: PropTypes.object,
+ title: PropTypes.oneOfType([
+ PropTypes.element,
+ PropTypes.string
+ ])
}
DebugLog.defaultProps = {
@@ -97,9 +86,12 @@ DebugLog.defaultProps = {
on: () => undefined,
off: () => undefined
},
- logDefault: {}
+ logDefault: {},
+ title: null
}
DebugLog.displayName = 'DebugLog'
export default DebugLog
+
+export { LogUtils }
diff --git a/src/fireedge/src/client/components/DebugLog/messagelist.js b/src/fireedge/src/client/components/DebugLog/messagelist.js
new file mode 100644
index 0000000000..bc5e8820f7
--- /dev/null
+++ b/src/fireedge/src/client/components/DebugLog/messagelist.js
@@ -0,0 +1,46 @@
+import * as React from 'react'
+import PropTypes from 'prop-types'
+
+import Message from 'client/components/DebugLog/message'
+import { getMessageInfo } from 'client/components/DebugLog/utils'
+
+const MessageList = ({ log = {}, filters = {} }) =>
+ Object.entries(log)?.map(([command, entries]) => (
+ // filter by command
+ (!filters.command || filters.command.includes(command)) && (
+ Object.entries(entries)?.map(([commandId, messages]) =>
+ Array.isArray(messages) && messages?.map((data, index) => {
+ const { severity, ...messageInfo } = getMessageInfo(data)
+
+ // filter by severity
+ if (filters.severity && filters.severity !== severity) return null
+
+ const key = `${index}-${command}-${commandId}`
+
+ return (
+