Update samy.ps1
This commit is contained in:
14
samy.ps1
14
samy.ps1
@@ -975,11 +975,19 @@ function Get-UIHtml {
|
|||||||
#
|
#
|
||||||
# 2) Build the JS tasks array once (this is the only dynamic JS piece)
|
# 2) Build the JS tasks array once (this is the only dynamic JS piece)
|
||||||
#
|
#
|
||||||
$tasksJsAll = (
|
$tasksJson = @(
|
||||||
$Global:SamyTasks | ForEach-Object {
|
$Global:SamyTasks | ForEach-Object {
|
||||||
" { id: '$($_.Id)', handler: '/$($_.Name)', label: '$($_.Label)' }"
|
[pscustomobject]@{
|
||||||
|
id = [string]$_.Id
|
||||||
|
handler = "/$([string]$_.Name)"
|
||||||
|
label = [string]$_.Label
|
||||||
}
|
}
|
||||||
) -join ",`n"
|
}
|
||||||
|
) | ConvertTo-Json -Depth 4
|
||||||
|
|
||||||
|
# If you still want to keep the variable name "tasksJsAll", just store JSON in it:
|
||||||
|
$tasksJsAll = $tasksJson
|
||||||
|
|
||||||
|
|
||||||
# Human friendly branch label for UI
|
# Human friendly branch label for UI
|
||||||
$branchDisplay = switch ($Script:SamyBranch.ToLower()) {
|
$branchDisplay = switch ($Script:SamyBranch.ToLower()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user