Guys,
i was testing the new button feature -Disabled and i run into this issue.
in my dashboard am using the following code to create custom object for each service in my windows machine
$Cache:Services = (Get-Service -Computername 'Server') | %{
[PSCustomObject]@{
Name = $_.Name
Status = New-UDElement -Tag 'div' -Attributes @{ style = @{ color = $fontColor } } -
Content { $_.Status.ToString() }
Select = if($_.Status -eq 'Stopped'){
New-UDButton -Text "Start" -OnClick {
New-UDButton -Disabled
Get-Service -ComputerName 'Server' -Name $_.Name | Start-Service
Show-UDToast -Message "Service Started!" -MessageColor Green -Title $_.Name -
Position topCenter -Duration 2500
}
}
The problem is OnClick will disable all the buttons and not only the one that has been clicked.
any idea how to solve this issue.
Regards.