diff --git a/src/utils/proxy/handlers/jsonrpc.js b/src/utils/proxy/handlers/jsonrpc.js index 4e79b76b0..b1b080fd0 100644 --- a/src/utils/proxy/handlers/jsonrpc.js +++ b/src/utils/proxy/handlers/jsonrpc.js @@ -31,6 +31,10 @@ export async function sendJsonRpcRequest(url, method, params, username, password if (status === 200) { const json = JSON.parse(data.toString()); + if (json.id === null) { + json.id = 1; + } + // in order to get access to the underlying error object in the JSON response // you must set `result` equal to undefined if (json.error && json.result === null) { diff --git a/src/widgets/openwrt/proxy.js b/src/widgets/openwrt/proxy.js index 04c7a5039..977db8ca9 100644 --- a/src/widgets/openwrt/proxy.js +++ b/src/widgets/openwrt/proxy.js @@ -77,7 +77,7 @@ async function fetchSystem(url) { const systemResponse = JSON.parse(data.toString())[1]; const response = { uptime: systemResponse.uptime, - cpuLoad: systemResponse.load[1], + cpuLoad: (systemResponse.load[1] / 65536.0).toFixed(2), }; return [200, contentType, response]; }