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 count >= threshold_error then
if fixedStatus then
status = 'error'
status = fixedStatus
elseif count >= threshold_warning then
else
status = 'warning'
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, 5))
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, 3))
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, 5))
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, 3))
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', 50, 200))
-- 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', 50, 200))
table.insert(cards, statusCard('CRT Stubs', crtStubs, 'Category:CRT stubs', 1, 99999))
table.insert(cards, statusCard('CRTs Missing Type', crtNoType, 'Category:CRTs missing type', 10, 50))
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', 100, 500))
-- Missing type: red/green (any missing = red)
table.insert(cards, statusCard('AV Device Stubs', avStubs, 'Category:AV device stubs', 10, 50))
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'
MediaWiki Appliance - Powered by TurnKey Linux