mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Added total to the stackedProgressBars component
This commit is contained in:
parent
6015642754
commit
4b77c7640b
1 changed files with 10 additions and 2 deletions
|
|
@ -168,8 +168,10 @@ function stackedProgressBars(total, bars, other_label, formatter)
|
|||
local percentage = round(bar.value * 100 / total, 2)
|
||||
if bar.class == nil then bar.class = "primary" end
|
||||
if bar.style == nil then bar.style = "" end
|
||||
if bar.link ~= nil then res[#res + 1] = [[<a href="]] .. bar.link .. [[">]] end
|
||||
res[#res + 1] = [[
|
||||
<div class="progress-bar progress-bar-]] .. (bar.class) .. [[" role="progressbar" style="width:]] .. percentage .. [[%;]] .. bar.style .. [["></div>]]
|
||||
<div class="progress-bar progress-bar-]] .. (bar.class) .. [[" role="progressbar" style="width:]] .. percentage .. [[%;]] .. bar.style .. [["></div></a>]]
|
||||
if bar.link ~= nil then res[#res + 1] = [[</a>]] end
|
||||
end
|
||||
|
||||
res[#res + 1] = [[
|
||||
|
|
@ -192,9 +194,15 @@ 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) ..[[" style="]] .. bar.style .. [["> </span><span>]] .. bar.title .. " (".. formatter(bar.value) ..")</span></span>"
|
||||
res[#res + 1] = [[<span>]]
|
||||
if bar.link ~= nil then res[#res + 1] = [[<a href="]] .. bar.link .. [[">]] end
|
||||
res[#res + 1] = [[<span class="label label-]].. (bar.class) ..[[" style="]] .. bar.style .. [["> </span>]]
|
||||
if bar.link ~= nil then res[#res + 1] = [[</a>]] end
|
||||
res[#res + 1] = [[<span>]] .. bar.title .. " (".. formatter(bar.value) ..")</span></span>"
|
||||
end
|
||||
|
||||
res[#res + 1] = [[<span style="margin-left: 0"><span></span><span> - ]] .. i18n("total") .. ": ".. formatter(total) .."</span></span>"
|
||||
|
||||
return table.concat(res)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue