diff --git a/samy.ps1 b/samy.ps1 index 787bc59..55466b5 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1039,28 +1039,25 @@ function Get-UIHtml { param([string]$Page = 'onboard') if (-not $Page) { $Page = 'onboard' } - # # 1) Build checkbox HTML per page/column - # $onboardLeft = Build-Checkboxes -Page 'onboard' -Column 'left' $onboardRight = Build-Checkboxes -Page 'onboard' -Column 'right' $offboard = Build-Checkboxes -Page 'offboard' -Column '' $tweaks = Build-Checkboxes -Page 'tweaks' -Column '' $apps = Build-Checkboxes -Page 'SVSApps' -Column '' - # # 2) Build the JS tasks array once (this is the only dynamic JS piece) - # $tasksJsAll = ( $Global:SamyTasks | ForEach-Object { " { id: '$($_.Id)', handler: '/$($_.Name)', label: '$($_.Label)' }" } ) -join ",`n" - # - # 3) HTML template that references external CSS/JS hosted on Gitea - # (adjust the URLs to match your repo + branch) - # + # 3) Fetch CSS and JS from Gitea and inline them + $styleContent = Get-ExternalContentSafe -Url "https://git.svstools.ca/SVS_Public_Repo/S.A.M.Y./raw/branch/main/samy.css" -Description "SAMY CSS" + $scriptContent = Get-ExternalContentSafe -Url "https://git.svstools.ca/SVS_Public_Repo/S.A.M.Y./raw/branch/main/samy.js" -Description "SAMY JS" + + # 4) HTML template (no external CSS/JS links; we inline them) $htmlTemplate = @" @@ -1068,20 +1065,19 @@ function Get-UIHtml { Script Monkey - + - - +
-
- SVS Logo + SVS Logo {{moduleVersion}}
-
Script Automation Monkey (Yeah!)
@@ -1128,7 +1124,7 @@ function Get-UIHtml {
- +

Off-Boarding

@@ -1166,19 +1162,16 @@ function Get-UIHtml {
- - - - -
@@ -1188,18 +1181,18 @@ function Get-UIHtml { "@ - # - # 4) Replace placeholders - # + # 5) Replace placeholders $html = $htmlTemplate - $html = $html.Replace('{{moduleVersion}}', (Get-ModuleVersionHtml)) - $html = $html.Replace('{{onboardLeftColumn}}', $onboardLeft) - $html = $html.Replace('{{onboardRightColumn}}', $onboardRight) - $html = $html.Replace('{{offboardCheckboxes}}', $offboard) - $html = $html.Replace('{{tweaksCheckboxes}}', $tweaks) - $html = $html.Replace('{{appsCheckboxes}}', $apps) - $html = $html.Replace('{{tasksJsAll}}', $tasksJsAll) - $html = $html.Replace('{{defaultPage}}', $Page) + $html = $html.Replace("{{moduleVersion}}", (Get-ModuleVersionHtml)) + $html = $html.Replace("{{onboardLeftColumn}}", $onboardLeft) + $html = $html.Replace("{{onboardRightColumn}}", $onboardRight) + $html = $html.Replace("{{offboardCheckboxes}}", $offboard) + $html = $html.Replace("{{tweaksCheckboxes}}", $tweaks) + $html = $html.Replace("{{appsCheckboxes}}", $apps) + $html = $html.Replace("{{tasksJsAll}}", $tasksJsAll) + $html = $html.Replace("{{defaultPage}}", $Page) + $html = $html.Replace("{{INLINE_STYLE}}", $styleContent) + $html = $html.Replace("{{INLINE_SCRIPT}}", $scriptContent) return $html }