Product: PowerShell Universal
Version: 5.0.1
Hi folks,
I’ve built out an app and if I press the View App
button from http://localhost:5000/admin/apps
the app loads fine. However, if I refresh the page, or if I edit the code in VSCode and the app reloads, I just get Page Not Found
.
I also can’t just paste the url into the browser and go to it - that also gives Page Not Found
- this is causing me a problem as I have two pages and I want to link to the second page from the first one, but it doesn’t work.
However, the links created by the navigation in the top left work fine and I can get to the db page.
Any ideas? Wondering if I have the configuration wrong somewhere.
This is a paired down version of the code - but still has the issue
$Pages = @()
$Pages += New-UDPage -Name 'SQLInstances' -Content {
New-UDTypography -Text 'SQL Instances'
New-UDGrid -Container -Content {
New-UDGrid -Item -ExtraSmallSize 12 -Content {
$Data = Invoke-RestMethod -Uri http://localhost:5000/SqlInstances/GetSqlInstances
$Columns = @(
New-UDTableColumn -Property SqlInstance -Title "SQL Instance" -render {New-UDLink -Text $EventData.SqlInstance -Url "db" }
New-UDTableColumn -Property VersionString -Title "Version"
)
New-UDTable -Data $Data -Columns $Columns
}
}
}
$Pages += New-UDPage -Name 'Databases' -url '/db' -Content {
New-UDTypography -Text 'Databases'
$body = [PSCustomObject]@{ SqlInstance = 'sql2' } | ConvertTo-Json
$Data = Invoke-RestMethod -Uri "http://localhost:5000/Databases/GetDatabases" -Method Get -Body $body -ContentType 'application/json'
$Columns = @(
New-UDTableColumn -Property SqlInstance -Title "SQL Instance"
New-UDTableColumn -Property Name -Title "Name"
)
New-UDTable -Data $Data -Columns $Columns
}
New-UDApp -Pages $Pages -Title 'SQL Instance Dashboard'