Skip to content
Snippets Groups Projects
Verified Commit aa8db3a9 authored by Tony Bonnin's avatar Tony Bonnin
Browse files

Print REAL Total Memory in GB

parent f60c6f83
No related branches found
No related tags found
No related merge requests found
......@@ -97,10 +97,10 @@
-- FORMAT BYTES
function bytesToSize(bytes)
kilobyte = 1000;
megabyte = kilobyte * 1000;
gigabyte = megabyte * 1000;
terabyte = gigabyte * 1000;
kilobyte = 1024;
megabyte = kilobyte * 1024;
gigabyte = megabyte * 1024;
terabyte = gigabyte * 1024;
if((bytes >= 0) and (bytes < kilobyte)) then
return math.floor(bytes) .. " Bytes";
elseif((bytes >= kilobyte) and (bytes < megabyte)) then
......@@ -205,7 +205,7 @@ end
<p class="dashboard-infos dash-info-memory" style="cursor: pointer;" onclick="window.open('/cgi-bin/acf/alpine-baselayout/health/proc', '_blank')" >
<span class="data-title">Memory</span>
<span>
<%= string.gsub(bytesToSize(tonumber(sys.value.memory.totalData)), ".%d+%w+", "") %> Total |
<%= bytesToSize(tonumber(sys.value.memory.totalData)) %> Total |
<%= bytesToSize(tonumber(sys.value.memory.freeData)) %> Free |
<span class='mem-used corpo-hardware-text'>
<%= bytesToSize(tonumber(sys.value.memory.usedData)) %> Used </span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment