Hi, I have a dashboard where if I have columns defined as shown below along with tables and pages defined outside of the New-UDDashboard then I will have $EventData populated but my dashboard doesnt update even though the $Cache:serviceStatObjsBLUE is verified updating every 2 min. I am trying to move the bulk of the table/ page definition inside the dashboard to get it to update.
$Columns = @(
New-UDTableColumn -Property 'ServerName' -Title 'ServerName'
New-UDTableColumn -Property 'ServiceDisplayName' -Title 'ServiceDisplayName'
New-UDTableColumn -Property 'Status' -Title 'Status'
New-UDTableColumn -Property 'Recycle' -Title 'Recycle' -Render {
New-UDButton -Text "Recycle" -OnClick {
$EventData | out-file -path "c:\temp\eventdata.txt" -Append -force
$message = "Recycling Service " + $EventData.ServiceDisplayName
$message += " on Server " + $EventData.ServerName
Show-UDToast -Message $message -Duration 10000
$res = recycleservices $EventData.ServerName $EventData.ServiceDisplayName $EventData.Login
}
}
)
$tableBLUE = New-UDTable -Id 'blue_services' -Title "Blue Services" -PageSize 30 -Columns $Columns -Data $Cache:serviceStatObjsBLUE
$Pages += New-UDPage -Name 'BLUE' -Content {
New-UDTable -Id 'blue_services' -Title "Blue Services" -PageSize 30 -Columns
$Columns -Data $Cache:serviceStatObjsBLUE
}
New-UDDashboard -Title 'Environment Maintenance' -Pages $Pages
In the scenario below, the dashboard works and updates with the Cached data but the $EventData is not populated when the Columns are defined outside?
What am I missing? How do I bring the columns inside the dashboard when I am defining the dashboard to use -Pages?
$Columns = @(
New-UDTableColumn -Property 'ServerName' -Title 'ServerName'
New-UDTableColumn -Property 'ServiceDisplayName' -Title 'ServiceDisplayName'
New-UDTableColumn -Property 'Status' -Title 'Status'
New-UDTableColumn -Property 'Recycle' -Title 'Recycle' -Render {
New-UDButton -Text "Recycle" -OnClick {
$EventData | out-file -path "c:\temp\eventdata.txt" -Append -force
$message = "Recycling Service " + $EventData.ServiceDisplayName
$message += " on Server " + $EventData.ServerName
Show-UDToast -Message $message -Duration 10000
$res = recycleservices $EventData.ServerName $EventData.ServiceDisplayName $EventData.Login
}
}
)
New-UDDashboard -Title 'Environment Maintenance' -Pages @(
New-UDPage -Name 'BLUE' -Content {
New-UDTable -Id 'blue_services' -Title "Blue Services" -PageSize 30 -Columns
$Columns -Data $Cache:serviceStatObjsBLUE
}
)