From 739d1783380f6fe07f87f3d719936b02b34bb3d7 Mon Sep 17 00:00:00 2001 From: Adam Driscoll Date: Thu, 20 Jun 2019 07:10:35 -0600 Subject: [PATCH] Help for a bunch more controls. --- .../Help/New-UDGridLayout.md | 4 +- src/UniversalDashboard/Help/New-UDHtml.md | 2 +- src/UniversalDashboard/Help/New-UDIFrame.md | 2 +- src/UniversalDashboard/Help/New-UDImage.md | 9 +- src/UniversalDashboard/Help/New-UDInput.md | 22 ++- src/UniversalDashboard/Help/New-UDMonitor.md | 10 +- .../Help/New-UDPreloader.md | 20 +- src/UniversalDashboard/Help/New-UDRadio.md | 35 +++- src/UniversalDashboard/Help/New-UDRow.md | 16 +- src/UniversalDashboard/Help/New-UDSelect.md | 6 +- src/UniversalDashboard/Help/New-UDSwitch.md | 13 +- .../Help/New-UDTabContainer.md | 20 +- src/UniversalDashboard/Help/New-UDTable.md | 12 +- src/UniversalDashboard/Help/New-UDTextbox.md | 4 +- src/UniversalDashboard/Help/New-UDTreeView.md | 8 +- src/UniversalDashboard/Help/Show-UDModal.md | 49 ++++- src/UniversalDashboard/Help/Show-UDToast.md | 9 + src/poshud/dashboard.ps1 | 160 ++-------------- src/poshud/pages/button.ps1 | 50 ----- src/poshud/pages/card.ps1 | 79 -------- src/poshud/pages/chart-updated.ps1 | 78 -------- src/poshud/pages/charts.ps1 | 61 ------ src/poshud/pages/checkbox.ps1 | 31 --- src/poshud/pages/collapsible.ps1 | 21 -- src/poshud/pages/collection.ps1 | 57 ------ src/poshud/pages/components.ps1 | 179 ------------------ src/poshud/pages/counters.ps1 | 24 --- src/poshud/pages/elements.ps1 | 84 -------- src/poshud/pages/formatting.ps1 | 41 ---- src/poshud/pages/grids.ps1 | 122 ------------ src/poshud/pages/icon.ps1 | 70 ------- src/poshud/pages/images.ps1 | 9 - src/poshud/pages/inputs.ps1 | 59 ------ src/poshud/pages/monitors.ps1 | 24 --- src/poshud/pages/preloader.ps1 | 51 ----- src/poshud/pages/radio.ps1 | 20 -- src/poshud/pages/restapis.ps1 | 46 ----- src/poshud/pages/select.ps1 | 23 --- src/poshud/pages/switch.ps1 | 18 -- src/poshud/pages/tables.ps1 | 46 ----- src/poshud/pages/textbox.ps1 | 21 -- 41 files changed, 197 insertions(+), 1418 deletions(-) delete mode 100644 src/poshud/pages/button.ps1 delete mode 100644 src/poshud/pages/card.ps1 delete mode 100644 src/poshud/pages/chart-updated.ps1 delete mode 100644 src/poshud/pages/charts.ps1 delete mode 100644 src/poshud/pages/checkbox.ps1 delete mode 100644 src/poshud/pages/collapsible.ps1 delete mode 100644 src/poshud/pages/collection.ps1 delete mode 100644 src/poshud/pages/components.ps1 delete mode 100644 src/poshud/pages/counters.ps1 delete mode 100644 src/poshud/pages/elements.ps1 delete mode 100644 src/poshud/pages/formatting.ps1 delete mode 100644 src/poshud/pages/grids.ps1 delete mode 100644 src/poshud/pages/icon.ps1 delete mode 100644 src/poshud/pages/images.ps1 delete mode 100644 src/poshud/pages/inputs.ps1 delete mode 100644 src/poshud/pages/monitors.ps1 delete mode 100644 src/poshud/pages/preloader.ps1 delete mode 100644 src/poshud/pages/radio.ps1 delete mode 100644 src/poshud/pages/restapis.ps1 delete mode 100644 src/poshud/pages/select.ps1 delete mode 100644 src/poshud/pages/switch.ps1 delete mode 100644 src/poshud/pages/tables.ps1 delete mode 100644 src/poshud/pages/textbox.ps1 diff --git a/src/UniversalDashboard/Help/New-UDGridLayout.md b/src/UniversalDashboard/Help/New-UDGridLayout.md index 56a8cf33..80d8003a 100644 --- a/src/UniversalDashboard/Help/New-UDGridLayout.md +++ b/src/UniversalDashboard/Help/New-UDGridLayout.md @@ -21,9 +21,7 @@ New-UDGridLayout [[-Id] ] [[-RowHeight] ] [[-Content] Hi! I'm HTML' +New-UDHtml -Markup "

Hi! I'm HTML

" ``` Creates header text in the dashboard. diff --git a/src/UniversalDashboard/Help/New-UDIFrame.md b/src/UniversalDashboard/Help/New-UDIFrame.md index ff54eda7..311e611e 100644 --- a/src/UniversalDashboard/Help/New-UDIFrame.md +++ b/src/UniversalDashboard/Help/New-UDIFrame.md @@ -23,7 +23,7 @@ Creates a new iframe. ### Example 1 ``` -New-UDIFrame -Uri https://www.google.com +New-UDIFrame -Uri https://www.ironmansoftware.com ``` Creates an iframe that embeds Google. diff --git a/src/UniversalDashboard/Help/New-UDImage.md b/src/UniversalDashboard/Help/New-UDImage.md index 9395df7f..9c4bc08d 100644 --- a/src/UniversalDashboard/Help/New-UDImage.md +++ b/src/UniversalDashboard/Help/New-UDImage.md @@ -31,7 +31,7 @@ Renders an image in the dashboard. ### Example 1 ``` -New-UDImage -Url "http://www.google.com/logo.png" -Height 50 -Width 50 +New-UDImage -Url "https://i1.wp.com/ironmansoftware.com/wp-content/uploads/2019/01/dsl.png" -Height 50 -Width 50 ``` Inserts the Google logo and sizes it to 50px by 50px. @@ -43,13 +43,6 @@ New-UDImage -Height 125 -Width 125 -Url "data:image/svg+xml;base64,PHN2ZyB3aWR0a Inserts an SVG, base64 logo and sizes it to 50px by 50px. -### Example 3 -``` -New-UDImage -Height 125 -Width 125 -Path ".\my_image.png" -``` - -Inserts my_image.png from the local machine. - ## PARAMETERS ### -Attributes diff --git a/src/UniversalDashboard/Help/New-UDInput.md b/src/UniversalDashboard/Help/New-UDInput.md index a986c63c..a710fdc5 100644 --- a/src/UniversalDashboard/Help/New-UDInput.md +++ b/src/UniversalDashboard/Help/New-UDInput.md @@ -32,7 +32,27 @@ New-UDInput -Title "User Information" -Endpoint { } ``` -Accepts user input and sends the data to another server. The endpoint then returns a toast message to the client. +Accepts user input and a toast message to the client. + + +### Custom Input Fields +``` +New-UDInput -Title "User Information" -Content { + New-UDInputField -Type textbox -Name FirstName -Placeholder 'First Name' + New-UDInputField -Type textbox -Name LastName -Placeholder 'Last Name' + New-UDInputField -Type textbox -Name Address -Placeholder 'Address' + New-UDInputField -Type textbox -Name PhoneNumber -Placeholder 'Phone Number' + New-UDInputField -Type password -Name Password -Placeholder 'Password' + New-UDInputField -Type date -Name StartDate -Placeholder 'Start Date' + New-UDInputField -Type time -Name StartTime -Placeholder 'Start Time' +} -Endpoint { + param($FirstName, $LastName, $Address, $PhoneNumber, $Password, $StartDate, $StartTime) + + New-UDInputAction -Toast "Record saved! $FirstName, $LastName, $Address, $PhoneNumber, $Password, $StartDate, $StartTime" +} +``` + +Users custom input fields to configure the form and then sends a toast to the user when the button is clicked. ## PARAMETERS diff --git a/src/UniversalDashboard/Help/New-UDMonitor.md b/src/UniversalDashboard/Help/New-UDMonitor.md index 569732a3..fd1a4d87 100644 --- a/src/UniversalDashboard/Help/New-UDMonitor.md +++ b/src/UniversalDashboard/Help/New-UDMonitor.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDMonitor.md schema: 2.0.0 --- @@ -26,14 +26,14 @@ Creates a live updating chart that shows a single type of data. This is paired ## EXAMPLES -### Example 1 +### Basic Monitor ``` -PS C:\> New-UDMonitor -Type Line -Title "CPU" -RefreshInterval 1 -DataPointHistory 100 -Endpoint { - Get-Counter '\Memory\Available MBytes' | Select-Object -ExpandProperty CounterSamples | Select -ExpandProperty CookedValue | Out-UDMonitorData +New-UDMonitor -Type Line -Title "CPU" -RefreshInterval 1 -DataPointHistory 100 -Endpoint { + Get-Random | Out-UDMonitorData } ``` -Displays available memory in megabytes for the machine. +Displays random data on the monitor. ## PARAMETERS diff --git a/src/UniversalDashboard/Help/New-UDPreloader.md b/src/UniversalDashboard/Help/New-UDPreloader.md index 93d17f3d..d9d29978 100644 --- a/src/UniversalDashboard/Help/New-UDPreloader.md +++ b/src/UniversalDashboard/Help/New-UDPreloader.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDPreloader.md schema: 2.0.0 --- @@ -33,13 +33,27 @@ Creates a new preloader. Preloaders can be used to show progress or indicate to ## EXAMPLES -### Example 1 +### Percent Complete ``` -PS C:\> New-UDPreloader -PercentComplete 10 +New-UDPreloader -PercentComplete 10 ``` Creates a new determinate preloader with a percentage complete of 10. +### Indeterminate +``` +New-UDPreloader -ProgressColor red +``` + +Creates a preloader with a progress color set to red. + +### Circular +``` +New-UDPreloader -Color blue -Circular +``` + +Creates a blue, circular preloader. + ## PARAMETERS ### -BackgroundColor diff --git a/src/UniversalDashboard/Help/New-UDRadio.md b/src/UniversalDashboard/Help/New-UDRadio.md index fd02dbc9..b338e087 100644 --- a/src/UniversalDashboard/Help/New-UDRadio.md +++ b/src/UniversalDashboard/Help/New-UDRadio.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDRadio.md schema: 2.0.0 --- @@ -22,19 +22,42 @@ Creates a radio. Radios can be used to select between a set of items. They shoul ## EXAMPLES -### Example 1 +### Basic Radio ``` -PS C:\> New-UDRadio -Label 'Option 1' -Group 'Group 1' -PS C:\> New-UDRadio -Label 'Option 2' -Group 'Group 1' -PS C:\> New-UDRadio -Label 'Option 3' -Group 'Group 1' +New-UDRadio -Label 'Option 1' -Group 'Group 1' +New-UDRadio -Label 'Option 2' -Group 'Group 1' +New-UDRadio -Label 'Option 3' -Group 'Group 1' ``` Creates three options for a radio group. +### OnChange +``` +New-UDRadio -Label 'Option 1' -Group 'Group 1' -OnChange { Show-UDToast -Message $EventData } +New-UDRadio -Label 'Option 2' -Group 'Group 1' -OnChange { Show-UDToast -Message $EventData } +New-UDRadio -Label 'Option 3' -Group 'Group 1' -OnChange { Show-UDToast -Message $EventData } +``` + +Creates three options for a radio group with onChange event handlers. + + +### Multiple groupos +``` +New-UDRadio -Label 'Option 1' -Group 'Group 1' +New-UDRadio -Label 'Option 2' -Group 'Group 1' +New-UDRadio -Label 'Option 3' -Group 'Group 1' + +New-UDRadio -Label 'Option 1' -Group 'Group 2' +New-UDRadio -Label 'Option 2' -Group 'Group 2' +New-UDRadio -Label 'Option 3' -Group 'Group 2' +``` + +Creates three options for two radio groups. + ## PARAMETERS ### -Checked -{{Fill Checked Description}} +Whether the radio is checked. ```yaml Type: SwitchParameter diff --git a/src/UniversalDashboard/Help/New-UDRow.md b/src/UniversalDashboard/Help/New-UDRow.md index 255453cc..ece2293b 100644 --- a/src/UniversalDashboard/Help/New-UDRow.md +++ b/src/UniversalDashboard/Help/New-UDRow.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDRow.md schema: 2.0.0 --- @@ -29,12 +29,12 @@ Creates a new row on the dashboard. Columns are defined with New-UDColumn. ### Example 1 ``` -PS C:\> New-UDRow { +New-UDRow { New-UDColumn -Size 6 { - + New-UDCard -Content {} -BackgroundColor black } New-UDColumn -Size 6 { - + New-UDCard -Content {} -BackgroundColor black } } ``` @@ -43,19 +43,19 @@ Defines a row with two columns are equal size. ### Example 2 ``` -PS C:\> New-UDRow { +New-UDRow { New-UDColumn -Size 6 { New-UDRow { New-UDColumn -Size 6 { - + New-UDCard -Content {} -BackgroundColor black } New-UDColumn -Size 6 { - + New-UDCard -Content {} -BackgroundColor black } } } New-UDColumn -Size 6 { - + New-UDCard -Content {} -BackgroundColor black } } ``` diff --git a/src/UniversalDashboard/Help/New-UDSelect.md b/src/UniversalDashboard/Help/New-UDSelect.md index ca792da8..931daba1 100644 --- a/src/UniversalDashboard/Help/New-UDSelect.md +++ b/src/UniversalDashboard/Help/New-UDSelect.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDSelect.md schema: 2.0.0 --- @@ -24,12 +24,12 @@ Creates a select. ### Example 1 ``` -PS C:\> New-UDSelect -Label "State" -Option { +New-UDSelect -Label "State" -Option { New-UDSelectOption -Name "Wisconsin" -Value 1 New-UDSelectOption -Name "Idaho" -Value 2 New-UDSelectOption -Name "Washington" -Value 3 } -OnChange { - $Session:State = $EventData + Show-UDToast -Message $EventData } ``` diff --git a/src/UniversalDashboard/Help/New-UDSwitch.md b/src/UniversalDashboard/Help/New-UDSwitch.md index 759081ea..820f4486 100644 --- a/src/UniversalDashboard/Help/New-UDSwitch.md +++ b/src/UniversalDashboard/Help/New-UDSwitch.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDSwitch.md schema: 2.0.0 --- @@ -22,13 +22,20 @@ Creates a switch control. Switches are similar in function to checkboxes but use ## EXAMPLES -### Example 1 +### Basic Switch ``` -PS C:\> New-UDSwitch -OnText "yes" -OffText "No" +New-UDSwitch -OnText "yes" -OffText "No" ``` Creates a switch that has yes and no as options. +### OnChange +``` +New-UDSwitch -OnText "yes" -OffText "No" -OnChange { Show-UDToast -Message $EventData } +``` + +Shows a toast when the switch is changed. + ## PARAMETERS ### -Disabled diff --git a/src/UniversalDashboard/Help/New-UDTabContainer.md b/src/UniversalDashboard/Help/New-UDTabContainer.md index 24154768..3ea30001 100644 --- a/src/UniversalDashboard/Help/New-UDTabContainer.md +++ b/src/UniversalDashboard/Help/New-UDTabContainer.md @@ -1,14 +1,14 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version:https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDTabContainer.md schema: 2.0.0 --- # New-UDTabContainer ## SYNOPSIS -{{ Fill in the Synopsis }} +Creates a tab container. ## SYNTAX @@ -17,21 +17,25 @@ New-UDTabContainer -Tabs [-Id ] [] ``` ## DESCRIPTION -{{ Fill in the Description }} +Creates a tab container. Use New-UDTab to create tabs within the tab container. ## EXAMPLES -### Example 1 +### Basic Tabs ```powershell -PS C:\> {{ Add example code here }} +New-UDTabContainer -Tabs { + New-UDTab -Text 'Tab 1' -Content { New-UDHeading -Text 'Tab 1 Content' } + New-UDTab -Text 'Tab 2' -Content { New-UDHeading -Text 'Tab 2 Content' } + New-UDTab -Text 'Tab 3' -Content { New-UDHeading -Text 'Tab 3 Content' } +} ``` -{{ Add example description here }} +Creates a tab container with 3 tabs. ## PARAMETERS ### -Id -{{ Fill Id Description }} +ID of this component. ```yaml Type: String @@ -46,7 +50,7 @@ Accept wildcard characters: False ``` ### -Tabs -{{ Fill Tabs Description }} +The tabs for this container. Use New-UDTab to create the tabs. ```yaml Type: ScriptBlock diff --git a/src/UniversalDashboard/Help/New-UDTable.md b/src/UniversalDashboard/Help/New-UDTable.md index 2e458426..15c76695 100644 --- a/src/UniversalDashboard/Help/New-UDTable.md +++ b/src/UniversalDashboard/Help/New-UDTable.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDTable.md schema: 2.0.0 --- @@ -33,8 +33,14 @@ Creates a new table of data within the dashboard. ### Example 1 ``` -PS C:\> New-UDTable -Title "Process Ids" -Header @("Name", "Process Id") -Endpoint { - Get-Process -Name Chrome | Out-UDTableData -Property @("name", "id") +New-UDTable -Title "Process Ids" -Header @("Name", "Process Id") -Endpoint { + $Data = @( + [PSCustomObject]@{ name = "Chrome"; id = 12352 } + [PSCustomObject]@{ name = "devenv"; id = 342 } + [PSCustomObject]@{ name = "code"; id = 634532 } + [PSCustomObject]@{ name = "powershell_ise"; id = 345342 } + ) + $Data | Out-UDTableData -Property @("name", "id") } ``` diff --git a/src/UniversalDashboard/Help/New-UDTextbox.md b/src/UniversalDashboard/Help/New-UDTextbox.md index 4216d32b..0e53ff48 100644 --- a/src/UniversalDashboard/Help/New-UDTextbox.md +++ b/src/UniversalDashboard/Help/New-UDTextbox.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDTextbox.md schema: 2.0.0 --- @@ -24,7 +24,7 @@ Creates a textbox. ### Example 1 ``` -PS C:\> New-UDTextbox -Label "Textbox" -Placeholder "Enter your name" +New-UDTextbox -Label "Textbox" -Placeholder "Enter your name" ``` Creates a new textbox that has a placeholder asking to enter the user's name. diff --git a/src/UniversalDashboard/Help/New-UDTreeView.md b/src/UniversalDashboard/Help/New-UDTreeView.md index 76bf8a6f..5e71a4c9 100644 --- a/src/UniversalDashboard/Help/New-UDTreeView.md +++ b/src/UniversalDashboard/Help/New-UDTreeView.md @@ -1,7 +1,7 @@ --- external help file: UniversalDashboard.Community-help.xml Module Name: UniversalDashboard.Community -online version: https://go.microsoft.com/fwlink/?LinkID=217032 +online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDTreeView.md schema: 2.0.0 --- @@ -24,15 +24,15 @@ Creates a tree view control. ## EXAMPLES -### Example 1 +### Basic Tree View ``` -PS C:\> New-UDTreeView -Node { +New-UDTreeView -Node ( New-UDTreeNode -Name "Root Node" -Children { New-UDTreeNode -Name "Child 1" New-UDTreeNode -Name "Child 2" New-UDTreeNode -Name "Child 3" } -} +) ``` Creates a tree view with 3 children nodes. diff --git a/src/UniversalDashboard/Help/Show-UDModal.md b/src/UniversalDashboard/Help/Show-UDModal.md index 95784fa3..8f0d70b2 100644 --- a/src/UniversalDashboard/Help/Show-UDModal.md +++ b/src/UniversalDashboard/Help/Show-UDModal.md @@ -23,12 +23,12 @@ Shows a modal. This can be called from any endpoint. ## EXAMPLES -### Example 1 +### Basic Modal ``` -PS C:\> New-UDButton -Text "Show Modal" -OnClick { +New-UDButton -Text "Show Modal" -OnClick { Show-UDModal -Header { New-UDHeading -Size 4 -Text "Modal" - } -Context { + } -Content { "This is a modal" } } @@ -36,6 +36,49 @@ PS C:\> New-UDButton -Text "Show Modal" -OnClick { Shows a modal when the button is clicked. +### Bottom Sheet +``` +New-UDButton -Text "Show Modal" -OnClick { + Show-UDModal -Header { + New-UDHeading -Size 4 -Text "Modal" + } -Content { + "This is a modal" + } -BottomSheet +} +``` + +Shows a bottom sheet modal. + +### Persistent +``` +New-UDButton -Text "Show Modal" -OnClick { + Show-UDModal -Header { + New-UDHeading -Size 4 -Text "Modal" + } -Content { + New-UDButton -Text 'Hide Modal' -OnClick { + Hide-UDModal + } + } -Persistent +} +``` + +Shows a persistent modal. + +### Custom Width +``` +New-UDButton -Text "Show Modal" -OnClick { + Show-UDModal -Header { + New-UDHeading -Size 4 -Text "Modal" + } -Content { + New-UDButton -Text 'Hide Modal' -OnClick { + Hide-UDModal + } + } -Width 1000 -Height 1000 +} +``` + +Shows a custom width modal. + ## PARAMETERS ### -BackgroundColor diff --git a/src/UniversalDashboard/Help/Show-UDToast.md b/src/UniversalDashboard/Help/Show-UDToast.md index e7519e31..1ce11a32 100644 --- a/src/UniversalDashboard/Help/Show-UDToast.md +++ b/src/UniversalDashboard/Help/Show-UDToast.md @@ -26,6 +26,15 @@ Shows a new toast message. ## EXAMPLES +### Basic toast +``` +New-UDButton -Text "Show Toast" -OnClick { + Show-UDToast -Message 'Toast' +} +``` + +Shows a basic toast. + ## PARAMETERS ### -BackgroundColor diff --git a/src/poshud/dashboard.ps1 b/src/poshud/dashboard.ps1 index 5d6b4369..e3914c7c 100644 --- a/src/poshud/dashboard.ps1 +++ b/src/poshud/dashboard.ps1 @@ -1,143 +1,8 @@ . (Join-Path $PSScriptRoot "utils.ps1") -$Colors = @{ - BackgroundColor = "#252525" - FontColor = "#FFFFFF" -} - -$AlternateColors = @{ - BackgroundColor = "#4081C9" - FontColor = "#FFFFFF" -} - -$ScriptColors = @{ - BackgroundColor = "#5A5A5A" - FontColor = "#FFFFFF" -} - $NavBarLinks = @((New-UDLink -Text "Buy Universal Dashboard" -Url "https://ironmansoftware.com/product/powershell-universal-dashboard/" -Icon heart_o), (New-UDLink -Text "Documentation" -Url "https://docs.universaldashboard.io" -Icon book)) -function New-UDElementExample { - param( - [ScriptBlock]$Example - ) - - $Example.Invoke() - - New-UDRow -Columns { - New-UDColumn -MediumSize 6 -SmallSize 12 -Content { - New-UDElement -Tag "pre" -Content { - $Example.ToString() - } -Attributes @{ - style = @{ - backgroundColor = $ScriptColors.BackgroundColor - color = $ScriptColors.FontColor - fontFamily = '"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace' - } - width = "80vw" - } - } - } -} - -function New-UDCodeSnippet { - param($Code) - - New-UDElement -Tag "pre" -Content { - $Code - } -Attributes @{ - className = "white-text" - style = @{ - backgroundColor = $ScriptColors.BackgroundColor - } - } -} - -function New-UDHeader { - param( - [Parameter(ParameterSetName = "content")] - [ScriptBlock]$Content, - [Parameter(ParameterSetName = "text")] - [string]$Text, - [Parameter()] - [ValidateRange(1,6)] - $Size, - [Parameter()] - $Color) - - if ($PSCmdlet.ParameterSetName -eq "text") { - New-UDElement -Tag "h$Size" -Content { $text } -Attributes @{ - style = @{ - color = $Color - } - } - } else { - New-UDElement -Tag "h$Size" -Content $Content -Attributes @{ - style = @{ - color = $Color - } - } - } -} - -function New-UDExample { - param($Title, $Description, $Script, [Switch]$NoRender) - - New-UDRow -Columns { - New-UDColumn -Size 2 {} - New-UDColumn -Size 6 -Content { - New-UDHeader -Text $Title -Size 2 -Color "white" - } - } - - New-UDRow -Columns { - New-UDColumn -Size 2 {} - New-UDColumn -Size 6 -Content { - New-UDHeader -Text $Description -Size 5 -Color "white" - } - } - - if (-not $NoRender) { - New-UDRow -Columns { - New-UDColumn -Size 3 -Content { } - New-UDColumn -Size 6 -Content { - . $Script - } - } - } - - New-UDRow -Columns { - New-UDColumn -Size 2 -Content { } - New-UDColumn -Size 8 -Content { - New-UDCodeSnippet -Code ($Script.ToString()) - } - } -} - -function New-UDPageHeader { - param($Title, $Icon, $Description, $DocLink) - - New-UDRow -Columns { - New-UDColumn -Size 2 {} - New-UDColumn -Size 8 -Content { - New-UDHeader -Content { - New-UDElement -Tag "i" -Attributes @{ className = "fa fa-$Icon" } - " $Title" - } -Size 1 -Color "white" - - New-UDHeader -Text $Description -Size 5 -Color "white" - New-UDHeader -Content { - New-UDElement -Tag "a" -Attributes @{ "href" = $DocLink } -Content { - New-UDElement -Tag "i" -Attributes @{ className = "fa fa-book" } - " Documentation" - } - } -Size 6 -Color "white" - - } - } -} - $Pages = @() $Pages += . (Join-Path $PSScriptRoot "pages\home.ps1") $Pages += . (Join-Path $PSScriptRoot "pages\getting-started.ps1") @@ -162,12 +27,25 @@ $Components = @() 'New-UDImage', 'New-UDImageCarousel', 'New-UDInput', - 'New-UDLink') | Sort-Object | ForEach-Object { + 'New-UDLink', + 'New-UDMonitor', + 'New-UDPreloader', + 'New-UDRadio', + 'New-UDRow', + 'New-UDSelect', + 'New-UDSwitch', + 'New-UDTabContainer', + 'New-UDTable', + 'New-UDTextbox', + 'New-UDTreeview') | Sort-Object | ForEach-Object { $Page = New-UDComponentPage -Command $_ $Components += New-UDSideNavItem -Text $_.Split('-')[1].Substring(2) -Url $_ $Pages += $Page } +$Pages += (New-UDComponentPage -Command "Show-UDModal") +$Pages += (New-UDComponentPage -Command "Show-UDToast") + $Navigation = New-UDSideNav -Content { New-UDSideNavItem -Text "Home" -Url "Home" -Icon home New-UDSideNavItem -SubHeader -Text "Dashboards" -Children { @@ -175,16 +53,14 @@ $Navigation = New-UDSideNav -Content { } New-UDSideNavItem -SubHeader -Text "About Universal Dashboard" -Icon question -Children { New-UDSideNavItem -Text "Getting Started" -Url "Getting-Started" - #New-UDSideNavItem -Text "Licensing" -Url "Licensing" } New-UDSideNavItem -SubHeader -Text "UI Components" -Icon window_maximize -Children { $Components } - # New-UDSideNavItem -SubHeader -Text "Utilities" -Icon wrench -Children { - # New-UDSideNavItem -Text "REST APIs" -Url "rest" - # New-UDSideNavItem -Text "Scheduled Endpoints" -Url "scheduled-endpoints" - # New-UDSideNavItem -Text "Published Folders" -Url "published-folders" - # } + New-UDSideNavItem -SubHeader -Text "Utilities" -Icon wrench -Children { + New-UDSideNavItem -Text "Modals" -Url "Show-UDModal" + New-UDSideNavItem -Text "Toasts" -Url "Show-UDToast" + } } -Fixed $EndpointInitialization = New-UDEndpointInitialization -Function "New-UDComponentExample" diff --git a/src/poshud/pages/button.ps1 b/src/poshud/pages/button.ps1 deleted file mode 100644 index 0a7230d4..00000000 --- a/src/poshud/pages/button.ps1 +++ /dev/null @@ -1,50 +0,0 @@ - -New-UDPage -Name "Button" -Icon plus_circle -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Buttons" -Color $Colors.FontColor - - New-UDParagraph -Content { - "There are 3 main button types described in material design. The raised button is a standard button that signify actions and seek to give depth to a mostly flat page. The floating circular action button is meant for very important functions. Flat buttons are usually used within elements that already have depth like cards or modals." - } -Color $Colors.FontColor - - New-UDHeading -Size 3 -Text "Raised" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDButton -Text "Button" - New-UDButton -Text "Button" -Icon cloud -IconAlignment left - New-UDButton -Text "Button" -Icon cloud -IconAlignment right - } - - New-UDHeading -Size 3 -Text "Floating" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDButton -Floating -Icon plus - } - - New-UDHeading -Size 3 -Text "Flat" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Flat buttons are used to reduce excessive layering. For example, flat buttons are usually used for actions within a card or modal so there aren't too many overlapping shadows." - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDButton -Text "Button" -Flat - } - - New-UDHeading -Size 3 -Text "OnClick Event" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Tie ScriptBlocks to an OnClick event." - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDHeading -Size 5 -Id "ShowOnClick" -Text "" - New-UDButton -Text "Button" -OnClick { - Set-UDElement -Id "ShowOnClick" -Content { "You clicked the button!" } - } - } - } - } -} diff --git a/src/poshud/pages/card.ps1 b/src/poshud/pages/card.ps1 deleted file mode 100644 index fc070581..00000000 --- a/src/poshud/pages/card.ps1 +++ /dev/null @@ -1,79 +0,0 @@ - -New-UDPage -Name "Card" -Icon clone -Content { - New-UDRow -Columns { - New-UDColumn -Size 3 -Content {} - New-UDColumn -Size 6 -Content { - New-UDHeading -Size 1 -Text "Cards" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Cards are a convenient means of displaying content composed of different types of objects. They’re also well-suited for presenting similar objects whose size or supported actions can vary considerably, like photos with captions of variable length." - } -Color $Colors.FontColor - - New-UDHeading -Size 3 -Text "Basic Card" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCard -Title 'Card Title' -Content { - New-UDParagraph -Text 'I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.' - } -Links @( - New-UDLink -Text 'This is a link' -Url '#!' - New-UDLink -Text 'This is a link' -Url '#!' - ) -Size 'small' - } - - New-UDHeading -Size 3 -Text "Image Card" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Here is the standard card with an image thumbnail." - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCard -Title 'Card Title' -Image (New-UDImage -Url 'http://materializecss.com/images/sample-1.jpg') -Content { - 'I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.' - } -Links @( - New-UDLink -Text 'This is a link' -Url '#!' - New-UDLink -Text 'This is a link' -Url '#!' - ) -Size 'small' - } - - New-UDHeading -Size 3 -Text "Reveal" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Here you can add a card that reveals more information once clicked. " - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCard -Title 'Card Title' -Image (New-UDImage -Url 'http://materializecss.com/images/sample-1.jpg' -Attributes @{className = 'activator'}) -Content { - 'Here is some basic text' - } -Reveal { - "Here is some more information about this product that is only revealed once clicked on." - } -RevealTitle 'Reveal Title' -Size 'small' - } - - New-UDHeading -Size 3 -Text "Text Size" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Here is a card with text size of Small" - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCard -Text 'Small Text Size' -TextSize Small - } - - New-UDParagraph -Content { - "Here is a card with text size of Medium" - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCard -Text 'Medium Text Size' -TextSize Medium - } - - New-UDParagraph -Content { - "Here is a card with text size of Large" - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCard -Text 'Large Text Size' -TextSize Large - } - } - } -} diff --git a/src/poshud/pages/chart-updated.ps1 b/src/poshud/pages/chart-updated.ps1 deleted file mode 100644 index c7b86fe1..00000000 --- a/src/poshud/pages/chart-updated.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -New-UDPage -Name 'Chart.v2' -Icon barcode -Content { - - # Main Chart full width custom height. - new-udrow -Columns { - New-UDChart -Title "Feature by operating system" -Type Line -AutoRefresh -RefreshInterval 7 @Colors -Endpoint { - $features = @(); - $features += [PSCustomObject]@{ "OperatingSystem" = "Windows 10"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features += [PSCustomObject]@{ "OperatingSystem" = "Windows 8"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features += [PSCustomObject]@{ "OperatingSystem" = "Windows 7"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features += [PSCustomObject]@{ "OperatingSystem" = "Ubuntu 16.04"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features| Out-UDChartData -LabelProperty "OperatingSystem" -Dataset @( - New-UDChartDataset -DataProperty "FormsDesigner" -Label "Forms Designer" -BackgroundColor "#0288d1" -HoverBackgroundColor "#0d47a1" -BorderColor '#01579b' - New-UDChartDataset -DataProperty "WPFDesigner" -Label "WPF Designer" -BackgroundColor "#00b0ff" -HoverBackgroundColor "#fff" -BorderColor '#01579b' - New-UDChartDataset -DataProperty "UniversalDashboard" -Label "Universal Dashboard" -BackgroundColor "#4fc3f7" -HoverBackgroundColor "#004d40" -BorderColor '#01579b' - ) - } -Width 99vw -Height 560px -Links @( - New-UDLink -Icon github_alt -Url 'https://github.com' -Text GitHub -FontColor '#0277bd' - ) - } - - # Second line custom width from chart & monitor. - new-udrow -Columns { - new-udcolumn -Content { - New-UDChart -Title "Demo" -Type Line -Endpoint { - 20..0 | ForEach-Object { - [PSCustomObject]@{ - Minute = " -$_" - PacketsPerSecond = (Get-Random -Minimum 50000 -Maximum 250000) - } - } | Out-UDChartData -LabelProperty "Minute" -DataProperty "PacketsPerSecond" -DatasetLabel "Packets per second" -BackgroundColor "#0277bd" -BorderColor "#03a9f4" -HoverBackgroundColor "#b3e5fc" -HoverBorderColor "#03a9f4" - } -BackgroundColor "#252525" -FontColor "#FFFFFF" -Width 48.5vw - } - - new-udcolumn -Content { - New-UDMonitor -Title "Downloads per second" -Type Line -Endpoint { - Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData - } -DataPointHistory 20 -RefreshInterval 5 -Width 48.5vw -ChartBackgroundColor "#0277bd" -ChartBorderColor "#03a9f4" -BackgroundColor "#252525" - } - } - - # Third line custom chart & monitor with width and height - New-UDRow -Columns { - New-UDColumn -Content { - New-UDChart -Title "Demo" -Type Bar -Endpoint { - 5..0 | ForEach-Object { - [PSCustomObject]@{ - Minute = " -$_" - PacketsPerSecond = (Get-Random -Minimum 50000 -Maximum 250000) - } - } | Out-UDChartData -LabelProperty "Minute" -DataProperty "PacketsPerSecond" -DatasetLabel "Packets per second" -BackgroundColor "#0277bd" -BorderColor "#03a9f4" -HoverBackgroundColor "#b3e5fc" -HoverBorderColor "#03a9f4" - } -BackgroundColor "#252525" -FontColor "#FFFFFF" -Width 16vw -Height 300px -Links @( - - New-UDlink -Url 'https://github.com/ironmansoftware/universal-dashboard' -Icon github -FontColor '#0277bd' - New-UDlink -Url 'https://github.com/ironmansoftware/universal-dashboard' -Icon code_fork -FontColor '#0277bd' - New-UDlink -Url 'https://github.com/ironmansoftware/universal-dashboard' -Icon book -FontColor '#0277bd' - New-UDlink -Url 'https://github.com/ironmansoftware/universal-dashboard' -Icon comments -FontColor '#0277bd' - - ) - } - New-UDColumn -Content { - New-UDChart -Title "Demo" -Type Bar -Endpoint { - 10..0 | ForEach-Object { - [PSCustomObject]@{ - Minute = " -$_" - PacketsPerSecond = (Get-Random -Minimum 50000 -Maximum 250000) - } - } | Out-UDChartData -LabelProperty "Minute" -DataProperty "PacketsPerSecond" -DatasetLabel "Packets per second" -BackgroundColor "#0277bd" -BorderColor "#03a9f4" -HoverBackgroundColor "#b3e5fc" -HoverBorderColor "#03a9f4" - } -BackgroundColor "#252525" -FontColor "#FFFFFF" -Width 30vw -Height 300px - } - New-UDColumn -Content { - New-UDMonitor -Title "Downloads per second" -Type Line -Endpoint { - Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData - } -DataPointHistory 20 -RefreshInterval 5 -Width 50vw -Height 300px -ChartBackgroundColor "#0277bd" -ChartBorderColor "#03a9f4" -BackgroundColor "#252525" -Links @( - New-UDLink -Icon github_alt -Url 'https://github.com' - ) -FontColor '#ffffff' - } - } -} \ No newline at end of file diff --git a/src/poshud/pages/charts.ps1 b/src/poshud/pages/charts.ps1 deleted file mode 100644 index c6d57d84..00000000 --- a/src/poshud/pages/charts.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -$BasicChart = { - New-UDChart -Title "Cost of Bitcoin" -Type Line -Endpoint { - - $30DaysBack = [DateTime]::Now.AddDays(-30) - 0..30 | ForEach-Object { - [PSCustomObject]@{ - Date = $30DaysBack.AddDays($_).ToShortDateString() - Price = (Get-Random -Minimum 5000 -Maximum 20000) - } - } | Out-UDChartData -LabelProperty "Date" -DataProperty "Price" -DatasetLabel "Price to USD" - } -} - -$AutoRefreshChart = { - New-UDChart -Title "People Living in Madison" -Type Line -Endpoint { - - $30DaysBack = [DateTime]::Now.AddYears(-30) - 0..30 | ForEach-Object { - [PSCustomObject]@{ - Year = $30DaysBack.AddDays($_).Year - Population = (Get-Random -Minimum 50000 -Maximum 250000) - } - } | Out-UDChartData -LabelProperty "Year" -DataProperty "Population" -DatasetLabel "Population" - } -AutoRefresh -RefreshInterval 5 -} - -$CustomColors = { - New-UDChart -Title "Packets per second" -Type Bar -Endpoint { - 30..0 | ForEach-Object { - [PSCustomObject]@{ - Minute = " -$_" - PacketsPerSecond = (Get-Random -Minimum 50000 -Maximum 250000) - } - } | Out-UDChartData -LabelProperty "Minute" -DataProperty "PacketsPerSecond" -DatasetLabel "Packets per second" -BackgroundColor "#FF0000" -BorderColor "#6F0000" -HoverBackgroundColor "#CC0786" -HoverBorderColor "#900786" - } -BackgroundColor "#252525" -FontColor "#FFFFFF" -} - - - -$MultiDatasetChart = { - New-UDChart -Title "Feature by operating system" -Type Line -AutoRefresh -RefreshInterval 7 @Colors -Endpoint { - $features = @(); - $features += [PSCustomObject]@{ "OperatingSystem" = "Windows 10"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features += [PSCustomObject]@{ "OperatingSystem" = "Windows 8"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features += [PSCustomObject]@{ "OperatingSystem" = "Windows 7"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features += [PSCustomObject]@{ "OperatingSystem" = "Ubuntu 16.04"; "FormsDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "WPFDesigner" = (Get-Random -Minimum 10 -Maximum 10000); "UniversalDashboard" = (Get-Random -Minimum 10 -Maximum 10000) } - $features| Out-UDChartData -LabelProperty "OperatingSystem" -Dataset @( - New-UDChartDataset -DataProperty "FormsDesigner" -Label "Forms Designer" -BackgroundColor "#80962F23" -HoverBackgroundColor "#80962F23" - New-UDChartDataset -DataProperty "WPFDesigner" -Label "WPF Designer" -BackgroundColor "#8014558C" -HoverBackgroundColor "#8014558C" - New-UDChartDataset -DataProperty "UniversalDashboard" -Label "Universal Dashboard" -BackgroundColor "#803AE8CE" -HoverBackgroundColor "#803AE8CE" - ) - } -} - -New-UDPage -Name "Charts" -Icon chart_area -Content { - New-UDPageHeader -Title "Charts" -Icon "area-chart" -Description "Visual data using dynamic charts based on ChartJS" -DocLink "https://docs.universaldashboard.io/components/data-visualizations/charts" - New-UDExample -Title "Basic Charts" -Description "Create basic charts from any type of data." -Script $BasicChart - New-UDExample -Title "Auto Refreshing Charts" -Description "Automatically refresh chart data on an interval" -Script $AutoRefreshChart - New-UDExample -Title "Custom colors" -Description "Adjust colors of different components within the chart." -Script $CustomColors - New-UDExample -Title "Multiple Datasets" -Description "Combine data from more than one dimension on a single chart." -Script $MultiDatasetChart -} \ No newline at end of file diff --git a/src/poshud/pages/checkbox.ps1 b/src/poshud/pages/checkbox.ps1 deleted file mode 100644 index 79c9a79e..00000000 --- a/src/poshud/pages/checkbox.ps1 +++ /dev/null @@ -1,31 +0,0 @@ - -New-UDPage -Name "Checkbox" -Icon check_square -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Checkboxes" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Use checkboxes when looking for yes or no answers. " - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCheckbox -Label Unchecked - New-UDCheckbox -Label Checked -Checked - New-UDCheckbox -Label 'Filled In' -Checked -FilledIn - New-UDCheckbox -Label 'Disabled' -Checked -FilledIn -Disabled - } - - New-UDHeading -Size 3 -Text "OnChange Event" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDElement -Id "CheckboxState" -Tag "span" - - New-UDCheckbox -Id CheckBox -Label "Check me" -OnChange { - $Element = Get-UDElement -Id CheckBox - Set-UDElement -Id "CheckboxState" -Content $Element.Attributes["checked"] - } - } - } - } -} diff --git a/src/poshud/pages/collapsible.ps1 b/src/poshud/pages/collapsible.ps1 deleted file mode 100644 index be5f8eaa..00000000 --- a/src/poshud/pages/collapsible.ps1 +++ /dev/null @@ -1,21 +0,0 @@ - -New-UDPage -Name "Collapsible" -Icon check_square -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Collapsible" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Collapsibles organize components into groups that you can hide. " - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCollapsible -Items { - New-UDCollapsibleItem -Title "" -Content { - "Hey!" - } - } - } - } - } -} diff --git a/src/poshud/pages/collection.ps1 b/src/poshud/pages/collection.ps1 deleted file mode 100644 index 600338b4..00000000 --- a/src/poshud/pages/collection.ps1 +++ /dev/null @@ -1,57 +0,0 @@ - -New-UDPage -Name "Collection" -Icon list -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Collections" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Collections allow you to group list objects together." - } -Color $Colors.FontColor - - New-UDHeading -Size 3 -Text "Basic" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCollection -Content { - New-UDCollectionItem -Content { "Alvin" } - New-UDCollectionItem -Content { "Alvin" } - New-UDCollectionItem -Content { "Alvin" } - New-UDCollectionItem -Content { "Alvin" } - } - } - - New-UDHeading -Size 3 -Text "Links" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCollection -LinkCollection -Content { - New-UDCollectionItem -Content { "Alvin" } -Url "#!" - New-UDCollectionItem -Content { "Alvin" } -Url "#!" -Active - New-UDCollectionItem -Content { "Alvin" } -Url "#!" - New-UDCollectionItem -Content { "Alvin" } -Url "#!" - } - } - - New-UDHeading -Size 3 -Text "Headers" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCollection -Content { - New-UDCollectionItem -Content { "Alvin" } - New-UDCollectionItem -Content { "Alvin" } - New-UDCollectionItem -Content { "Alvin" } - New-UDCollectionItem -Content { "Alvin" } - } -Header "First Names" - } - - New-UDHeading -Size 3 -Text "Secondary Content" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDCollection -Content { - New-UDCollectionItem -Content { "Alvin" } -SecondaryContent { New-UDIcon -Icon paper_plane } - New-UDCollectionItem -Content { "Alvin" } -SecondaryContent { New-UDIcon -Icon paper_plane } - New-UDCollectionItem -Content { "Alvin" } -SecondaryContent { New-UDIcon -Icon paper_plane } - New-UDCollectionItem -Content { "Alvin" } -SecondaryContent { New-UDIcon -Icon paper_plane } - } - } - } - } -} diff --git a/src/poshud/pages/components.ps1 b/src/poshud/pages/components.ps1 deleted file mode 100644 index bc5dd46c..00000000 --- a/src/poshud/pages/components.ps1 +++ /dev/null @@ -1,179 +0,0 @@ -$Components = New-UDPage -Name Components -Icon chart_area -Content { - New-UDHtml -Markup ' -' - - - New-UDRow { - New-UDColumn -Size 3 { - New-UDCard @AlternateColors -Title "Grids" -Text "Display data in a table that supports client and server side paging." - } - New-UDColumn -Size 9 { - New-UDCard @ScriptColors -Language "PowerShell" -Text 'New-UDGrid -Title "Customer Locations" @Colors -Headers @("Country", "Customers", "First Purchase Date") -Properties @("Country", "Customers", "FirstPurchaseDate") -AutoRefresh -RefreshInterval 20 -Endpoint { - Invoke-RestMethod http://myserver/api/myendpoint | Out-UDGridData -} ' -Title "PowerShell" - } - } - New-UDRow { - New-UDColumn -Size 12 { - New-UDGrid -Title "Customer Locations" @Colors -Headers @("Country", "Customers", "First Purchase Date") -Properties @("Country", "Customers", "FirstPurchaseDate") -AutoRefresh -RefreshInterval 20 -Endpoint { - - @( - @{ - Country = "MAURITANIA" - Customers = 262 - FirstPurchaseDate = "5/30/2017" - }, - @{ - Country = "NAURU" - Customers = 649 - FirstPurchaseDate = "9/11/2017" - }, - @{ - Country = "POLAND" - Customers = 92 - FirstPurchaseDate = "8/8/2017" - }, - @{ - Country = "SWITZERLAND" - Customers = 830 - FirstPurchaseDate = "5/8/2017" - }, - @{ - Country = "ISLE OF MAN" - Customers = 641 - FirstPurchaseDate = "7/13/2017" - }, - @{ - Country = "KYRGYZSTAN" - Customers = 857 - FirstPurchaseDate = "7/30/2017" - }, - @{ - Country = "GIBRALTAR" - Customers = 223 - FirstPurchaseDate = "9/3/2017" - }, - @{ - Country = "BAHRAIN" - Customers = 912 - FirstPurchaseDate = "9/10/2017" - }, - @{ - Country = "PAKISTAN" - Customers = 913 - FirstPurchaseDate = "6/9/2017" - }, - @{ - Country = "MALAWI" - Customers = 281 - FirstPurchaseDate = "6/14/2017" - }, - @{ - Country = "HONG KONG" - Customers = 255 - FirstPurchaseDate = "8/19/2017" - }, - @{ - Country = "DOMINICA" - Customers = 80 - FirstPurchaseDate = "8/3/2017" - }, - @{ - Country = "GHANA" - Customers = 275 - FirstPurchaseDate = "4/15/2017" - }, - @{ - Country = "ISRAEL" - Customers = 380 - FirstPurchaseDate = "5/11/2017" - }, - @{ - Country = "FRENCH POLYNESIA" - Customers = 155 - FirstPurchaseDate = "4/20/2017" - }, - @{ - Country = "PANAMA" - Customers = 130 - FirstPurchaseDate = "9/3/2017" - }, - @{ - Country = "ESTONIA" - Customers = 468 - FirstPurchaseDate = "8/12/2017" - }, - @{ - Country = "BANGLADESH" - Customers = 794 - FirstPurchaseDate = "7/29/2017" - }, - @{ - Country = "�LAND ISLANDS" - Customers = 989 - FirstPurchaseDate = "8/20/2017" - }, - @{ - Country = "ANGOLA" - Customers = 377 - FirstPurchaseDate = "4/22/2017" - } - - ) | Out-UDGridData - } - } - } - New-UDRow { - New-UDColumn -Size 3 { - New-UDCard @AlternateColors -Title "Tables" -Text "Display static table data. Refresh on a customizable interval." - } - New-UDColumn -Size 9 { - New-UDCard @ScriptColors -Language "PowerShell" -Text 'New-UDTable -Title "Top GitHub Issues" -Headers @("Id", "Title", "Description", "Comments") @Colors -Endpoint { - $issues = @(); - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Product is too awesome..."; "Description" = "Universal Desktop is just too awesome."; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Support for running on a PS4"; "Description" = "A dashboard on a PS4 would be pretty cool."; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Bug in the flux capacitor"; "Description" = "The flux capacitor is constantly crashing."; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Feature Request - Hypnotoad Widget"; "Description" = "Every dashboard needs more hypnotoad"; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - - $issues | Out-UDTableData -Property @("ID", "Title", "Description", "Comments") -}' -Title "PowerShell" - } - - } - New-UDRow { - New-UDColumn -Size 12 { - New-UDTable -Title "Top GitHub Issues" -Headers @("Id", "Title", "Description", "Comments") @Colors -Endpoint { - $issues = @(); - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Product is too awesome..."; "Description" = "Universal Desktop is just too awesome."; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Support for running on a PS4"; "Description" = "A dashboard on a PS4 would be pretty cool."; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Bug in the flux capacitor"; "Description" = "The flux capacitor is constantly crashing."; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - $issues += [PSCustomObject]@{ "ID" = (Get-Random -Minimum 10 -Maximum 10000); "Title" = "Feature Request - Hypnotoad Widget"; "Description" = "Every dashboard needs more hypnotoad"; Comments = (Get-Random -Minimum 10 -Maximum 10000) } - - $issues | Out-UDTableData -Property @("ID", "Title", "Description", "Comments") - } - } - } - New-UDRow { - New-UDColumn -Size 3 { - New-UDCard @AlternateColors -Title "Images" -Text "Display images from the web or from disk. Refresh images on the fly and generate them from endpoints." - } - New-UDColumn -Size 9 { - New-UDCard @ScriptColors -Language "PowerShell" -Text 'New-UDImage -Url https://poshtools.com/wp-content/uploads/2017/04/PoshToolsLogo-2.png -Height 100 -Width 100' -Title "PowerShell" - } - } - New-UDRow { - New-UDColumn -Size 3 { - New-UDImage -Url https://poshtools.com/wp-content/uploads/2017/04/PoshToolsLogo-2.png -Height 75 -Width 300 - } - New-UDColumn -Size 3 { - New-UDImage -Url https://poshtools.com/wp-content/uploads/2017/04/PoshToolsLogo-2.png -Height 75 -Width 300 - } - New-UDColumn -Size 3 { - New-UDImage -Url https://poshtools.com/wp-content/uploads/2017/04/PoshToolsLogo-2.png -Height 75 -Width 300 - } - New-UDColumn -Size 3 { - New-UDImage -Url https://poshtools.com/wp-content/uploads/2017/04/PoshToolsLogo-2.png -Height 75 -Width 300 - } - } -} \ No newline at end of file diff --git a/src/poshud/pages/counters.ps1 b/src/poshud/pages/counters.ps1 deleted file mode 100644 index 36428c04..00000000 --- a/src/poshud/pages/counters.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -$Basic = { - New-UDCounter -Title "Total Bytes Downloaded" -Endpoint { - Get-Random -Minimum 0 -Maximum 100000000 | ConvertTo-Json - } -FontColor "black" -} - -$AutoRefresh = { - New-UDCounter -Title "Total Bytes Uploaded" -AutoRefresh -RefreshInterval 3 -Endpoint { - Get-Random -Minimum 0 -Maximum 100000000 | ConvertTo-Json - } -FontColor "black" -} - -$Formatting = { - New-UDCounter -Title "Total Revenue" -Format '$0,0.00' -Icon money_bill -Endpoint { - Get-Random -Minimum 0 -Maximum 100000000 | ConvertTo-Json - } -FontColor "black" -} - -New-UDPage -Name "Counters" -Icon sort_numeric_down -Content { - New-UDPageHeader -Title "Counters" -Icon "sort-numeric-asc" -Description "Show a simple count in a card." -DocLink "https://github.com/adamdriscoll/universal-dashboard-documentation/blob/master/api/1.5.0/New-UDCounter.md" - New-UDExample -Title "Basic Counters" -Description "Display a basic number in a card" -Script $Basic - New-UDExample -Title "Auto Refreshing Counters" -Description "Turn on auto refresh for the counter to refresh the count." -Script $AutoRefresh - New-UDExample -Title "Format Numbers" -Description "Format numbers on the client using format strings." -Script $Formatting -} \ No newline at end of file diff --git a/src/poshud/pages/elements.ps1 b/src/poshud/pages/elements.ps1 deleted file mode 100644 index ef78eaa2..00000000 --- a/src/poshud/pages/elements.ps1 +++ /dev/null @@ -1,84 +0,0 @@ - -$CustomElement = { - New-UDElement -Tag "span" -Content { "Custom Element!" } -Attributes @{ className = "white-text" } -} - -$NestedElements = { - New-UDElement -Tag "div" -Attributes @{ className = "card black-text"} -Content { - New-UDElement -Tag "div" -Attributes @{ className = "card-content" } -Content { "Nested Element!" } - } -} - -$Attributes = { - New-UDElement -Tag "div" -Attributes @{ - className = "card" - style = @{ - backgroundColor = "#4081C9" - color = "#FFFFFF" - } - } -Content { - "Attributes" - } -} - -$LoadContentFromAnEndpoint = { - New-UDElement -Tag "div" -Attributes @{ className = "white-text" } -Endpoint { - Get-Date - } -} - -$SetContentFromAnEndpoint = { - $onClickHandler = { - Set-UDElement -Id "target" -Content { New-Guid } - } - - New-UDElement -Tag "a" -Attributes @{ className = "btn"; onClick = $onClickHandler } -Content { "Update the GUID" } - New-UDElement -Tag "p" -Id "target" -Attributes @{ className = "white-text" } -} - -$AddChildElements = { - $onClickHandler = { - Add-UDElement -ParentId "addChildElement" -Content { - New-UDElement -Tag "p" -Content { - "Add new element at $(Get-Date)" - } - } - } - - New-UDElement -Tag "a" -Attributes @{ className = "btn"; onClick = $onClickHandler } -Content { "Add child element" } - New-UDElement -Tag "p" -Id "addChildElement" -Attributes @{ className = "white-text" } -} - -$RemoveAnElement = { - $onClickHandler = { - Remove-UDElement -Id "removeMe" - } - - New-UDElement -Tag "a" -Attributes @{ className = "btn"; onClick = $onClickHandler } -Content { "Remove text" } - New-UDElement -Tag "p" -Id "removeMe" -Attributes @{ className = "white-text" } -Content { "Remove me"} -} - -$ClearChildren = { - $onClickHandler = { - Clear-UDElement -Id "clearMe" - } - - New-UDElement -Tag "a" -Attributes @{ className = "btn"; onClick = $onClickHandler } -Content { "Clear Children" } - New-UDElement -Tag "div" -Id "clearMe" -Attributes @{ className = "card black-text" } -Endpoint { - New-UDElement -Tag "p" -Content { "Child1" } - New-UDElement -Tag "p" -Content { "Child2" } - New-UDElement -Tag "p" -Content { "Child3" } - } -} - -New-UDPage -Name "Elements" -Icon cubes -Content { - New-UDPageHeader -Title "Elements" -Icon "cubes" -Description "Create custom elements using PowerShell script to create any type of HTML node. Take advantage of websockets to create real-time applications." -DocLink "https://docs.universaldashboard.io/components/custom-components/powershell-elements" - New-UDExample -Title "Simple Elements" -Description "Simple HTML element." -Script $CustomElement - New-UDExample -Title "Nested Elements" -Description "Elements can be nested within each other." -Script $NestedElements - New-UDExample -Title "Attributes" -Description "Set attributes on the HTML tag." -Script $Attributes - New-UDExample -Title "Endpoints" -Description "Load the content of an element from an PowerShell endpoint." -Script $LoadContentFromAnEndpoint - New-UDExample -Title "Update Element Content" -Description "Sets the content of a element from an endpoint." -Script $SetContentFromAnEndpoint - New-UDExample -Title "Add child element" -Description "Add child elements to a parent element from within an endpoint." -Script $AddChildElements - New-UDExample -Title "Remove element" -Description "Remove an element from within an endpoint." -Script $RemoveAnElement - New-UDExample -Title "Clear children" -Description "Clear children of an element from within an endpoint." -Script $ClearChildren -} \ No newline at end of file diff --git a/src/poshud/pages/formatting.ps1 b/src/poshud/pages/formatting.ps1 deleted file mode 100644 index 93dcccc6..00000000 --- a/src/poshud/pages/formatting.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -$GridSystem = { - New-UDRow { - New-UDColumn -Size 9 { - New-UDRow { - New-UDColumn -Size 3 { - New-UDCard - } - New-UDColumn -Size 3 { - New-UDCard - } - New-UDColumn -Size 6 { - New-UDCard - } - } - } - New-UDColumn -Size 3 { - New-UDCard - } - } -} - -$Layout = { - New-UDRow { - New-UDColumn -Size 12 { - New-UDLayout -Columns 3 -Content { - New-UDCard - New-UDCard - New-UDCard - New-UDCard - New-UDCard - New-UDCard - } - } - } -} - -New-UDPage -Name "Formatting" -Icon th { - New-UDPageHeader -Title "Formatting" -Icon "th" -Description "Control the layout of your website." -DocLink "https://docs.universaldashboard.io/components/formatting" - New-UDExample -Title 'Row and column' -Description 'Organize elements by row and column.' -Script $GridSystem - New-UDExample -Title 'Layouts' -Description 'Automaticaly generates rows and columns based on the number of child elements.' -Script $Layout -} \ No newline at end of file diff --git a/src/poshud/pages/grids.ps1 b/src/poshud/pages/grids.ps1 deleted file mode 100644 index 380aa13e..00000000 --- a/src/poshud/pages/grids.ps1 +++ /dev/null @@ -1,122 +0,0 @@ -$GridData = @( - @{ - Country = "MAURITANIA" - Customers = 262 - FirstPurchaseDate = "5/30/2017" - }, - @{ - Country = "NAURU" - Customers = 649 - FirstPurchaseDate = "9/11/2017" - }, - @{ - Country = "POLAND" - Customers = 92 - FirstPurchaseDate = "8/8/2017" - }, - @{ - Country = "SWITZERLAND" - Customers = 830 - FirstPurchaseDate = "5/8/2017" - }, - @{ - Country = "ISLE OF MAN" - Customers = 641 - FirstPurchaseDate = "7/13/2017" - }, - @{ - Country = "KYRGYZSTAN" - Customers = 857 - FirstPurchaseDate = "7/30/2017" - }, - @{ - Country = "GIBRALTAR" - Customers = 223 - FirstPurchaseDate = "9/3/2017" - }, - @{ - Country = "BAHRAIN" - Customers = 912 - FirstPurchaseDate = "9/10/2017" - }, - @{ - Country = "PAKISTAN" - Customers = 913 - FirstPurchaseDate = "6/9/2017" - }, - @{ - Country = "MALAWI" - Customers = 281 - FirstPurchaseDate = "6/14/2017" - }, - @{ - Country = "HONG KONG" - Customers = 255 - FirstPurchaseDate = "8/19/2017" - }, - @{ - Country = "DOMINICA" - Customers = 80 - FirstPurchaseDate = "8/3/2017" - }, - @{ - Country = "GHANA" - Customers = 275 - FirstPurchaseDate = "4/15/2017" - }, - @{ - Country = "ISRAEL" - Customers = 380 - FirstPurchaseDate = "5/11/2017" - }, - @{ - Country = "FRENCH POLYNESIA" - Customers = 155 - FirstPurchaseDate = "4/20/2017" - }, - @{ - Country = "PANAMA" - Customers = 130 - FirstPurchaseDate = "9/3/2017" - }, - @{ - Country = "ESTONIA" - Customers = 468 - FirstPurchaseDate = "8/12/2017" - }, - @{ - Country = "BANGLADESH" - Customers = 794 - FirstPurchaseDate = "7/29/2017" - }, - @{ - Country = "�LAND ISLANDS" - Customers = 989 - FirstPurchaseDate = "8/20/2017" - }, - @{ - Country = "ANGOLA" - Customers = 377 - FirstPurchaseDate = "4/22/2017" - } - - ) - - -$Basic = { - New-UDGrid -Title "Customer Locations" -Headers @("Country", "Customers", "First Purchase Date") -Properties @("Country", "Customers", "FirstPurchaseDate") -Endpoint { - $GridData | Out-UDGridData - } -FontColor "black" -} - -$AutoRefresh = { - New-UDGrid -Title "Customer Locations" -Headers @("Country", "Customers", "First Purchase Date") -Properties @("Country", "Customers", "FirstPurchaseDate") -Endpoint { - $GridData | Out-UDGridData - } -AutoRefresh -RefreshInterval 5 -FontColor "black" -} - -New-UDPage -Name "Grids" -Icon th_large -Content { - New-UDPageHeader -Title "Grids" -Icon "th-large" -Description "Display data in a grid that can sort, filter and page." -DocLink "https://docs.universaldashboard.io/components/grids" - New-UDExample -Title "Basic Grids" -Description "A basic grid that displays data." -Script $Basic - New-UDExample -Title "Auto Refreshing Grids" -Description "A grid that auto refreshes" -Script $AutoRefresh -} \ No newline at end of file diff --git a/src/poshud/pages/icon.ps1 b/src/poshud/pages/icon.ps1 deleted file mode 100644 index 7a5433c7..00000000 --- a/src/poshud/pages/icon.ps1 +++ /dev/null @@ -1,70 +0,0 @@ - -New-UDPage -Name "Icon" -Icon smile -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Icons" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Universal Dashboard uses FontAwesome icons. " - } -Color $Colors.FontColor - - New-UDHeading -Size 3 -Text "Full Set of Icons" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDRow -Columns { - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon user -size 4x - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon linkedin -size 4x - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon exclamation -size 4x - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon filter -size 4x - } - } - } - - New-UDHeading -Size 3 -Text "Sizes" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDRow -Columns { - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon bug -Size ExtraSmall - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon bug -Size 2x - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon bug -Size 3x - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon bug -Size 5x - } - } - } - - New-UDHeading -Size 3 -Text "Colors" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDRow -Columns { - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon user -size 4x -Color green - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon linkedin -size 4x -Color blue - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon exclamation -size 4x -Color red - } - New-UDColumn -Size 1 -Content { - New-UDIcon -Icon filter -size 4x -Color orange - } - } - } - } - } -} diff --git a/src/poshud/pages/images.ps1 b/src/poshud/pages/images.ps1 deleted file mode 100644 index 4a09ae30..00000000 --- a/src/poshud/pages/images.ps1 +++ /dev/null @@ -1,9 +0,0 @@ - -$Image = { - New-UDImage -Height 125 -Width 125 -Url "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMTI4cHgiIGhlaWdodD0iMTI4cHgiIHZpZXdCb3g9IjAgMCAxMjggMTI4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMjggMTI4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzFfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9Ijk1LjEyMzUiIHkxPSI5MS44MDQ5IiB4Mj0iMjYuODU1IiB5Mj0iMzAuODI0OSI+PHN0b3AgIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6IzUzOTFGRSIvPjxzdG9wICBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOiMzRTZEQkYiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSJ1cmwoI1NWR0lEXzFfKSIgZD0iTTkuNDkxLDEwOWMtMS42MiwwLTMuMDIxLTAuNjM4LTMuOTQ0LTEuNzk4Yy0wLjk0NC0xLjE4NS0xLjI2OC0yLjgxNC0wLjg4OS00LjQ3bDE3LjgzNC03Ny45MTFDMjMuMjM5LDIxLjU1NywyNi4zNzYsMTksMjkuNjM0LDE5SDExOC41YzEuNjIsMCwzLjAyMSwwLjYzOCwzLjk0NSwxLjc5OGMwLjk0NCwxLjE4NCwxLjI2OCwyLjgxNCwwLjg4OSw0LjQ3bC0xNy44MzQsNzcuOTExYy0wLjc0NywzLjI2NC0zLjg4NCw1LjgyMi03LjE0Myw1LjgyMkg5LjQ5MXoiLz48bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzJfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjI2LjE3NzUiIHkxPSIzMC4wMTQ2IiB4Mj0iOTMuNzQ4NSIgeTI9IjkwLjczODEiPjxzdG9wICBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiM1MzkxRkUiLz48c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojM0U2REJGIi8+PC9saW5lYXJHcmFkaWVudD48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0idXJsKCNTVkdJRF8yXykiIGQ9Ik0yOS42MzQsMjBIMTE4LjVjMi43NjksMCw0LjQ5NiwyLjI1OSwzLjg1OCw1LjA0NWwtMTcuODM0LDc3LjkxMWMtMC42MzgsMi43ODYtMy4zOTksNS4wNDUtNi4xNjgsNS4wNDVIOS40OTFjLTIuNzY5LDAtNC40OTYtMi4yNTgtMy44NTgtNS4wNDVsMTcuODM0LTc3LjkxMUMyNC4xMDQsMjIuMjU5LDI2Ljg2NiwyMCwyOS42MzQsMjB6Ii8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiMyQzU1OTEiIGQ9Ik02NC4xNjUsODcuNTU4aDIxLjYxM2MyLjUxMywwLDQuNTUsMi4xMjUsNC41NSw0Ljc0NmMwLDIuNjIxLTIuMDM3LDQuNzQ3LTQuNTUsNC43NDdINjQuMTY1Yy0yLjUxMywwLTQuNTUtMi4xMjUtNC41NS00Ljc0N0M1OS42MTUsODkuNjgzLDYxLjY1Miw4Ny41NTgsNjQuMTY1LDg3LjU1OHoiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzJDNTU5MSIgZD0iTTc4LjE4NCw2Ni40NTVjLTAuMzcyLDAuNzQ5LTEuMTQ0LDEuNTc1LTIuNTA5LDIuNTM0TDM1LjU2Miw5Ny43OThjLTIuMTksMS41OTEtNS4zMzQsMS4wMDEtNy4wMjEtMS4zMTljLTEuNjg3LTIuMzItMS4yOC01LjQ5LDAuOTEtNy4wODJsMzYuMTczLTI2LjE5NHYtMC41MzhMNDIuODk2LDM4LjQ4N2MtMS44NTQtMS45NzItMS42NjEtNS4xNjEsMC40MzEtNy4xMjRjMi4wOTItMS45NjIsNS4yOS0xLjk1NCw3LjE0NCwwLjAxOGwyNy4yNzEsMjkuMDEyQzc5LjI5LDYyLjA0LDc5LjQwNSw2NC41MzQsNzguMTg0LDY2LjQ1NXoiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0ZGRkZGRiIgZD0iTTc3LjE4NCw2NS40NTVjLTAuMzcyLDAuNzQ5LTEuMTQ0LDEuNTc1LTIuNTA5LDIuNTM0TDM0LjU2Miw5Ni43OThjLTIuMTksMS41OTEtNS4zMzQsMS4wMDEtNy4wMjEtMS4zMTljLTEuNjg3LTIuMzItMS4yOC01LjQ5LDAuOTEtNy4wODJsMzYuMTczLTI2LjE5NHYtMC41MzhMNDEuODk2LDM3LjQ4N2MtMS44NTQtMS45NzItMS42NjEtNS4xNjEsMC40MzEtNy4xMjRjMi4wOTItMS45NjIsNS4yOS0xLjk1NCw3LjE0NCwwLjAxOGwyNy4yNzEsMjkuMDEyQzc4LjI5LDYxLjA0LDc4LjQwNSw2My41MzQsNzcuMTg0LDY1LjQ1NXoiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0ZGRkZGRiIgZD0iTTYzLjU1LDg3aDIxLjYxM2MyLjUxMywwLDQuNTUsMi4wMTUsNC41NSw0LjVjMCwyLjQ4NS0yLjAzNyw0LjUtNC41NSw0LjVINjMuNTVDNjEuMDM3LDk2LDU5LDkzLjk4NSw1OSw5MS41QzU5LDg5LjAxNSw2MS4wMzcsODcsNjMuNTUsODd6Ii8+PC9zdmc+" -} - -New-UDPage -Name "Images" -Icon image -Content { - New-UDPageHeader -Title "Images" -Icon "image" -Description "Display images" -DocLink "https://github.com/adamdriscoll/universal-dashboard-documentation/blob/master/api/1.5.0/New-UDImage.md" - New-UDExample -Title "Base64 Image" -Description "Embed base64 images in your dashboard." -Script $Image -} \ No newline at end of file diff --git a/src/poshud/pages/inputs.ps1 b/src/poshud/pages/inputs.ps1 deleted file mode 100644 index 2c366839..00000000 --- a/src/poshud/pages/inputs.ps1 +++ /dev/null @@ -1,59 +0,0 @@ - -$Textboxes = { - New-UDInput -Title "Echo" -SubmitText "Echo text" -Endpoint { - param([string]$Message) - - New-UDInputAction -Toast $Message - } -FontColor "black" -} - -$Checkboxes = { - New-UDInput -Title "Check me" -Endpoint { - param([bool]$CheckMe) - - if ($CheckMe) { - New-UDInputAction -Toast "Checked" - } else { - New-UDInputAction -Toast "Not checked" - } - } -FontColor "black" -} - -$Select = { - New-UDInput -Title "Select me" -Endpoint { - param([ValidateSet("Yes", "No", "Don't care")]$Opinion) - - New-UDInputAction -Toast "You selected: $Opinion" - } -FontColor "black" -} - -$DeclarativeInputs = { - New-UDInput -Title "Try Me" -Endpoint { - param($Textbox, $Checkbox) - - New-UDInputAction -Toast "$Textbox : $Checkbox" - } -Content { - New-UDInputField -Name "Textbox" -Placeholder "My textbox" -Type "textbox" - New-UDInputField -Name "Checkbox" -Placeholder "My checkbox" -Type "checkbox" - } -FontColor "black" -} - -$ReplacingContent = { - New-UDInput -Title "Make GUID" -Endpoint { - New-UDInputAction -Content { - New-UDElement -Tag "h2" -Content { - (New-Guid).ToString() - } - } - } -FontColor "black" -} - - -New-UDPage -Name "Inputs" -Icon wpforms -Content { - New-UDPageHeader -Title "Inputs" -Icon "wpforms" -Description "Take input and perform actions." -DocLink "https://docs.universaldashboard.io/components/inputs" - New-UDExample -Title "Textboxes" -Description "Accept data from a textbox." -Script $Textboxes - New-UDExample -Title "Checkboxes" -Description "Accept data from a checkbox." -Script $Checkboxes - New-UDExample -Title "Select" -Description "Accept data from a select." -Script $Select - New-UDExample -Title "Declarative Input Fields" -Description "Define exactly which input fields you'd like by defining them in the content block." -Script $DeclarativeInputs - #New-UDExample -Title "Replace Content" -Description "Replace input field with other content." -Script $ReplacingContent -} \ No newline at end of file diff --git a/src/poshud/pages/monitors.ps1 b/src/poshud/pages/monitors.ps1 deleted file mode 100644 index b550326a..00000000 --- a/src/poshud/pages/monitors.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -$Basic = { - New-UDMonitor -Title "Downloads per second" -Type Line -Endpoint { - Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData - } -} - -$RefreshIntervalDataRetention = { - New-UDMonitor -Title "Downloads per second" -Type Line -Endpoint { - Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData - } -DataPointHistory 20 -RefreshInterval 5 -} - -$CustomColors = { - New-UDMonitor -Title "Downloads per second" -Type Line -Endpoint { - Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData - } -ChartBackgroundColor '#59FF681B' -ChartBorderColor '#FFFF681B' -BackgroundColor "#252525" -FontColor "#FFFFFF" -} - -New-UDPage -Name "Monitors" -Icon chart_line -Content { - New-UDPageHeader -Title "Monitors" -Icon "line-chart" -Description "Visual data using dynamic charts that trace information over time" -DocLink "https://docs.universaldashboard.io/components/monitors" - New-UDExample -Title "Basic Monitors" -Description "Create basic monitors from any type of data." -Script $Basic - New-UDExample -Title "Customize refresh rate and data retention" -Description "Customize how often data is returned from the server and how much data to keep" -Script $RefreshIntervalDataRetention - New-UDExample -Title "Custom colors" -Description "Adjust colors of different components within the monitor." -Script $CustomColors -} \ No newline at end of file diff --git a/src/poshud/pages/preloader.ps1 b/src/poshud/pages/preloader.ps1 deleted file mode 100644 index d8010e65..00000000 --- a/src/poshud/pages/preloader.ps1 +++ /dev/null @@ -1,51 +0,0 @@ - -New-UDPage -Name "Preloader" -Icon spinner -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Preloaders" -Color $Colors.FontColor - - New-UDParagraph -Content { - "If you have content that will take a long time to load, you should give the user feedback. For this reason we provide a number activity + progress indicators." - } -Color $Colors.FontColor - - New-UDHeading -Size 3 -Text "Linear" -Color $Colors.FontColor - - New-UDParagraph -Content { - "There are a couple different types of linear progress bars." - } -Color $Colors.FontColor - - New-UDHeading -Size 5 -Text "Determinate" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDPreloader -PercentComplete 70 - } - - New-UDHeading -Size 5 -Text "Indeterminate" -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDPreloader - } - - New-UDHeading -Size 3 -Text "Circular" -Color $Colors.FontColor - - New-UDParagraph -Content { - "There are 4 colors and 3 sizes of circular spinners." - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDRow -Columns { - New-UDColumn -Size 4 -Content { - New-UDPreloader -Circular -Color blue -Size large - } - New-UDColumn -Size 4 -Content { - New-UDPreloader -Circular -Color red -Size medium - } - New-UDColumn -Size 4 -Content { - New-UDPreloader -Circular -Color green -Size small - } - } - } - } - } -} diff --git a/src/poshud/pages/radio.ps1 b/src/poshud/pages/radio.ps1 deleted file mode 100644 index f4c09b1b..00000000 --- a/src/poshud/pages/radio.ps1 +++ /dev/null @@ -1,20 +0,0 @@ - -New-UDPage -Name "Radio" -Icon circle -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Radios" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Radio Buttons are used when the user must make only one selection out of a group of items. " - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDRadio -Label Red -Checked - New-UDRadio -Label Yellow - New-UDRadio -Label Green -WithGap - New-UDRadio -Label Brown -Disabled - } - } - } -} diff --git a/src/poshud/pages/restapis.ps1 b/src/poshud/pages/restapis.ps1 deleted file mode 100644 index 310da920..00000000 --- a/src/poshud/pages/restapis.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -$Users = @( - [PSCustomObject]@{ - id = 1 - name = "Adam" - } - [PSCustomObject]@{ - id = 2 - name = "Frank" - } -) - -$CreateRestApis = { - New-UDEndpoint -Url "/api/user" -Endpoint { - $Users - } - - Invoke-RestMethod -Uri "https://poshud.com/api/user" -} - -$Parameters = { - New-UDEndpoint -Url "/api/user/:id" -Endpoint { - param($id) - - $Users | Where-Object Id -eq $id -} - -Invoke-RestMethod -Uri "https://poshud.com/api/user/1" -} - -$PostData = { - New-UDEndpoint -Url "/api/echo" -Method POST -Endpoint { - param($Body) - - $Body | ConvertTo-Json -} - -$Body = @{ value = "test" } -Invoke-RestMethod -Uri "https://poshud.com/api/echo" -Method POST -Body -ContentType "application/json" -} - -New-UDPage -Name "REST APIs" -Icon code -Content { - New-UDPageHeader -Title "REST APIs" -Icon "code" -Description "Create REST APIs using PowerShell." -DocLink "https://docs.universaldashboard.io/rest-apis" - New-UDExample -Title "Return data" -Description "Return data from REST APIs." -Script $CreateRestApis -NoRender - New-UDExample -Title "Parameters" -Description "Accept parameters for your REST APIs." -Script $Parameters -NoRender - New-UDExample -Title "POST Data" -Description "Post data to an endpoint." -Script $PostData -NoRender -} \ No newline at end of file diff --git a/src/poshud/pages/select.ps1 b/src/poshud/pages/select.ps1 deleted file mode 100644 index 5b3d697f..00000000 --- a/src/poshud/pages/select.ps1 +++ /dev/null @@ -1,23 +0,0 @@ - -New-UDPage -Name "Select" -Icon circle -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Select" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Select drop downs allow you to offer options a user can select." - } -Color $Colors.FontColor - - New-UDHeading -Size 3 -Text "Basic" -Color $Colors.FontColor - - New-UDElementExample -Label "Fruit" -Example { - New-UDSelect -Option { - New-UDSelectOption -Name "Apple" -Value 1 - New-UDSelectOption -Name "Orange" -Value 2 - New-UDSelectOption -Name "Grapes" -Value 3 - } - } - } - } -} diff --git a/src/poshud/pages/switch.ps1 b/src/poshud/pages/switch.ps1 deleted file mode 100644 index fcf6937f..00000000 --- a/src/poshud/pages/switch.ps1 +++ /dev/null @@ -1,18 +0,0 @@ - -New-UDPage -Name "Switch" -Icon toggle_on -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Switches" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Switches are special checkboxes used for binary states such as on / off" - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDSwitch - New-UDSwitch -OnText "Yes" -OffText "No" -Disabled - } - } - } -} diff --git a/src/poshud/pages/tables.ps1 b/src/poshud/pages/tables.ps1 deleted file mode 100644 index c372c8c5..00000000 --- a/src/poshud/pages/tables.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -$Cache:GridData = @( - @{ - Country = "MAURITANIA" - Customers = 262 - FirstPurchaseDate = "5/30/2017" - }, - @{ - Country = "NAURU" - Customers = 649 - FirstPurchaseDate = "9/11/2017" - }, - @{ - Country = "POLAND" - Customers = 92 - FirstPurchaseDate = "8/8/2017" - }, - @{ - Country = "SWITZERLAND" - Customers = 830 - FirstPurchaseDate = "5/8/2017" - }, - @{ - Country = "ISLE OF MAN" - Customers = 641 - FirstPurchaseDate = "7/13/2017" - }, - @{ - Country = "KYRGYZSTAN" - Customers = 857 - FirstPurchaseDate = "7/30/2017" - } - ) - - - - -$Basic = { - New-UDTable -Title "Customers" -Headers @("Country", "Customers", "First Purchase Date") -FontColor "black" -Endpoint { - $Cache:GridData | Out-UDTableData -Property @("Country", "Customers", "FirstPurchaseDate") - } -} - -New-UDPage -Name "Tables" -Icon table -Content { - New-UDPageHeader -Title "Tables" -Icon "table" -Description "Display data in a static table." -DocLink "https://docs.universaldashboard.io/components/tables" - New-UDExample -Title "Basic Table" -Description "Display data in a table." -Script $Basic -} \ No newline at end of file diff --git a/src/poshud/pages/textbox.ps1 b/src/poshud/pages/textbox.ps1 deleted file mode 100644 index d129c834..00000000 --- a/src/poshud/pages/textbox.ps1 +++ /dev/null @@ -1,21 +0,0 @@ - -New-UDPage -Name "Textbox" -Icon font -Content { - New-UDRow -Columns { - New-UDColumn -Size 2 -Content {} - New-UDColumn -Size 10 -Content { - New-UDHeading -Size 1 -Text "Textboxes" -Color $Colors.FontColor - - New-UDParagraph -Content { - "Text fields allow user input." - } -Color $Colors.FontColor - - New-UDElementExample -Example { - New-UDTextbox -Label 'First Name' - New-UDTextbox -Placeholder 'Last Name' - New-UDTextbox -Label 'Disabled' -Placeholder 'I am not editable' -Disabled - New-UDTextbox -Label 'Password' -Type 'password' - New-UDTextbox -Label 'Email' -Type 'email' - } - } - } -}