Skip to content

Commit

Permalink
Fix issue with poshud.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Mar 30, 2020
1 parent 2028a0e commit 319b02b
Showing 1 changed file with 51 additions and 48 deletions.
99 changes: 51 additions & 48 deletions src/poshud/dashboard.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,65 @@ function New-ComponentPage {
[string[]]$Cmdlet)

New-UDPage -Name $Title -Content {
New-AppBar -Title $title
New-UDContainer {
New-AppBar -Title $title

New-UDElement -tag 'div' -Attributes @{ style = @{ marginTop = '20px' }} -Content {
New-UDTypography -Text $Title -Variant 'h2'
}
New-UDElement -tag 'div' -Attributes @{ style = @{ marginTop = '20px' }} -Content {
New-UDTypography -Text $Title -Variant 'h2'
}

New-UDElement -tag 'div' -Attributes @{ style = @{ marginTop = '20px' }} -Content {
New-UDTypography -Text $Description -Variant 'h4'
}

New-UDElement -tag 'div' -Attributes @{ style = @{ marginTop = '20px' }} -Content {
New-UDElement -Tag 'div' -Content { $SecondDescription }
}

New-UDElement -tag 'div' -Attributes @{ style = @{ marginTop = '20px' }} -Content {
New-UDTypography -Text $Description -Variant 'h4'
}
& $Content

New-UDElement -tag 'div' -Attributes @{ style = @{ marginTop = '20px' }} -Content {
New-UDElement -Tag 'div' -Content { $SecondDescription }
}

& $Content

$Columns = @(
New-UDTableColumn -Title 'Name' -Property 'name'
New-UDTableColumn -Title 'Type' -Property 'type'
New-UDTableColumn -Title 'Description' -Property 'description' -Render {
$Row = $Body | ConvertFrom-Json
if ($Row.description)
{
New-UDTypography -Text $Row.description
}
else
{
New-UDElement -tag 'div' -Content {}
$Columns = @(
New-UDTableColumn -Title 'Name' -Property 'name'
New-UDTableColumn -Title 'Type' -Property 'type'
New-UDTableColumn -Title 'Description' -Property 'description' -Render {
$Row = $Body | ConvertFrom-Json
if ($Row.description)
{
New-UDTypography -Text $Row.description
}
else
{
New-UDElement -tag 'div' -Content {}
}
}
New-UDTableColumn -Title 'Required' -Property 'required'
)

New-UDElement -Tag 'div' -Attributes @{ style = @{ marginTop = "20px"; marginBottom = "20px"}} -Content {
New-UDTypography -Text 'Parameters' -Variant h4
}
New-UDTableColumn -Title 'Required' -Property 'required'
)

New-UDElement -Tag 'div' -Attributes @{ style = @{ marginTop = "20px"; marginBottom = "20px"}} -Content {
New-UDTypography -Text 'Parameters' -Variant h4
}

foreach($item in $Cmdlet)
{
$Parameters = (Get-Command $item).Parameters.GetEnumerator() | ForEach-Object {
$Parameter = $_.Key

$Help = Get-Help -Name $item -Parameter $Parameter
foreach($item in $Cmdlet)
{
$Parameters = (Get-Command $item).Parameters.GetEnumerator() | ForEach-Object {
$Parameter = $_.Key

@{
name = $Help.name
type = $Help.type.name
description = $Help.description.text
required = $Help.required
$Help = Get-Help -Name $item -Parameter $Parameter -ErrorAction SIlentlyContinue

if ($null -ne $Help)
{
@{
name = $Help.name
type = $Help.type.name
description = $Help.description.text
required = $Help.required
}
}
}
}

New-UDTable -Title $item -Data $Parameters -Columns $Columns
}

New-UDTable -Title $item -Data $Parameters -Columns $Columns
}
}
}
}

Expand Down Expand Up @@ -158,8 +163,6 @@ function New-AppBar {
} -Drawer $Drawer
}



$Pages = @()
$Pages += New-UDPage -Name "PowerShell Universal Dashboard" -Content {
New-AppBar -Title "PowerShell Universal Dashboard"
Expand Down

0 comments on commit 319b02b

Please sign in to comment.