Global storage utilization in Runtime Status

This commit is contained in:
Alfredo Cardigliano 2018-12-12 16:23:34 +01:00
parent 0eea23bf5a
commit a3d370ea7e
6 changed files with 145 additions and 40 deletions

View file

@ -164,8 +164,10 @@ function stackedProgressBars(total, bars, other_label, formatter)
for _, bar in ipairs(bars) do
local percentage = round(bar.value * 100 / total, 2)
cumulative = cumulative + bar.value
if bar.class == nil then bar.class = "primary" end
if bar.style == nil then bar.style = "" end
res[#res + 1] = [[
<div class="progress-bar progress-bar-]] .. (bar.class) .. [[" role="progressbar" style="width:]] .. percentage .. [[%"></div>]]
<div class="progress-bar progress-bar-]] .. (bar.class) .. [[" role="progressbar" style="width:]] .. percentage .. [[%;]] .. bar.style .. [["></div>]]
end
res[#res + 1] = [[
@ -187,7 +189,7 @@ function stackedProgressBars(total, bars, other_label, formatter)
end
for _, bar in ipairs(legend_items) do
res[#res + 1] = [[<span><span class="label label-]].. (bar.class) ..[[">&nbsp;</span><span>]] .. bar.title .. " (".. formatter(bar.value) ..")</span></span>"
res[#res + 1] = [[<span><span class="label label-]].. (bar.class) ..[[" style="]] .. bar.style .. [[">&nbsp;</span><span>]] .. bar.title .. " (".. formatter(bar.value) ..")</span></span>"
end
return table.concat(res)