move sparkplug decoding to backend

This commit is contained in:
Thomas Nordquist
2022-02-27 22:49:54 +01:00
parent 72400af679
commit b17b54490e
12 changed files with 3423 additions and 3687 deletions

View File

@@ -5,7 +5,6 @@ import PlotHistory from './Chart/Chart'
import { Base64Message } from '../../../backend/src/Model/Base64Message'
import { toPlottableValue } from './Sidebar/CodeDiff/util'
import { PlotCurveTypes } from '../reducers/Charts'
import { Payload } from '../../../backend/src/Model/sparkplugb'
const parseDuration = require('parse-duration')
interface Props {
@@ -41,7 +40,7 @@ function nodeDotPathToHistory(startTime: number | undefined, history: q.MessageH
let json: any = {}
try {
json = message.payload ? JSON.parse(Base64Message.toUnicodeString(message.payload)) : {}
} catch (ignore) {}
} catch (ignore) { }
const value = dotProp.get(json, dotPath)