diff --git a/public/locales/en/common.json b/public/locales/en/common.json index b1481caa..ad77cbb2 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -418,7 +418,8 @@ "volumeUsage": "Volume Usage", "cpuLoad": "CPU Load", "memoryUsage": "Memory Usage", - "status": "Status" + "status": "Status", + "volumeTotal": "Total space" }, "opnsense": { "cpu": "CPU Load", diff --git a/src/widgets/synology/component.jsx b/src/widgets/synology/component.jsx index fd832c8e..95405e84 100644 --- a/src/widgets/synology/component.jsx +++ b/src/widgets/synology/component.jsx @@ -20,6 +20,7 @@ export default function Component({ service }) { + @@ -31,6 +32,7 @@ export default function Component({ service }) { + diff --git a/src/widgets/synology/proxy.js b/src/widgets/synology/proxy.js index 4c4d600a..aa1023bc 100644 --- a/src/widgets/synology/proxy.js +++ b/src/widgets/synology/proxy.js @@ -76,8 +76,6 @@ export default async function synologyProxyHandler(req, res) { [status, contentType, data] = await httpProxy(storageUrl ); - - let usedVolume = 0; if (status !== 200) { return res.status(status).set("Content-Type", contentType).send(data); } @@ -85,7 +83,8 @@ export default async function synologyProxyHandler(req, res) { if (json?.success !== true) { return res.status(401).json({ error: "Error getting volume stats" }); } - usedVolume = 100 * parseFloat(json.data.vol_info[0].used_size) / parseFloat(json.data.vol_info[0].total_size); + const totalSize = parseFloat(json.data.vol_info[0].total_size); + const usedVolume = 100 * parseFloat(json.data.vol_info[0].used_size) / parseFloat(json.data.vol_info[0].total_size); const healthUrl = `${widget.url}/webapi/${path}?api=${api}&version=${maxVersion}&method=info&_sid=${sid}`; [status, contentType, data] = await httpProxy(healthUrl); @@ -110,6 +109,7 @@ export default async function synologyProxyHandler(req, res) { const resdata = { uptime, usedVolume, + totalSize, memoryUsage, cpuLoad, }