Last active
May 11, 2019 00:44
-
-
Save MatthewJDavis/46ea91aa9a9c17c42f254046e7b59a01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $GroupList = 'read', 'write', 'deploy' | |
| Get-UDDashboard | Stop-UDDashboard | |
| $ud1 = New-UDLayout -Columns 3 -Content { | |
| New-UDCard -Title "Check it out" -Content { | |
| $GroupList | ForEach-Object { | |
| New-UDElement -Id "CheckboxState" -Tag "span" | |
| New-UDCheckbox -Id "$_" -Label $_ -OnChange (New-UDEndpoint -Endpoint { | |
| $Element = Get-UDElement -Id "$_" | |
| Set-UDElement -Id "CheckboxState" -Content $Element.Attributes["checked"] | |
| if ($EventData) { | |
| Show-UDToast -Message "Added to $($ArgumentList[0])" | |
| } else { | |
| Show-UDToast -Message "Removed from $($ArgumentList[0])" | |
| } | |
| } -ArgumentList $_) | |
| } | |
| } | |
| } | |
| $ud2 = New-UDLayout -Columns 3 -Content { | |
| New-UDCard | |
| New-UDCard | |
| New-UDCard | |
| } | |
| $Page1 = New-UDPage -Name "Home" -Icon home -Content { $ud1 } | |
| $Page2 = New-UDPage -Name "Links" -Icon link -Content { $ud2 } | |
| $dash = New-UDDashboard -Title "Hello, World!" -Pages @($Page1, $Page2) | |
| Start-UDDashboard -Dashboard $dash -Port 10001 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment