First, it’s been a long time since I worked with this product. I’m finally in an environment that will allow me to build a dashboard. The last dashboard I made was a single-file dashboard. Thankfully, the PowerShell universal is easy to work with. I have been able to make the charts, tables, and collapsible like before, but I don’t know how to make the organic links like before. I sadly, don’t have the completed code. I only have how I called the orangic code.
Here is a snippet of the code that would call the “groups” page. Of course, there was no page with this name, but however, I had UD, it would make a page on the fly.
Name = (New-UDLink -Text $Group.Name -FontColor “#0000cc” -Url “/pages/$($Group.DistinguishedName)” -OpenInNewWindow)
I don’t know how to pass the variables like I did back then.
I did find the custom items: https://docs.powershelluniversal.com/userinterfaces/dashboards/components/pages, but I haven’t been able to figure out how to make it work.
Any help would be awesome. Thank you.
Product: PowerShell Universal
Version: 1.4.6
Current Code:
$Navigation = @(
New-UDListItem -Label 'Home' -Icon (New-UDIcon -Icon Home) -OnClick {
Invoke-UDRedirect -Url '/home'
}
New-UDListItem -Label 'Groups' -Icon (New-UDIcon -Icon Users) -OnClick {
Invoke-UDRedirect -Url '/groups'
}
New-UDListItem -Label 'Computer' -Icon (New-UDIcon -Icon Users) -OnClick {
Invoke-UDRedirect -Url '/Computer'
}
)
$HomePage = New-UDPage -Name 'Home' -Content {
New-UDRow -Columns {
New-UDColumn -SmallSize 12 -MediumSize 12 -LargeSize 12 -Content {
New-UDDynamic -id "ComputerList" -Content {
$Computers = invoke-command -ComputerName eros -ScriptBlock {Invoke-SqliteQuery -DataSource "C:\ProgramData\Admin Arsenal\PDQ Inventory\Database.db" -Query "Select * from Computers"}
new-udtable -Columns @(
New-UDTableColumn -Property 'IsOnline' -Title 'Online'
New-UDTableColumn -Property 'Name' -Title 'Computer Name' -IncludeInSearch -IncludeInExport -Render {
New-UDLink -Text "$($eventdata.name)" -url "/PDQ/$($eventdata.name)"
}
New-UDTableColumn -Property "OSName" -Title "OS" -IncludeInSearch -IncludeInExport
New-UDTableColumn -Property 'BootTime' -Title 'Boot Time' -IncludeInExport
New-UDTableColumn -Property 'IPAddress' -Title "IP" -IncludeInExport
New-UDTableColumn -Property 'MacAddress' -Title "Mac Address" -IncludeInExport
New-UDTableColumn -Property "Currentuser" -Title "User" -IncludeInSearch -IncludeInExport
) -Data $Computers -ShowPagination -ShowRefresh -ShowSearch -ShowExport -Title "Computers" -ShowSort -PageSize 20 -Dense
} -AutoRefresh -AutoRefreshInterval 600
}
}
}
$Computer = New-UDPage -Name 'Computer' -Url '/pdq/:computer' -Content {
New-UDTypography -Text "$Computer"
}
$Groups = New-UDPage -Name 'Groups' -Content {
New-UDTypography -Text 'Groups'
}
New-UDDashboard -Title 'Rows and Columns' -Pages @(
$HomePage
$Computer
$Groups
) -Navigation $Navigation
After a lot of digging, I figured out what I was doing wrong.
new-udtable -Columns @(
New-UDTableColumn -Property "Name" -Title "Name" -IncludeInSearch -IncludeInExport -ShowSort -Render {
New-UDLink -Text "$($EventData.name)" -url "/PDQ/PageComputer/$($eventdata.computerID)"-OpenInNewWindow
}
} -data $SomeData
$PageComputers = New-UDPage -name "Computer Info" -Url /PageComputer/:ComputerName {
New-UDTypography -Text "$ComputerName" -Variant "h5"
}
Basically, I didn’t realize that The URL is the custom event, and beyond the / was being fed into the page. The Documentation shows it as Page1?test=123 and that test were going to be fed in. That is where I became confused.
Now I can create organic dashboards. Thank you once again for an amazing product.