Hi guys,
I have created my first dashboard and it works really well, except for one thing that I can’t figure out. I have a script running on a server and it writes data to a DB depending on how serious a problem is. 3 of these states are colors, they are:
green,
orange,
and red.
I can get these into the dashboard as variables, but I cannot figure out how to auto refresh the background color on the card?. My UDTables work just fine and they auto refresh perfectly. Here is my code of a working table:
New-UDRow -Columns {
New-UDColumn -Size 12 -Content { }
New-UDColumn -Size 12 -Content {
New-UDTable -Title "Errors Today" -Header @("Number of Broken Things Today") -Endpoint {
$cache:TodayCount | Out-UDTableData -Property @("Today")} -RefreshInterval 5 -AutoRefresh
}
}
And here is the card code that doesn’t work:
New-UDRow -Columns {
New-UDColumn -Size 12 -Content { }
New-UDColumn -Size 12 -Content {
New-UDCard -Title "Current Status" -Text "$cache:Status currently affecting $cache:Item" -BackgroundColor $cache:Colour -FontColor "white"
}
}
Is there something better than trying to use a UDCard as a status indicator?