Module:MaintenanceDashboard: Difference between revisions
Fix category links by adding colon prefix so they render as links instead of category assignments (via update-page on MediaWiki MCP Server) |
Adjust thresholds: CRTs Missing Type red/green, Stubs/Images amber/green, No Series as info (via update-page on MediaWiki MCP Server) |
||
| Line 19: | Line 19: | ||
-- Generate a single status card | -- Generate a single status card | ||
local function statusCard(label, count, link, threshold_warning, threshold_error) | -- If fixedStatus is provided, it overrides threshold-based status | ||
local function statusCard(label, count, link, threshold_warning, threshold_error, fixedStatus) | |||
threshold_warning = threshold_warning or 1 | threshold_warning = threshold_warning or 1 | ||
threshold_error = threshold_error or 10 | threshold_error = threshold_error or 10 | ||
local status = 'ok' | local status | ||
if fixedStatus then | |||
status = fixedStatus | |||
else | |||
status = 'ok' | |||
if count >= threshold_error then | |||
status = 'error' | |||
elseif count >= threshold_warning then | |||
status = 'warning' | |||
end | |||
end | end | ||
| Line 172: | Line 178: | ||
-- Build output | -- Build output | ||
-- All category issues should be red/green (any missing = red) | |||
local cards = {} | local cards = {} | ||
table.insert(cards, statusCard('CRT Brand Categories', missingCRTBrands, 'EveryCRT:Category maintenance#CRT Brands Missing Category Pages', 1, | table.insert(cards, statusCard('CRT Brand Categories', missingCRTBrands, 'EveryCRT:Category maintenance#CRT Brands Missing Category Pages', 1, 1)) | ||
table.insert(cards, statusCard('CRT Type Categories', missingCRTTypes, 'EveryCRT:Category maintenance#CRT Types Missing Category Pages', 1, | table.insert(cards, statusCard('CRT Type Categories', missingCRTTypes, 'EveryCRT:Category maintenance#CRT Types Missing Category Pages', 1, 1)) | ||
table.insert(cards, statusCard('AV Brand Categories', missingAVBrands, 'EveryCRT:Category maintenance#AV Brands Missing Category Pages', 1, | table.insert(cards, statusCard('AV Brand Categories', missingAVBrands, 'EveryCRT:Category maintenance#AV Brands Missing Category Pages', 1, 1)) | ||
table.insert(cards, statusCard('AV Type Categories', missingAVTypes, 'EveryCRT:Category maintenance#AV Device Types Missing Category Pages', 1, | table.insert(cards, statusCard('AV Type Categories', missingAVTypes, 'EveryCRT:Category maintenance#AV Device Types Missing Category Pages', 1, 1)) | ||
local output = '<div class="maintenance-status-grid">\n' | local output = '<div class="maintenance-status-grid">\n' | ||
| Line 196: | Line 203: | ||
local cards = {} | local cards = {} | ||
table.insert(cards, statusCard('CRT Stubs', crtStubs, 'Category:CRT stubs', | -- Stubs and missing images: amber/green (warning at 1, no red - use very high threshold) | ||
table.insert(cards, statusCard('CRTs Need Images', crtNoImage, 'Category:CRT models needing images', | table.insert(cards, statusCard('CRT Stubs', crtStubs, 'Category:CRT stubs', 1, 99999)) | ||
table.insert(cards, statusCard('CRTs Missing Type', crtNoType, 'Category:CRTs missing type', | table.insert(cards, statusCard('CRTs Need Images', crtNoImage, 'Category:CRT models needing images', 1, 99999)) | ||
table.insert(cards, statusCard('CRTs No Series', crtNoSeries, 'Category:CRTs without series', | -- Missing type: red/green (any missing = red) | ||
table.insert(cards, statusCard('AV Device Stubs', avStubs, 'Category:AV device stubs', | table.insert(cards, statusCard('CRTs Missing Type', crtNoType, 'Category:CRTs missing type', 1, 1)) | ||
-- No series: informational only (gray), not an issue | |||
table.insert(cards, statusCard('CRTs No Series', crtNoSeries, 'Category:CRTs without series', nil, nil, 'info')) | |||
-- AV stubs: red/green (any = red since we want these fixed) | |||
table.insert(cards, statusCard('AV Device Stubs', avStubs, 'Category:AV device stubs', 1, 1)) | |||
local output = '<div class="maintenance-status-grid">\n' | local output = '<div class="maintenance-status-grid">\n' | ||