diff --git a/samy.ps1 b/samy.ps1 index be7698c..1df138b 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -228,6 +228,16 @@ $ConfirmPreference = 'None' # Configurable endpoints $Global:DattoWebhookUrl = 'https://automate.svstools.ca/webhook/svsmspkit' + # SAMY asset config (change branch or base once and it updates everything) + $Script:SamyBranch = 'beta' # or 'main' + $Script:SamyRepoBase = 'https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch' + + $Script:SamyLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg" + $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" + + # Initialize a global in-memory log cache if (-not $Global:LogCache -or -not ($Global:LogCache -is [System.Collections.ArrayList])) { @@ -1016,11 +1026,18 @@ function Get-UIHtml { } ) -join ",`n" + # Human friendly branch label for UI + $branchDisplay = switch ($Script:SamyBranch.ToLower()) { + 'main' { 'Main / Stable' } + 'beta' { 'Beta' } + default { $Script:SamyBranch } + } + # # 3) Pull CSS/JS from Gitea and inline them # - $cssContent = Get-RemoteText -Url "https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch/beta/samy.css?raw=1" - $jsContent = Get-RemoteText -Url "https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch/beta/samy.js?raw=1" + $cssContent = Get-RemoteText -Url $Script:SamyCssUrl + $jsContent = Get-RemoteText -Url $Script:SamyJsUrl # # 4) HTML template - **no external link/script src** anymore, all inlined @@ -1032,7 +1049,7 @@ function Get-UIHtml { Script Automation Monkey - +