Module:Metrics dashboard
Appearance
![]() | This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
Usage
{{#invoke:Metrics dashboard|function_name}}
Provides functionality to Template:Metrics dashboard.
Input
See Template:Metrics dashboard/doc#Usage
Output
A formatted string representing the metrics dashboard with the provided key figures, labels, footer, and last-updated timestamp.
local p = {}
local function listItem(value, label)
return string.format('* %s %s', value, label)
end
function p.list(frame)
local output = ''
local i = 1
while frame.args['figure' .. i .. '-value'] and frame.args['figure' .. i .. '-label'] do
local value = frame.args['figure' .. i .. '-value']
local label = frame.args['figure' .. i .. '-label']
output = output .. listItem(value, label) .. '\n'
i = i + 1
end
return output
end
return p