diff --git a/samy.ps1 b/samy.ps1 index 55466b5..ae42add 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1039,25 +1039,28 @@ 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) 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) + # + # 3) HTML template that references external CSS/JS hosted on Gitea + # (adjust the URLs to match your repo + branch) + # $htmlTemplate = @" @@ -1065,19 +1068,20 @@ function Get-UIHtml { Script Monkey - + - + +
+
- SVS Logo + SVS Logo {{moduleVersion}}
+
Script Automation Monkey (Yeah!)
@@ -1124,7 +1128,7 @@ function Get-UIHtml {
- +

Off-Boarding

@@ -1162,16 +1166,19 @@ function Get-UIHtml {
+ + + + +
@@ -1181,18 +1188,18 @@ function Get-UIHtml { "@ - # 5) Replace placeholders + # + # 4) 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("{{INLINE_STYLE}}", $styleContent) - $html = $html.Replace("{{INLINE_SCRIPT}}", $scriptContent) + $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) return $html }