Open spmsupun opened 3 years ago
It is an error when the JSON values get parsed. I made the following changes and it worked.
index.js
Modified line 58
from var wsResponse = '{ "moduleName": "' + moduleName + '", "output": "'+ output.join('') +'" }'
to var wsResponse = '{ "moduleName": "' + moduleName + '", "output": '+ output.join('') +' }'
reason
The extra " double quotes surrounding the output property value, messed with the double quotes inside the actual value. So I removed it to so it can be directly converted to an object.
server.service.js
Modified line 36
-
from var moduleData = JSON.parse(response.output);
to var moduleData = response.output)
reason
Made the change so when the websocket client listens to the data being passed, it should not try to parse the already parsed output property.
If you have edited the changes in the server.service.js
then build the source and copy the linuxDash.min.js
to the server. You could also directly update the linuxDash.min.js
and index.js
on the server and everything will start working.
I have not done any tests or verifications to make sure things do not break in other implementations like Python etc, but my app started showing everything after that.
Let me know if it works for you.
I have already chosen a different one, It's been so long 😅
@spmsupun Out of curiosity, which dashboard do you use now?
@VigneshVaidyanathan i use netdata
Installed it. There is no turning back now, is it. It looks awesome 😄
yeah, I thought it's heavy but no, its super light weight
@VigneshVaidyanathan it works!
I am getting JSON error when WS retrieve data from backend, so I debug the frontend js and I am getting a invalid json:
Am I doing something wrong?