From df39509c26705a829b084dbf4add7b7cf22c8d66 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 29 Jun 2025 16:17:53 -0400 Subject: [PATCH] moved UIHtml --- StackMonkey.ps1 | 572 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 572 insertions(+) diff --git a/StackMonkey.ps1 b/StackMonkey.ps1 index b6eb07e..e859ae5 100644 --- a/StackMonkey.ps1 +++ b/StackMonkey.ps1 @@ -334,6 +334,578 @@ Write-LogHybrid "Listener closed." "Info" "Server" } } +#region UIHtml +function Get-UIHtml { + param([string]$Page = 'onboard') + + # + # 1) Inline your full original CSS here + # +$style = @' + +'@ + + +$script = @' + + +'@ + + # + # 3) The HTML skeleton with placeholders + # +$htmlTemplate = @" + + + + + +Script Monkey + +$style + + +
+ +
+ SVS Logo + {{moduleVersion}} +
+ + +
+ SAMY Logo +
Script Automation Monkey (Yeah!)
+
+ +
+
+ +
+ +
+
+

On-Boarding

+

This new deployment method ensures everything is successfully deployed with greater ease!

+ + +
+
+

SVSMSP Stack

+ + {{onboardLeftColumn}} +
+
+

Optional

+ + {{onboardRightColumn}} +
+
+ + + + + + + + + +
+

Off-Boarding

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

Tweaks

+
+{{tweaksCheckboxes}} +
+ +
+
+

SVS APPs

+
+{{appsCheckboxes}} +
+ +
+
+
+$script + +
+ + +
+ + + +"@ + + # + # 4) Build the checkbox HTML and tasks JS from $Global:Tasks + # + + # 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:Tasks | 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 + } + + #endregion UIHtml # Sends the HTML for a given page or invokes a task handler function Dispatch-Request {