Maintenance URL format
@Adam Driscoll yes my goal was for the users not just to get a 404 and make a customised maintenance page in the process. And that could be fixed by loading the default.html regardless of trailing slash or not.
Thanks!
Will find you at the conf!
Maintenance URL format
When setting an app in maintenance mode, the server redirects to https://server.domain.com/maintenance - which in itself is probably the intention.
We don't use load balancing in front of the PSU server, so instead of using the redirection to detect maintenance, I've set up a published folder called "maintenance" with a request path of "/maintenance/" (not possible to set "/maintenance" without trailing slash). In that folder I have a default.html with information of the server being in maintenance mode.
The problem here is that the redirect does not add a trailing slash, so it never shows the default document. If I add the slash, it shows.
So the solution here would be to either redirect to "/maintenance/" (which would probably screw up a lot of setups) or allow to publish a folder without trailing slash. I have tried creating it both through GUI and in shell, setting default doc, etc.
Or am I missing something here?
Will be at PSConf.eu if anyone wants to meet up and do some PSU geeking.
Physical path in URL
Found the problem myself, had moved a function to a .psm1 which then no longer knew $PSScriptRoot…
Physical path in URL
Not sure if this is a bug, feature or I’m doing something wrong, but in version 4.x I could use Invoke-UDRedirect to open a page at e.g.: /licenses/changexxlicenses to open a page called changexxlicenses.ps1 in the folder licenses.
In version 5.5.2 PSU gives me the path /x:/folder/repository/dashboards/main/licenses/changexxlicenses which breaks the functionality in pages where we use the old relative paths.
Is this by design and the intended way in the future, or do I need to revise the code generating page URLs? The pages are not generated in the UI but are simply .ps1 files in the structure that the navigation is automatically generated by reading…
Makes sense?
Light/Dark mode to follow browser/OS?
Works like a charm here as well, thanks! Confused myself with the “return” command…
Light/Dark mode to follow browser/OS?
Possibly, except I’m missing how to transfer the value from JS to PS…
The code is:
function detectDarkMode() {
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
}
return detectDarkMode();Light/Dark mode to follow browser/OS?
Yeah, I’ve got the window.matchMedia down and it shows the correct value, but getting that value back to PowerShell to set the theme is apparently beyond me…
Light/Dark mode to follow browser/OS?
Product: PowerShell Universal
Version: 4.xIs there a clever way to let light/dark mode of the dashboard follow browser or Windows? The dashboard does not retain the setting but always defaults to light, so I’ve added:
Set-UDTheme -Name ‘Dark+’ -Variant ‘Dark’
Which works fine, except now I have some users that actually want light mode.
So either the detection or a way to preserve the users’ selection is needed.
OnEnter event on UDTextbox not triggered within UDStepper
Thanks @Adam Driscoll, the OnEnter now works (4.0.0 Release). However, it appears to skip the OnValidateStep for step0 when setting activeStep this way…?!
OnEnter event on UDTextbox not triggered within UDStepper
In the code below, the OnEnter event is never triggered when pressing Enter in the textbox. This works fine when a textbox is used in a form. We would really like to be able to just press Enter in the Stepper instead of having to use the mouse for clicking Next. I guess I can simulate the Next press with New-ValidationResult?
New-UDStep -Id 'step0' -OnLoad {
New-UDElement -tag 'div' -Content { "User initials:" }
New-UDTextbox -Id 'txtInitials' -Variant 'outlined' -Label 'Initials' -Autofocus -OnEnter {
Show-UDToast -Message "Enter"
}
} -Label "Initials"Product: PowerShell Universal
Version: 4.0.0-beta4