I am working on a dashboard where I have an input for the user to enter a server name. Then i want to run multiple checks in the back in background that connect to that server and get different stats.
I want to have a 4 column row that returns 4 items then under neath that 2 columns that return 2 items. Here is a sample. anything after the 4 column layout doesnt seem to run.
any help would be appreciated.
thanks,
New-UDInput -Title “Enter Server Name” -Endpoint {
param(
[string]$RemoteComp
)
Hi Gerard, just put a new-udelement as first level element to group everything under the same roof.
Something like :
New-UDInput -Title "Enter Server Name" -Endpoint {
param(
[string]$RemoteComp
)
New-UDInputAction -Content {
New-UDElement -Tag 'div' -Content {
# your layout
# your monitor
}
}#close input action
}
By doing that, you are basically outputing one component, the new-udElement, which contains your multiples output.
You can use New-UDCard or any other single component as top-level component but New-UDElement -Tag 'div' -Content {...} have the advantage of being completely transparent when rendered.
I dont know if i should post this as a new topic but some of the invoke-commands that i run dont seem to work. For example if i try to pull the last 10 application log events using this command:
That sounds like it’s because Get-EventLog returns an object array, which New-UDCard doesn’t know how to display. If you did something like (Get-EventLog -LogName Application -Newest 10).Message inside your scriptblock, that should work.
Ideally when displaying arrays of objects like this, you’ll want to use either a New-UDTable or a New-UDGrid. The associated output cmdlets (Out-UDTableData and Out-UDGridData) are able to parse the object properties into a displayable format.