-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88b95f7
commit dc3e9b1
Showing
30 changed files
with
53,892 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
AdamDriscoll/Deep Dive into Universal Dashboard/Repository/.universal/dashboards.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
New-PSUDashboard -Name "Dashboard" -FilePath "dashboards\Dashboard\Dashboard.ps1" -BaseUrl "/dashboard" -Framework "UniversalDashboard:Latest" -Authenticated -SessionTimeout 0 -AutoDeploy | ||
New-PSUDashboard -Name "Chatroom" -FilePath "dashboards\Chatroom\Chatroom.ps1" -BaseUrl "/chatroom" -Framework "UniversalDashboard:Latest" -Authenticated -SessionTimeout 0 -AutoDeploy | ||
New-PSUDashboard -Name "Integration" -FilePath "dashboards\Integration\Integration.ps1" -BaseUrl "/integration" -Framework "UniversalDashboard:Latest" -Authenticated -SessionTimeout 0 -AutoDeploy | ||
New-PSUDashboard -Name "Components" -FilePath "dashboards\Components\Components.ps1" -BaseUrl "/components" -Framework "UniversalDashboard:Latest" -Authenticated -SessionTimeout 0 -AutoDeploy |
1 change: 1 addition & 0 deletions
1
AdamDriscoll/Deep Dive into Universal Dashboard/Repository/.universal/scripts.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
New-PSUScript -Name "CreatePizza.ps1" -Path "CreatePizza.ps1" |
9 changes: 9 additions & 0 deletions
9
AdamDriscoll/Deep Dive into Universal Dashboard/Repository/CreatePizza.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
param( | ||
[switch]$ExtraCheese, | ||
[string]$OrderName, | ||
[DateTime]$DeliveryDate | ||
) | ||
|
||
$ExtraCheese | ||
$OrderName | ||
$DeliveryDate |
61 changes: 61 additions & 0 deletions
61
AdamDriscoll/Deep Dive into Universal Dashboard/Repository/dashboards/Chatroom/Chatroom.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
New-UDDashboard -Title 'Chatroom' -Content { | ||
Show-UDToast "$User joined the room!" -Broadcast | ||
|
||
if (-not $Cache:Messages) { | ||
$Cache:Messages = [System.Collections.Generic.List[string]]::new() | ||
} | ||
|
||
if (-not $Cache:GuestList) { | ||
$Cache:GuestList = [System.Collections.Generic.List[string]]::new() | ||
} | ||
|
||
if (-not $Cache:GuestList.Contains($User)) { | ||
$Cache:GuestList.Add($User) | ||
Sync-UDElement -Id 'guestList' | ||
} | ||
|
||
|
||
New-UDRow -Columns { | ||
New-UDColumn -LargeSize 10 -Content { | ||
New-UDDynamic -Id 'chatroom' -Content { | ||
$Messages = "" | ||
if ($Cache:Messages) { | ||
$Messages = $Cache:Messages -join ([Environment]::NewLine) | ||
} | ||
New-UDTextbox -Multiline -Rows 10 -FullWidth -Value $Messages | ||
} | ||
} | ||
New-UDColumn -LargeSize 2 -Content { | ||
New-UDDynamic -Id 'guestList' -Content { | ||
New-UDList -Children { | ||
$Cache:GuestList | ForEach-Object { | ||
New-UDListItem -Label $_ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
New-UDForm -Content { | ||
New-UDTextbox -Id 'message' -Label 'message' | ||
} -OnSubmit { | ||
$Message = "[$(Get-Date)] $User - $($EventData.message)" | ||
$Cache:Messages.Add($Message) | ||
Sync-UDElement -Id 'chatroom' -Broadcast | ||
Set-UDElement -Id 'message' -Properties @{ | ||
value = '' | ||
} | ||
} | ||
|
||
New-UDFloatingActionButton -Icon (New-UDIcon -Icon cog) -OnClick { | ||
Show-UDModal -Content { | ||
New-UDButton -Text 'Clear Chatroom' -OnClick { | ||
$Cache:Messages = [System.Collections.Generic.List[string]]::new() | ||
Sync-UDElement -Id 'chatroom' -Broadcast | ||
} | ||
} -Header { | ||
New-UDTypography "Toolbox" | ||
} | ||
} -Position bottomRight | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...iscoll/Deep Dive into Universal Dashboard/Repository/dashboards/Components/Components.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
New-UDDashboard -Title 'PowerShell Universal' -Content { | ||
$Nodes = 1..5 | % { New-UDDiagramNode -Id "node$_" -Name "node$_" -OutPort 'out' -InPort 'in' -Color blue -xOffset (100 * $_) } | ||
$Links = 1..4 | % { New-UDDiagramLink -OutNode "node$_" -OutPort 'out' -InNode "node$($_ + 1)" -InPort 'in' } | ||
|
||
New-UDDiagram -Node $Nodes -Link $Links -Locked -OnSelected { | ||
Show-UDToast -Message $EventData | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...Driscoll/Deep Dive into Universal Dashboard/Repository/dashboards/Dashboard/Dashboard.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
$Theme = Get-UDTheme -Name 'AntDesign' | ||
|
||
New-UDDashboard -Title 'PowerShell Conference EU 2022' -Content { | ||
New-UDImage -Url 'https://psconf.eu/wp-content/uploads/2022/01/psconfeu_logo_300.png' | ||
New-UDTypography -Text 'PowerShell Conference EU 2022' -Variant h4 | ||
|
||
New-UDDynamic -Content { | ||
$data = Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10 | ForEach-Object { | ||
[PSCustomObject]@{ | ||
Name = $_.Name | ||
Value = $_.CPU | ||
Id = $_.Id | ||
} | ||
} | ||
New-UDNivoChart -Bar -Keys "value" -IndexBy 'name' -Data $Data -Height 500 -Width 1000 -Id 'cpuChart' -Colors @{ | ||
scheme = "category10" | ||
} | ||
|
||
New-UDTable -Data $data -Columns @( | ||
New-UDTableColumn -Property 'Name' -Title 'Name' | ||
New-UDTableColumn -Property 'Value' -Title 'Value' | ||
New-UDTableColumn -Property 'Actions' -Render { | ||
New-UDButton -Text 'Stop' -OnClick { | ||
Stop-Process -Id $EVentData.Id | ||
} | ||
} | ||
) | ||
} -AutoRefresh -AutoRefreshInterval 1 | ||
|
||
New-UDCard -Content { | ||
New-UDForm -Content { | ||
New-UDTextbox -Id 'file' -Placeholder 'File' | ||
New-UDTextbox -Id 'arguments' -Placeholder 'Arguments' | ||
New-UDSwitch -Id 'admin' -Label 'As Administrator?' | ||
} -OnSubmit { | ||
$verb = "" | ||
if ($EventData.admin) { | ||
$verb = "runas" | ||
} | ||
|
||
Start-Process -FilePath $EventData.File -ArgumentList $EventData.Arguments -Verb $verb | ||
} | ||
} | ||
} -Theme $Theme |
8 changes: 8 additions & 0 deletions
8
...coll/Deep Dive into Universal Dashboard/Repository/dashboards/Integration/Integration.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
New-UDDashboard -Title 'PowerShell Universal' -Content { | ||
New-UDForm -Content { | ||
New-UDTextbox -Id 'name' -Label Name | ||
} -OnSubmit { | ||
Invoke-PSUScript -Name 'CreatePizza.ps1' -OrderName $EventData.Name -Integrated -Wait | ConvertTo-Json | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
AdamDriscoll/Deep Dive into Universal Dashboard/Repository/dashboards/Joyride/joyride.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import-module C:\src\udjoyride\output\UniversalDashboard.Joyride.psd1 | ||
|
||
New-UDDashboard -Title 'PowerShell Universal' -Content { | ||
New-UDJoyride -Id 'joyride' -Step @( | ||
New-UDJoyrideStep -Target '#alert' -Text 'Alerts are used to highlight text.' | ||
New-UDJoyrideStep -Target '#card' -Text 'Cards highlight functional groups.' | ||
) | ||
|
||
New-UDButton -Text 'Start' -OnClick { | ||
Set-UDElement -Id 'joyride' -Properties @{ | ||
run = $true | ||
} | ||
} | ||
|
||
New-UDAlert -Id 'alert' -Text 'This is an alert!' | ||
New-UDCard -Id 'card' -Text 'This is a card!' -Title 'Card' | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Getting Started | ||
|
||
- Creating a dashboard | ||
- Components | ||
- Chart | ||
- Form | ||
- Images | ||
- Text | ||
- Tables | ||
|
||
# Templates | ||
|
||
# Interaction | ||
|
||
- Chatroom | ||
|
||
# PSU Integration | ||
|
||
- Calling scripts and returning output | ||
- Schedules jobs | ||
|
||
# Extensiblity | ||
|
||
- React Joyride Example |
2 changes: 2 additions & 0 deletions
2
AdamDriscoll/PowerShell Universal Desktop/.universal/dashboards.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
New-PSUDashboard -Name "Services" -FilePath "dashboards\Services\Services.ps1" -BaseUrl "/Services" -Framework "UniversalDashboard:Latest" -SessionTimeout 0 -AutoDeploy | ||
New-PSUDashboard -Name "Launch" -FilePath "dashboards\Launch\Launch.ps1" -BaseUrl "/launch" -Framework "UniversalDashboard:Latest" -Authenticated -SessionTimeout 0 -AutoDeploy |
1 change: 1 addition & 0 deletions
1
AdamDriscoll/PowerShell Universal Desktop/.universal/fileAssociations.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
New-PSUFileAssociation -Script "fileAssociation.ps1" -Environment "Default" -Credential "Default" -Extension ".ps3" |
1 change: 1 addition & 0 deletions
1
AdamDriscoll/PowerShell Universal Desktop/.universal/hotkeys.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
New-PSUHotKey -Script "Hotkey.ps1" -Credential "Default" -ModifierKeys "Alt" -Keys "S" -Page 'Services' |
1 change: 1 addition & 0 deletions
1
AdamDriscoll/PowerShell Universal Desktop/.universal/protocolHandlers.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
New-PSUProtocolHandler -Script "protocol.ps1" -Environment "Default" -Credential "Default" -Protocol "psu" |
5 changes: 5 additions & 0 deletions
5
AdamDriscoll/PowerShell Universal Desktop/.universal/scripts.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
New-PSUScript -Name "StartProcess.ps1" -Path "StartProcess.ps1" -InformationAction "Continue" -Anonymous | ||
New-PSUScript -Name "Hotkey.ps1" -Path "Hotkey.ps1" -InformationAction "Continue" | ||
New-PSUScript -Name "protocol.ps1" -Path "protocol.ps1" -InformationAction "Continue" | ||
New-PSUScript -Name "fileAssociation.ps1" -Path "fileAssociation.ps1" -InformationAction "Continue" | ||
New-PSUScript -Name "systemEvent.ps1" -Path "systemEvent.ps1" -InformationAction "Continue" |
1 change: 1 addition & 0 deletions
1
AdamDriscoll/PowerShell Universal Desktop/.universal/systemEvents.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
New-PSUSystemEvent -Script "systemEvent.ps1" -Environment "Default" -Credential "Default" -Type "Create" -Condition "TargetInstance isa `"Win32_Process`" and TargetInstance.Name = `"pwsh.exe`"" -Name "PowerShell Started" |
Oops, something went wrong.