From b087e0ae5436079a7018e16eb9e13938b6f33d19 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Wed, 26 Nov 2025 17:58:30 -0500 Subject: [PATCH] Update samy.ps1 --- samy.ps1 | 803 +++++++------------------------------------------------ 1 file changed, 90 insertions(+), 713 deletions(-) diff --git a/samy.ps1 b/samy.ps1 index 8b99a3a..2e65d77 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1033,634 +1033,35 @@ Write-LogHybrid "Tasks by page: onboard=$( #endregion Strat-Server - #region UIHtml +#region UIHtml + function Get-UIHtml { - param([string]$Page = 'onboard') -if (-not $Page) { $Page = 'onboard' } - -# no spaces before $style -$style = @' - - - -'@ - -# no spaces before $script -$script = @' - - -'@ - -# no spaces before $htmlTemplate -$htmlTemplate = @" + # + # 3) HTML template that references external CSS/JS hosted on Gitea + # (adjust the URLs to match your repo + branch) + # + $htmlTemplate = @" @@ -1668,7 +1069,9 @@ $htmlTemplate = @" Script Monkey -$style + + +
@@ -1679,12 +1082,11 @@ $style
-
+
Script Automation Monkey (Yeah!)
-
-
- - -
-

Off-Boarding

-
-
-

Remove Stack

- -{{offboardCheckboxes}} +
+

Off-Boarding

+
+
+

Remove Stack

+ + {{offboardCheckboxes}} +
+
-
-
- -

Tweaks

@@ -1762,7 +1154,6 @@ $style
-

SVS APPs

@@ -1772,63 +1163,49 @@ $style
- - + -$script - + + + + + + + +
- - - - "@ - # - # 4) Build the checkbox HTML and tasks JS from $Global:SamyTasks - # + # + # 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) - # On-boarding now has two columns: - $onboardLeft = Build-Checkboxes -Page 'onboard' -Column 'left' - $onboardRight = Build-Checkboxes -Page 'onboard' -Column 'right' - - # Off-boarding, Tweaks, SVSApps stay one-column: - $offboard = Build-Checkboxes -Page 'offboard' -Column '' - $tweaks = Build-Checkboxes -Page 'tweaks' -Column '' - $apps = Build-Checkboxes -Page 'SVSApps' -Column '' - - # Tasks JS array (fixed) - $tasksJsAll = ( - $Global:SamyTasks | ForEach-Object { - " { id: '$($_.Id)', handler: '/$($_.Name)', label: '$($_.Label)' }" - } - ) -join ",`n" - - - # - # 5) Inject into template - # - $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) + return $html +} - return $html - } - - #endregion UIHtml +#endregion UIHtml #region Handler Stubs