diff --git a/samy.ps1 b/samy.ps1 index e98097e..e5cfc2b 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1032,9 +1032,24 @@ Write-LogHybrid "Tasks by page: onboard=$( } #endregion Strat-Server - #region UIHtml +function Get-RemoteText { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)][string]$Url + ) + + try { + $resp = Invoke-WebRequest -Uri $Url -UseBasicParsing -ErrorAction Stop + return $resp.Content + } + catch { + Write-LogHybrid "Get-RemoteText failed for $Url: $($_.Exception.Message)" Warning UI -LogToEvent + return "" + } +} + function Get-UIHtml { param([string]$Page = 'onboard') if (-not $Page) { $Page = 'onboard' } @@ -1058,8 +1073,13 @@ function Get-UIHtml { ) -join ",`n" # - # 3) HTML template that references external CSS/JS hosted on Gitea - # (adjust the URLs to match your repo + branch) + # 3) Pull CSS/JS from Gitea and inline them + # + $cssContent = Get-RemoteText -Url "https://git.svstools.ca/SVS_Public_Repo/S.A.M.Y/raw/branch/main/samy.css?raw=1" + $jsContent = Get-RemoteText -Url "https://git.svstools.ca/SVS_Public_Repo/S.A.M.Y/raw/branch/main/samy.js?raw=1" + + # + # 4) HTML template – **no external link/script src** anymore, all inlined # $htmlTemplate = @" @@ -1070,8 +1090,9 @@ function Get-UIHtml {