diff --git a/src/UniversalDashboard.Materialize/Components/ud-collapsible.jsx b/src/UniversalDashboard.Materialize/Components/ud-collapsible.jsx
index 0728a148..46152a34 100644
--- a/src/UniversalDashboard.Materialize/Components/ud-collapsible.jsx
+++ b/src/UniversalDashboard.Materialize/Components/ud-collapsible.jsx
@@ -73,7 +73,7 @@ class UDCollapsibleItem extends React.Component {
- {this.props.icon && }
+ {this.props.icon && }
{this.props.title}
{UniversalDashboard.renderComponent(this.state.content)}
diff --git a/src/UniversalDashboard.Materialize/Components/ud-grid.jsx b/src/UniversalDashboard.Materialize/Components/ud-grid.jsx
index b11b40c6..9947629b 100644
--- a/src/UniversalDashboard.Materialize/Components/ud-grid.jsx
+++ b/src/UniversalDashboard.Materialize/Components/ud-grid.jsx
@@ -5,6 +5,8 @@ import ErrorCard from './error-card.jsx';
import UdLink from './ud-link.jsx';
import CustomCell from './custom-cell.jsx';
import {DebounceInput} from 'react-debounce-input';
+import { Dropdown, Button, Row, Col } from 'react-materialize';
+import UdIcon from './ud-icon.jsx';
function strMapToObj(strMap) {
if (strMap == undefined) return null;
@@ -52,7 +54,8 @@ export default class UdGrid extends React.Component {
filterText: "",
properties: props.properties,
headers: props.headers,
- loading: true
+ loading: true,
+ firstLoad: true
};
}
@@ -104,7 +107,8 @@ export default class UdGrid extends React.Component {
UniversalDashboard.get(`/api/internal/component/datatable/${this.props.id}?start=${skip}&length=${pageSize}&sortColumn=${sortColumn}&sortAscending=${sortAscending}&filterText=${filterText}`, function(json){
this.setState({
- loading: false
+ loading: false,
+ firstLoad: false
})
if (json.error) {
@@ -182,6 +186,46 @@ export default class UdGrid extends React.Component {
this.pubSubToken = UniversalDashboard.subscribe(this.props.id, this.onIncomingEvent.bind(this));
}
+ onPageChanged(x) {
+ this.setState({
+ currentPage: x
+ })
+ }
+
+ onExportData() {
+
+ var csv = '';
+ this.state.data.forEach(x => {
+ for(var propertyName in x) {
+ var property = x[propertyName];
+ if (property == null) continue;
+
+ csv += property + ",";
+ }
+ csv = csv.substr(0, csv.length - 1) + "\r\n";
+ })
+
+ var element = document.createElement('a');
+ element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(csv));
+ element.setAttribute('download', 'export.csv');
+
+ element.style.display = 'none';
+ document.body.appendChild(element);
+
+ element.click();
+
+ document.body.removeChild(element);
+ }
+
+ onLocalSort(sortProperties) {
+ if (sortProperties.id !== this.state.sortColumn || sortProperties.sortAscending !== this.state.sortAscending) {
+ this.setState({
+ sortColumn: sortProperties.id,
+ sortAscending: sortProperties.sortAscending
+ })
+ }
+ }
+
render() {
if (this.state.hasError) {
return [, ]
@@ -225,7 +269,8 @@ export default class UdGrid extends React.Component {
var gridPlugins = [];
var serverSort, serverFilter, serverNext, serverPrev, serverGetPage, serverFilterControl;
var components = {
- SettingsToggle: () =>
+ SettingsToggle: () => ,
+ Pagination: () =>
}
var serverFilterControl =
@@ -235,10 +280,11 @@ export default class UdGrid extends React.Component {
if (this.props.noFilter) {
components = {
- Filter: () => ,
- SettingsToggle: () =>
+ ...components,
+ Filter: () =>
}
}
+ serverSort = this.onLocalSort.bind(this);
} else {
serverSort = this.onSort.bind(this);
serverFilter = this.onFilter.bind(this);
@@ -252,8 +298,8 @@ export default class UdGrid extends React.Component {
}
components = {
- Filter: () => ,
- SettingsToggle: () =>
+ ...components,
+ Filter: () =>
}
}
@@ -261,11 +307,12 @@ export default class UdGrid extends React.Component {
{this.props.title}
+
{serverFilterControl}
- { this.state.loading ?
+ { this.state.firstLoad ?
:
rowDefinition ?
-
{rowDefinition}
- :
No results found
}
+ ,
+
]
+ :
No results found
}
+
{actions}
);
}
+}
+
+class GridToolbar extends React.Component {
+ render() {
+
+ var cursor = {
+ cursor: "pointer"
+ }
+
+ var pagination = null;
+ if (!this.props.noPaging && this.props.totalPages > 1) {
+ var pages = [];
+ var startPage = this.props.totalPages > 10 ? this.props.activePage : 1;
+
+ if (this.props.totalPages < (this.props.activePage + 10)) {
+ startPage = this.props.totalPages - 10;
+ }
+
+ for(var i = startPage; i < this.props.totalPages; i++) {
+ if (i > (startPage + 10)) {
+ break;
+ }
+
+ pages.push();
+ }
+
+ if (this.props.totalPages >= 10 && this.props.activePage < (this.props.totalPages - 10)) {
+ pages.push();
+ pages.push();
+ }
+
+ pagination =
+ }
+
+ return (
+
+ }
+ style={{display: 'inline-block', float: 'right', marginTop: '15px', marginLeft: '10px'}}
+ onClick={this.props.reload}
+ flat
+ tooltip="Refresh"
+ tooltipOptions={{position: 'bottom'}}
+ />
+ }
+ style={{display: this.props.noExport ? 'none' : 'inline-block', float: 'right', marginTop: '15px'}}
+ onClick={this.props.onExportData}
+ flat
+ tooltip="Export to CSV"
+ tooltipOptions={{position: 'bottom'}}
+ />
+ {pagination}
+
+ )
+ }
+}
+
+class Page extends React.Component {
+ render() {
+ return this.props.onPageChanged(this.props.page)}>{this.props.page}
+ }
}
\ No newline at end of file
diff --git a/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx b/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx
index acc7b482..a5000d70 100644
--- a/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx
+++ b/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx
@@ -73,8 +73,12 @@ export default class UdNavigation extends React.Component {
else
{
var children = item.children.map(x => this.renderSideNavItem(x));
+
+ var icon = item.icon;
+ var header = [icon && , item.text]
+
return
-
+
@@ -116,7 +120,7 @@ class UDSideNavItem extends React.Component {
onItemClick(e) {
e.preventDefault();
- if (this.props.hasCallback) {
+ if (this.props.type === "side-nav-item" && this.props.hasCallback) {
PubSub.publish('element-event', {
type: "clientEvent",
eventId: this.props.id,
@@ -128,7 +132,11 @@ class UDSideNavItem extends React.Component {
window.location.href = this.props.url;
}
else if (this.props.url != null) {
- this.props.history.push(`/${this.props.url.replace(/ /g, "-")}`);
+ var url = this.props.url;
+ if (!url.startsWith("/")) {
+ url = "/" + url;
+ }
+ this.props.history.push(`${url.replace(/ /g, "-")}`);
}
else if (this.props.name != null) {
this.props.history.push(`/${this.props.name.replace(/ /g, "-")}`);
diff --git a/src/UniversalDashboard.Materialize/Components/ud-select.jsx b/src/UniversalDashboard.Materialize/Components/ud-select.jsx
index 6538ae7d..31b8629a 100644
--- a/src/UniversalDashboard.Materialize/Components/ud-select.jsx
+++ b/src/UniversalDashboard.Materialize/Components/ud-select.jsx
@@ -29,10 +29,6 @@ export default class UDSelect extends React.Component {
}
onChange(e) {
- if (this.props.onChange == null) {
- return
- }
-
var val = new Array();
if (e.target.selectedOptions) {
@@ -53,16 +49,20 @@ export default class UDSelect extends React.Component {
val = JSON.stringify(val);
}
+ this.setState({
+ value: val
+ })
+
+ if (this.props.onChange == null) {
+ return
+ }
+
UniversalDashboard.publish('element-event', {
type: "clientEvent",
eventId: this.props.onChange,
eventName: 'onChange',
eventData: val
});
-
- this.setState({
- value: val
- })
}
render() {
diff --git a/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1 b/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1
index b009ae71..2cd079e9 100644
--- a/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1
+++ b/src/UniversalDashboard.Materialize/Scripts/collapsible.ps1
@@ -18,6 +18,7 @@ function New-UDCollapsible {
@{
type = 'ud-collapsible'
isPlugin = $true
+ assetId = $AssetId
id = $id
items = $Items.Invoke()
diff --git a/src/UniversalDashboard.Materialize/Scripts/grid.ps1 b/src/UniversalDashboard.Materialize/Scripts/grid.ps1
index eafcf089..a59d5e17 100644
--- a/src/UniversalDashboard.Materialize/Scripts/grid.ps1
+++ b/src/UniversalDashboard.Materialize/Scripts/grid.ps1
@@ -37,8 +37,9 @@ function New-UDGrid {
[Parameter()]
[Switch]$AutoRefresh,
[Parameter()]
- [int]$RefreshInterval = 5
-
+ [int]$RefreshInterval = 5,
+ [Parameter()]
+ [Switch]$NoExport
)
End {
@@ -74,6 +75,7 @@ function New-UDGrid {
noFilter = $NoFilter.IsPresent
autoRefresh = $AutoRefresh.IsPresent
refreshInterval = $RefreshInterval
+ noExport = $NoExport.IsPresent
}
}
}
\ No newline at end of file
diff --git a/src/UniversalDashboard.UITest/Integration/Grid.Tests.ps1 b/src/UniversalDashboard.Materialize/Tests/grid.tests.ps1
similarity index 90%
rename from src/UniversalDashboard.UITest/Integration/Grid.Tests.ps1
rename to src/UniversalDashboard.Materialize/Tests/grid.tests.ps1
index 7c9d1713..91428656 100644
--- a/src/UniversalDashboard.UITest/Integration/Grid.Tests.ps1
+++ b/src/UniversalDashboard.Materialize/Tests/grid.tests.ps1
@@ -1,26 +1,52 @@
-param([Switch]$Release)
+Describe "Grid" {
-$Env:Debug = -not $Release
+ Context "refresh doesnt reset filter" {
+ $dashboard = New-UDDashboard -Title "Test" -Content {
+ New-UDGrid -Title "Grid" -Id "Grid" -RefreshInterval 5 -AutoRefresh -DefaultSortColumn "jpg" -DefaultSortDescending -EndPoint {
+ $data = @(
+ [PSCustomObject]@{"day" = 1; jpg = "10"; mp4= "30"}
+ [PSCustomObject]@{"day" = 2; jpg = "20"; mp4= "20"}
+ [PSCustomObject]@{"day" = 3; jpg = "30"; mp4= "10"}
+ [PSCustomObject]@{"day" = 1; jpg = "10"; mp4= "30"}
+ [PSCustomObject]@{"day" = 2; jpg = "20"; mp4= "20"}
+ [PSCustomObject]@{"day" = 3; jpg = "30"; mp4= "10"}
+ [PSCustomObject]@{"day" = 1; jpg = "10"; mp4= "30"}
+ [PSCustomObject]@{"day" = 2; jpg = "20"; mp4= "20"}
+ [PSCustomObject]@{"day" = 3; jpg = "30"; mp4= "10"}
+ [PSCustomObject]@{"day" = 1; jpg = "10"; mp4= "30"}
+ [PSCustomObject]@{"day" = 2; jpg = "20"; mp4= "20"}
+ [PSCustomObject]@{"day" = 3; jpg = "30"; mp4= "10"}
+ [PSCustomObject]@{"day" = 1; jpg = "10"; mp4= "30"}
+ [PSCustomObject]@{"day" = 2; jpg = "20"; mp4= "20"}
+ [PSCustomObject]@{"day" = 3; jpg = "30"; mp4= "10"}
+ [PSCustomObject]@{"day" = 1; jpg = "10"; mp4= "30"}
+ [PSCustomObject]@{"day" = 2; jpg = "20"; mp4= "20"}
+ [PSCustomObject]@{"day" = 3; jpg = "30"; mp4= "10"}
+ )
-Import-Module "$PSScriptRoot\..\TestFramework.psm1" -Force
-$ModulePath = Get-ModulePath -Release:$Release
-$BrowserPort = Get-BrowserPort -Release:$Release
-Import-Module $ModulePath -Force
+ $data | Out-UDGridData
+ }
+ }
-Get-UDDashboard | Stop-UDDashboard
+ Set-TestDashboard -Dashboard $dashboard
-$Server = Start-UDDashboard -Port 10001 -Dashboard $dashboard
-$Driver = Start-SeFirefox
+ It "should refresh" {
+ $Element = Find-SeElement -ClassName "griddle-filter" -Driver $Driver
-function Set-TestDashboard {
- param($Dashboard)
+ Send-SeKeys -Element $Element[0] -Keys "2"
+ Start-Sleep 1
+ Send-SeKeys -Element $Element[0] -Keys "0"
- $Server.DashboardService.SetDashboard($Dashboard)
- Enter-SeUrl -Url "http://localhost:$BrowserPort" -Driver $Driver
-}
+ $Element = Find-SeElement -ClassName "griddle-row" -Driver $Driver
+ $Element.Length | Should be 6
-Describe "Grid" {
+ Start-Sleep 5
+
+ $Element = Find-SeElement -ClassName "griddle-row" -Driver $Driver
+ $Element.Length | Should be 6
+ }
+ }
Context "simple grid" {
$dashboard = New-UDDashboard -Title "Test" -Content {
@@ -497,7 +523,6 @@ Describe "Grid" {
}
-}
-Stop-SeDriver $Driver
-Stop-UDDashboard -Server $Server
\ No newline at end of file
+
+}
\ No newline at end of file
diff --git a/src/UniversalDashboard.Materialize/Tests/navigation.tests.ps1 b/src/UniversalDashboard.Materialize/Tests/navigation.tests.ps1
new file mode 100644
index 00000000..5622f844
--- /dev/null
+++ b/src/UniversalDashboard.Materialize/Tests/navigation.tests.ps1
@@ -0,0 +1,26 @@
+Describe "Navigation" {
+ Context "Named Dynamic Pages" {
+ $Page1 = New-UDPage -Name 'Page1' -Endpoint { New-UDHeading -Id 'page1' -Text 'Page1' }
+ $Page2 = New-UDPage -Name 'Page2' -Endpoint { New-UDHeading -Id 'page2' -Text 'Page2' }
+
+ Set-TestDashboard -Dashboard (
+ New-UDDashboard -Title 'test' -Pages @($Page1, $Page2)
+ )
+
+ It "should navigate between pages" {
+ Start-Sleep 1
+
+ $Element = Find-SeElement -Id "sidenavtrigger" -Driver $Driver
+ Invoke-SeClick $Element
+
+ Start-Sleep 1
+
+ $Element = Find-SeElement -LinkText "Page2" -Driver $Driver
+ Invoke-SeClick $Element
+
+ Start-Sleep 1
+
+ Find-SeElement -Id "page2" -Driver $Driver | Should not be $null
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/UniversalDashboard.Materialize/Tests/select.tests.ps1 b/src/UniversalDashboard.Materialize/Tests/select.tests.ps1
index a3bcf403..0ec643f8 100644
--- a/src/UniversalDashboard.Materialize/Tests/select.tests.ps1
+++ b/src/UniversalDashboard.Materialize/Tests/select.tests.ps1
@@ -35,13 +35,45 @@ Describe "Select" {
Start-Sleep 1
- $Element = Find-SeElement -XPath "//ul/li" -Element $Element | Select-Object -Skip 1 -First 1
+ $Element = Find-SeElement -XPath "//ul/li" -Element $Element | Select-Object -Skip 2 -First 1
Invoke-SeClick -Element $Element
$Button = Find-SeElement -Driver $Driver -Id 'btn'
Invoke-SeClick -Element $Button
- Get-TestData | Should be "2"
+ Get-TestData | Should be "3"
+ }
+ }
+
+ Context "Get-UDElement" {
+ Set-TestDashboard -Content {
+
+ New-UDButton -Text "Button" -Id 'btn' -OnClick {
+ $Value = (Get-UDElement -Id 'test').Attributes['value']
+
+ Set-TestData -Data $Value
+ }
+
+ New-UDSelect -Label "Test" -Id 'test' -Option {
+ New-UDSelectOption -Nam "Test 1" -Value "1"
+ New-UDSelectOption -Nam "Test 2" -Value "2"
+ New-UDSelectOption -Nam "Test 3" -Value "3"
+ }
+ }
+
+ It "should select item and get it with Get-UDElement" {
+ $Element = Find-SeElement -ClassName "select-wrapper" -Driver $Driver | Select-Object -First 1
+ Invoke-SeClick -Element $Element
+
+ Start-Sleep 1
+
+ $Element = Find-SeElement -XPath "//ul/li" -Element $Element | Select-Object -Skip 2 -First 1
+ Invoke-SeClick -Element $Element
+
+ $Button = Find-SeElement -Driver $Driver -Id 'btn'
+ Invoke-SeClick -Element $Button
+
+ Get-TestData | Should be "3"
}
}
}
\ No newline at end of file
diff --git a/src/UniversalDashboard/Controllers/JavaScriptController.cs b/src/UniversalDashboard/Controllers/JavaScriptController.cs
index d47397a6..34191af4 100644
--- a/src/UniversalDashboard/Controllers/JavaScriptController.cs
+++ b/src/UniversalDashboard/Controllers/JavaScriptController.cs
@@ -1,8 +1,10 @@
using Microsoft.AspNetCore.Mvc;
using NLog;
using System;
+using System.Text;
using UniversalDashboard.Interfaces;
using UniversalDashboard.Services;
+using System.IO;
namespace PowerShellProTools.UniversalDashboard.Controllers
{
@@ -20,6 +22,17 @@ public IActionResult Framework() {
return Index(_dashboardService.Dashboard.FrameworkAssetId);
}
+ [Route("plugin")]
+ public IActionResult Plugin() {
+ var stringBuilder = new StringBuilder();
+ foreach(var plugin in AssetService.Instance.Plugins) {
+ var pluginContent = System.IO.File.ReadAllText(plugin);
+ stringBuilder.AppendLine(pluginContent);
+ }
+
+ return Content(stringBuilder.ToString(), "text/javascript");
+ }
+
[Route("{asset}")]
public IActionResult Index(string asset)
{
diff --git a/src/UniversalDashboard/Controls/src/splitpane.ps1 b/src/UniversalDashboard/Controls/src/splitpane.ps1
new file mode 100644
index 00000000..902f1504
--- /dev/null
+++ b/src/UniversalDashboard/Controls/src/splitpane.ps1
@@ -0,0 +1,38 @@
+function New-UDSplitPane {
+ param(
+ [Parameter()]
+ [string]$Id = (New-Guid).ToString(),
+ [Parameter(Mandatory)]
+ [ScriptBlock]$Content,
+ [Parameter()]
+ [ValidateSet("vertical", "horizontal")]
+ [string]$Direction = "vertical",
+ [Parameter()]
+ [int]$MinimumSize,
+ [Parameter()]
+ [int]$DefaultSize
+ )
+
+ $Children = & $Content
+
+ if ($Children.Length -ne 2) {
+ throw "Split pane requires exactly two components in Content"
+ }
+
+ $Options = @{
+ content = $Children
+ id = $Id
+ split = $Direction
+ type = "ud-splitpane"
+ }
+
+ if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("MinimumSize")) {
+ $Options["minSize"] = $MinimumSize
+ }
+
+ if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("DefaultSize")) {
+ $Options["defaultSize"] = $DefaultSize
+ }
+
+ $Options
+}
\ No newline at end of file
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 be58c26e..cb1b9bf5 100644
--- a/src/UniversalDashboard/Help/New-UDIFrame.md
+++ b/src/UniversalDashboard/Help/New-UDIFrame.md
@@ -22,7 +22,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 8873da5d..b6c83dde 100644
--- a/src/UniversalDashboard/Help/New-UDImage.md
+++ b/src/UniversalDashboard/Help/New-UDImage.md
@@ -30,7 +30,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.
@@ -42,13 +42,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 94739278..a0f914b0 100644
--- a/src/UniversalDashboard/Help/New-UDInput.md
+++ b/src/UniversalDashboard/Help/New-UDInput.md
@@ -31,7 +31,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 7a33a958..32597ef2 100644
--- a/src/UniversalDashboard/Help/New-UDMonitor.md
+++ b/src/UniversalDashboard/Help/New-UDMonitor.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDMonitor.md
schema: 2.0.0
---
@@ -25,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 daf8caf9..095bef1f 100644
--- a/src/UniversalDashboard/Help/New-UDPreloader.md
+++ b/src/UniversalDashboard/Help/New-UDPreloader.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDPreloader.md
schema: 2.0.0
---
@@ -32,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 e7383236..a34e240f 100644
--- a/src/UniversalDashboard/Help/New-UDRadio.md
+++ b/src/UniversalDashboard/Help/New-UDRadio.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDRadio.md
schema: 2.0.0
---
@@ -21,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 2d198560..e8bc4bcf 100644
--- a/src/UniversalDashboard/Help/New-UDRow.md
+++ b/src/UniversalDashboard/Help/New-UDRow.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDRow.md
schema: 2.0.0
---
@@ -28,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
}
}
```
@@ -42,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 5f799b88..18b3e6fa 100644
--- a/src/UniversalDashboard/Help/New-UDSelect.md
+++ b/src/UniversalDashboard/Help/New-UDSelect.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDSelect.md
schema: 2.0.0
---
@@ -23,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 57308adf..0fd12b51 100644
--- a/src/UniversalDashboard/Help/New-UDSwitch.md
+++ b/src/UniversalDashboard/Help/New-UDSwitch.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDSwitch.md
schema: 2.0.0
---
@@ -21,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 924e1f34..070d5bc3 100644
--- a/src/UniversalDashboard/Help/New-UDTable.md
+++ b/src/UniversalDashboard/Help/New-UDTable.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDTable.md
schema: 2.0.0
---
@@ -32,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 dbcc097f..18cbb537 100644
--- a/src/UniversalDashboard/Help/New-UDTextbox.md
+++ b/src/UniversalDashboard/Help/New-UDTextbox.md
@@ -1,6 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+online version: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Help/New-UDTextbox.md
schema: 2.0.0
---
@@ -23,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 08e10fd0..8637ac8f 100644
--- a/src/UniversalDashboard/Help/New-UDTreeView.md
+++ b/src/UniversalDashboard/Help/New-UDTreeView.md
@@ -1,7 +1,7 @@
---
-Module Name: UniversalDashboard
-online version:
-online version: https://go.microsoft.com/fwlink/?LinkID=217032
+external help file: UniversalDashboard.Community-help.xml
+Module Name: UniversalDashboard.Community
+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 6e2e2c74..ec0c13b9 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 28c06d42..418f834d 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/UniversalDashboard/New-UDModuleManifest.ps1 b/src/UniversalDashboard/New-UDModuleManifest.ps1
index fa1adcee..051efcef 100644
--- a/src/UniversalDashboard/New-UDModuleManifest.ps1
+++ b/src/UniversalDashboard/New-UDModuleManifest.ps1
@@ -96,6 +96,7 @@ $manifestParameters = @{
"New-UDImageCarouselItem"
'New-UDSparklines'
'New-UDNivoTheme'
+ "New-UDSplitPane"
#Material UI
'New-UDMuAvatar'
diff --git a/src/UniversalDashboard/Services/AssetService.cs b/src/UniversalDashboard/Services/AssetService.cs
index 22c58151..c367dc8e 100644
--- a/src/UniversalDashboard/Services/AssetService.cs
+++ b/src/UniversalDashboard/Services/AssetService.cs
@@ -9,6 +9,7 @@ namespace UniversalDashboard.Services
public class AssetService
{
public Dictionary Frameworks;
+ public List Plugins;
public List Assets;
@@ -30,6 +31,7 @@ private AssetService()
{
Assets = new List();
Frameworks = new Dictionary();
+ Plugins = new List();
}
public string RegisterAsset(string asset) {
@@ -67,6 +69,16 @@ public void RegisterFramework(string name, string rootAsset)
Frameworks.Add(name, rootAsset);
}
+ public void RegisterPlugin(string rootAsset)
+ {
+ if (Plugins.Contains(rootAsset))
+ {
+ Plugins.Remove(rootAsset);
+ }
+
+ Plugins.Add(rootAsset);
+ }
+
public void ClearRegistration()
{
Assets.Clear();
diff --git a/src/UniversalDashboard/UniversalDashboard.psm1 b/src/UniversalDashboard/UniversalDashboard.psm1
index a29a2555..34ce35be 100644
--- a/src/UniversalDashboard/UniversalDashboard.psm1
+++ b/src/UniversalDashboard/UniversalDashboard.psm1
@@ -14,4 +14,7 @@ Import-Module (Join-Path $PSScriptRoot "UniversalDashboardServer.psm1")
Import-Module (Join-Path $PSScriptRoot "UniversalDashboard.Controls.psm1")
Import-Module (Join-Path $PSScriptRoot "Modules\UniversalDashboard.MaterialUI\UniversalDashboard.MaterialUI.psd1")
Import-Module (Join-Path $PSScriptRoot "Modules\UniversalDashboard.Materialize\UniversalDashboard.Materialize.psd1")
-Import-Module (Join-Path $PSScriptRoot "Modules\UniversalDashboard.Charts\UniversalDashboard.Charts.psd1")
\ No newline at end of file
+Import-Module (Join-Path $PSScriptRoot "Modules\UniversalDashboard.Charts\UniversalDashboard.Charts.psd1")
+
+$TAType = [psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")
+$TAtype::Add("DashboardColor", "UniversalDashboard.Models.DashboardColor")
diff --git a/src/UniversalDashboard/Utilities/PSObjectJsonConvert.cs b/src/UniversalDashboard/Utilities/PSObjectJsonConvert.cs
index f8725c59..a1275462 100644
--- a/src/UniversalDashboard/Utilities/PSObjectJsonConvert.cs
+++ b/src/UniversalDashboard/Utilities/PSObjectJsonConvert.cs
@@ -35,17 +35,24 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
- var dictionary = value.ToDictionary() as Dictionary;
+ var obj = value.ToDictionary();
- writer.WriteStartObject();
-
- foreach (var property in dictionary)
+ if (obj is Dictionary dictionary)
{
- writer.WritePropertyName(property.Key);
- serializer.Serialize(writer, property.Value);
- }
+ writer.WriteStartObject();
+
+ foreach (var property in dictionary)
+ {
+ writer.WritePropertyName(property.Key);
+ serializer.Serialize(writer, property.Value);
+ }
- writer.WriteEndObject();
+ writer.WriteEndObject();
+ }
+ else
+ {
+ writer.WriteValue(obj);
+ }
}
}
}
diff --git a/src/client/package-lock.json b/src/client/package-lock.json
index ac92ed6d..00090ea6 100644
--- a/src/client/package-lock.json
+++ b/src/client/package-lock.json
@@ -8125,6 +8125,24 @@
"prop-types": "^15.5.8"
}
},
+ "react-split-pane": {
+ "version": "0.1.87",
+ "resolved": "https://registry.npmjs.org/react-split-pane/-/react-split-pane-0.1.87.tgz",
+ "integrity": "sha512-F22jqWyKB1WximT0U5HKdSuB9tmJGjjP+WUyveHxJJys3ANsljj163kCdsI6M3gdfyCVC+B2rq8sc5m2Ko02RA==",
+ "requires": {
+ "prop-types": "^15.5.10",
+ "react-lifecycles-compat": "^3.0.4",
+ "react-style-proptype": "^3.0.0"
+ }
+ },
+ "react-style-proptype": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/react-style-proptype/-/react-style-proptype-3.2.2.tgz",
+ "integrity": "sha512-ywYLSjNkxKHiZOqNlso9PZByNEY+FTyh3C+7uuziK0xFXu9xzdyfHwg4S9iyiRRoPCR4k2LqaBBsWVmSBwCWYQ==",
+ "requires": {
+ "prop-types": "^15.5.4"
+ }
+ },
"react-transition-group": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.4.0.tgz",
diff --git a/src/client/package.json b/src/client/package.json
index cd980472..d962effa 100644
--- a/src/client/package.json
+++ b/src/client/package.json
@@ -39,6 +39,7 @@
"react-redux": "5.0.7",
"react-router-dom": "4.3.1",
"react-spinkit": "^3.0.0",
+ "react-split-pane": "^0.1.87",
"react-treebeard": "^2.1.0",
"redux-thunk": "2.3.0",
"tslib": "^1.9.3",
diff --git a/src/client/src/app/App.jsx b/src/client/src/app/App.jsx
index 11eb9a33..38621b67 100644
--- a/src/client/src/app/App.jsx
+++ b/src/client/src/app/App.jsx
@@ -15,7 +15,8 @@ export default class App extends React.Component {
super();
this.state = {
- loading: true
+ loading: true,
+ loadingMessage: 'Loading framework...'
}
}
@@ -38,8 +39,14 @@ export default class App extends React.Component {
document.getElementsByTagName('head')[0].appendChild(styles);
this.setState({
- loading: false
+ loadingMessage: "Loading plugins..."
})
+
+ this.loadJavascript(getApiPath() + "/api/internal/javascript/plugin", function() {
+ this.setState({
+ loading: false
+ })
+ }.bind(this));
}.bind(this))
}
diff --git a/src/client/src/app/component-registration.js b/src/client/src/app/component-registration.js
new file mode 100644
index 00000000..3fe954b4
--- /dev/null
+++ b/src/client/src/app/component-registration.js
@@ -0,0 +1,2 @@
+import UDSplitPane from './ud-splitpane';
+UniversalDashboard.register("ud-splitpane", UDSplitPane);
\ No newline at end of file
diff --git a/src/client/src/app/index.jsx b/src/client/src/app/index.jsx
index 5c389385..ebd3078f 100644
--- a/src/client/src/app/index.jsx
+++ b/src/client/src/app/index.jsx
@@ -19,5 +19,6 @@ if (!window.Promise) {
}
window.UniversalDashboard = UniversalDashboardService;
+require('./component-registration');
render(, document.getElementById('app'));
\ No newline at end of file
diff --git a/src/client/src/app/services/universal-dashboard-service.jsx b/src/client/src/app/services/universal-dashboard-service.jsx
index 90db0c00..b146dbd6 100644
--- a/src/client/src/app/services/universal-dashboard-service.jsx
+++ b/src/client/src/app/services/universal-dashboard-service.jsx
@@ -100,4 +100,4 @@ export const UniversalDashboardService = {
}
})
}
-}
\ No newline at end of file
+}
diff --git a/src/client/src/app/ud-splitpane.jsx b/src/client/src/app/ud-splitpane.jsx
new file mode 100644
index 00000000..332fbe75
--- /dev/null
+++ b/src/client/src/app/ud-splitpane.jsx
@@ -0,0 +1,69 @@
+import React from 'react';
+import SplitPane from 'react-split-pane';
+
+export default class UDSplitPane extends React.Component {
+ render() {
+ var { content } = this.props;
+
+ if (content.length !== 2) {
+ throw "Split pane supports exactly two components."
+ }
+
+ var children = content.map(x => UniversalDashboard.renderComponent(x));
+
+ return [
+ ,
+ {children}
+ ]
+ }
+}
\ No newline at end of file
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'
- }
- }
- }
-}