diff --git a/samy.ps1 b/samy.ps1 index b4621f4..97dd625 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -9,6 +9,7 @@ Invoke-installprinters you can uncomment whatif in the function # SAMY asset config (change branch or base once and it updates everything) $Script:SamyBranch = 'beta' # or 'main' +line 268 - 281 .SYNOPSIS Script Automation Monkey (SAMY) is a unified MSP assistant that automates onboarding, headless offboarding, @@ -283,6 +284,9 @@ $ConfirmPreference = 'None' $Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico" $Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1" $Script:SamyJsUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.js?raw=1" + $Script:SamyHtmlUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.html?raw=1" + $Script:SamyHintText = "" + # Initialize a global in-memory log cache @@ -1094,11 +1098,24 @@ function Get-UIHtml { } # - # 3) Pull CSS/JS from Gitea and inline them + # 3) Pull CSS/JS/HTML from Gitea and inline them # $cssContent = Get-RemoteText -Url $Script:SamyCssUrl $jsContent = Get-RemoteText -Url $Script:SamyJsUrl + $htmlTemplate = Get-RemoteText -Url $Script:SamyHtmlUrl + + if (-not $htmlTemplate) { + # Hard fail or fallback, your call. + # This keeps the UI from becoming blank if the repo is unreachable. + Write-LogHybrid "UI template download failed. Returning minimal error page." Error UI -LogToEvent + return "
+Could not download samy.html from repo.
+ " + } + + # Optional: inject background override into CSS (same as you had) if ($cssContent) { $cssContent += @" @@ -1109,211 +1126,18 @@ function Get-UIHtml { "@ } - # - # 4) HTML template - **no external link/script src** anymore, all inlined - # - $htmlTemplate = @" - - - - - -