├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── publish.activedirectory.yaml │ ├── publish.azure.yaml │ ├── publish.hyperv.yaml │ ├── publish.monitoring.yaml │ ├── publish.network.yaml │ ├── publish.sql.yaml │ └── publish.windows.yaml ├── Components ├── ActiveDirectory │ ├── UniversalDashboard.ActiveDirectory.psd1 │ ├── UniversalDashboard.ActiveDirectory.psm1 │ ├── icon.jpg │ └── release.ps1 ├── Azure │ ├── README.md │ ├── UniversalDashboard.Azure.psd1 │ ├── UniversalDashboard.Azure.psm1 │ ├── logo.png │ └── release.ps1 ├── Hyper-V │ ├── README.md │ ├── UniversalDashboard.HyperV.psd1 │ ├── UniversalDashboard.HyperV.psm1 │ ├── logo.png │ └── release.ps1 ├── Monitoring │ ├── UniversalDashboard.Monitoring.psd1 │ ├── UniversalDashboard.Monitoring.psm1 │ ├── icon.jpg │ └── release.ps1 ├── Network │ ├── UniversalDashboard.Network.psd1 │ ├── UniversalDashboard.Network.psm1 │ ├── icon.png │ └── release.ps1 ├── SQL │ ├── README.md │ ├── UniversalDashboard.SQL.psd1 │ ├── UniversalDashboard.SQL.psm1 │ ├── icon.jpg │ └── release.ps1 ├── Windows │ ├── README.md │ ├── UniversalDashboard.Windows.psd1 │ ├── UniversalDashboard.Windows.psm1 │ ├── icon.jpg │ └── release.ps1 └── release.psm1 ├── Dashboard ├── .gitignore ├── README.md ├── UniversalDashboard.Charts │ ├── .babelrc │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── UniversalDashboard.Charts.psd1 │ ├── UniversalDashboard.Charts.psm1 │ ├── build.ps1 │ ├── classes │ │ ├── Cmdlets │ │ │ ├── NewNivoChartAxisOptionsCommand.cs │ │ │ ├── NewNivoChartCommand.cs │ │ │ ├── NewNivoFillCommand.cs │ │ │ └── NewNivoPatternCommand.cs │ │ ├── classes.csproj │ │ └── classes.sln │ ├── components │ │ ├── index.js │ │ ├── monitor.jsx │ │ ├── nivo-bar.jsx │ │ ├── nivo-bubble.jsx │ │ ├── nivo-calendar.jsx │ │ ├── nivo-heatmap.jsx │ │ ├── nivo-line.jsx │ │ ├── nivo-pie.jsx │ │ ├── nivo-stream.jsx │ │ ├── nivo-treemap.jsx │ │ ├── sparklines.jsx │ │ └── ud-chart.jsx │ ├── package-lock.json │ ├── package.json │ ├── tests │ │ ├── bar.tests.ps1 │ │ ├── driver.ps1 │ │ ├── heatmap.tests.ps1 │ │ ├── line.tests.ps1 │ │ └── pie.tests.ps1 │ └── webpack.config.js ├── UniversalDashboard.Map │ ├── .babelrc │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── Components │ │ ├── Cluster.js │ │ ├── HeatmapLayer.js │ │ ├── MarkerCluster.Default.css │ │ ├── MarkerCluster.css │ │ ├── bing-layer.jsx │ │ ├── cluster-layer.jsx │ │ ├── feature-group.jsx │ │ ├── heatmap-layer.jsx │ │ ├── index.js │ │ ├── layer-control.jsx │ │ ├── map.jsx │ │ ├── marker.jsx │ │ ├── popup.jsx │ │ ├── raster-layer.jsx │ │ ├── utils.jsx │ │ └── vector-layer.jsx │ ├── Scripts │ │ ├── baselayer.ps1 │ │ ├── cluster-layer.ps1 │ │ ├── featuregroup.ps1 │ │ ├── geojson.ps1 │ │ ├── heatmap.ps1 │ │ ├── icon.ps1 │ │ ├── layercontrol.ps1 │ │ ├── map.ps1 │ │ ├── marker.ps1 │ │ ├── overlay.ps1 │ │ ├── popup.ps1 │ │ ├── rasterlayer.ps1 │ │ └── vectorlayer.ps1 │ ├── Tests │ │ ├── driver.ps1 │ │ ├── example.json │ │ ├── map.tests.ps1 │ │ ├── point.geojson.json │ │ ├── polygon.geojson.json │ │ ├── polyline.geojson.json │ │ └── realworld.10000.ps1 │ ├── UniversalDashboard.Map.psd1 │ ├── UniversalDashboard.Map.psm1 │ ├── build.ps1 │ ├── package-lock.json │ ├── package.json │ └── webpack.config.js ├── UniversalDashboard.Monaco │ ├── .babelrc │ ├── .gitignore │ ├── Components │ │ ├── index.js │ │ └── monaco.jsx │ ├── Tests │ │ ├── driver.ps1 │ │ └── monaco.tests.ps1 │ ├── UniversalDashboard.CodeEditor.psm1 │ ├── build.ps1 │ ├── package-lock.json │ ├── package.json │ └── webpack.config.js ├── UniversalDashboard.Style │ ├── .babelrc │ ├── .gitignore │ ├── Components │ │ ├── index.js │ │ └── style.jsx │ ├── LICENSE │ ├── Tests │ │ └── style.test.ps1 │ ├── UniversalDashboard.Style.psm1 │ ├── build.ps1 │ ├── package-lock.json │ ├── package.json │ └── webpack.config.js ├── ud.build.ps1 ├── v2 │ ├── .babelrc │ ├── .gitignore │ ├── Components │ │ ├── custom-cell.jsx │ │ ├── error-card.jsx │ │ ├── index.js │ │ ├── loading.jsx │ │ ├── not-found.jsx │ │ ├── page-cycler.jsx │ │ ├── tab.jsx │ │ ├── tabs.jsx │ │ ├── text-size.jsx │ │ ├── ud-button.jsx │ │ ├── ud-chart.jsx │ │ ├── ud-checkbox.jsx │ │ ├── ud-collapsible.jsx │ │ ├── ud-counter.jsx │ │ ├── ud-fab.jsx │ │ ├── ud-footer.jsx │ │ ├── ud-grid-layout.jsx │ │ ├── ud-grid.jsx │ │ ├── ud-icon.jsx │ │ ├── ud-image-carousel.jsx │ │ ├── ud-input-field.jsx │ │ ├── ud-input.jsx │ │ ├── ud-link.jsx │ │ ├── ud-modal.jsx │ │ ├── ud-monitor.jsx │ │ ├── ud-navbar.jsx │ │ ├── ud-navigation.jsx │ │ ├── ud-page.jsx │ │ ├── ud-select.jsx │ │ └── ud-treeview.jsx │ ├── LICENSE │ ├── Scripts │ │ ├── button.ps1 │ │ ├── card.ps1 │ │ ├── chart.ps1 │ │ ├── checkbox.ps1 │ │ ├── collapsible.ps1 │ │ ├── collection.ps1 │ │ ├── column.ps1 │ │ ├── counter.ps1 │ │ ├── dashboard.ps1 │ │ ├── error.ps1 │ │ ├── event.ps1 │ │ ├── fab.ps1 │ │ ├── footer.ps1 │ │ ├── grid-layout.ps1 │ │ ├── grid.ps1 │ │ ├── heading.ps1 │ │ ├── icon.ps1 │ │ ├── iframe.ps1 │ │ ├── image copy.ps1 │ │ ├── image-carousel.ps1 │ │ ├── image.ps1 │ │ ├── input.ps1 │ │ ├── interactive │ │ │ ├── Add-Element.ps1 │ │ │ ├── Clear-Element.ps1 │ │ │ ├── Get-Element.ps1 │ │ │ ├── Hide-Modal.ps1 │ │ │ ├── Hide-Toast.ps1 │ │ │ ├── Invoke-JavaScript.ps1 │ │ │ ├── Invoke-Redirect.ps1 │ │ │ ├── Remove-Element.ps1 │ │ │ ├── Select-Element.ps1 │ │ │ ├── Set-Clipboard.ps1 │ │ │ ├── Set-Element.ps1 │ │ │ ├── Show-Modal.ps1 │ │ │ ├── Show-Toast.ps1 │ │ │ └── Sync-Element.ps1 │ │ ├── layout.ps1 │ │ ├── link.ps1 │ │ ├── monitor.ps1 │ │ ├── page.ps1 │ │ ├── paragraph.ps1 │ │ ├── preloader.ps1 │ │ ├── radio.ps1 │ │ ├── row.ps1 │ │ ├── select.ps1 │ │ ├── sidenav.ps1 │ │ ├── span.ps1 │ │ ├── splitpane.ps1 │ │ ├── switch.ps1 │ │ ├── table.ps1 │ │ ├── tabs.ps1 │ │ ├── textbox.ps1 │ │ ├── theme.ps1 │ │ ├── tooltip.ps1 │ │ └── treeview.ps1 │ ├── Tests │ │ ├── assets │ │ │ └── logo.png │ │ ├── button.tests.ps1 │ │ ├── card.tests.ps1 │ │ ├── checkbox.tests.ps1 │ │ ├── collapsible.tests.ps1 │ │ ├── collection.tests.ps1 │ │ ├── column.tests.ps1 │ │ ├── dashboard.ps1 │ │ ├── fab.tests.ps1 │ │ ├── footer.tests.ps1 │ │ ├── grid.tests.ps1 │ │ ├── image-carousel.tests.ps1 │ │ ├── input.tests.ps1 │ │ ├── layout.tests.ps1 │ │ ├── link.tests.ps1 │ │ ├── modal.tests.ps1 │ │ ├── monitor.tests.ps1 │ │ ├── navbar.tests.ps1 │ │ ├── navigation.tests.ps1 │ │ ├── page.tests.ps1 │ │ ├── preloader.tests.ps1 │ │ ├── radio.tests.ps1 │ │ ├── row.tests.ps1 │ │ ├── select.tests.ps1 │ │ ├── sidenav.tests.ps1 │ │ ├── switch.tests.ps1 │ │ ├── table.tests.ps1 │ │ ├── tabs.tests.ps1 │ │ ├── textbox.tests.ps1 │ │ ├── theme.tests.ps1 │ │ ├── toast.tests.ps1 │ │ └── treeview.tests.ps1 │ ├── UniversalDashboard.Materialize.psm1 │ ├── UniversalDashboard.psd1 │ ├── app │ │ ├── App.jsx │ │ ├── basics │ │ │ ├── datetime.jsx │ │ │ └── lazy-element.jsx │ │ ├── component-registration.js │ │ ├── config.jsx │ │ ├── faRegular.jsx │ │ ├── faSolid.jsx │ │ ├── index.jsx │ │ ├── log-service.jsx │ │ ├── polyfills.js │ │ ├── public-path.js │ │ ├── services │ │ │ ├── fetch-service.jsx │ │ │ ├── render-service.jsx │ │ │ ├── toaster.jsx │ │ │ └── universal-dashboard-service.jsx │ │ ├── ud-dashboard.jsx │ │ ├── ud-element.jsx │ │ ├── ud-html.jsx │ │ ├── ud-icon.jsx │ │ ├── ud-splitpane.jsx │ │ └── ud-tooltip.jsx │ ├── build.ps1 │ ├── example.ps1 │ ├── example │ │ ├── dashboard.ps1 │ │ ├── dashboards │ │ │ └── azure.ps1 │ │ ├── footer.ps1 │ │ ├── pages │ │ │ ├── getting-started.ps1 │ │ │ ├── home.ps1 │ │ │ ├── rest-apis.ps1 │ │ │ └── scheduled-endpoints.ps1 │ │ ├── test.ps1 │ │ └── utils.ps1 │ ├── favicon.ico │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── tests.build.ps1 │ ├── themes │ │ ├── Azure.psd1 │ │ ├── Blue.psd1 │ │ ├── DarkDefault.psd1 │ │ ├── DarkRounded.psd1 │ │ ├── Default.psd1 │ │ ├── DefaultTight.psd1 │ │ ├── Earth.psd1 │ │ ├── Green.psd1 │ │ └── Red.psd1 │ └── webpack.config.js └── v3 │ ├── .babelrc │ ├── .gitignore │ ├── Components │ ├── alert.jsx │ ├── appbar.jsx │ ├── autocomplete.jsx │ ├── avatar.jsx │ ├── backdrop.jsx │ ├── button.jsx │ ├── card-body.jsx │ ├── card-expand.jsx │ ├── card-footer.jsx │ ├── card-header.jsx │ ├── card-media.jsx │ ├── card-toolbar.jsx │ ├── card.jsx │ ├── checkbox.jsx │ ├── chips.jsx │ ├── container.jsx │ ├── datepicker.jsx │ ├── datetime.jsx │ ├── drawer.jsx │ ├── dynamic.jsx │ ├── expansion-panel.jsx │ ├── floating-action-button.jsx │ ├── form.jsx │ ├── framework │ │ ├── error-card.jsx │ │ ├── loading.jsx │ │ ├── not-authorized.jsx │ │ ├── not-found.jsx │ │ ├── not-running.jsx │ │ ├── togglecolormodes.jsx │ │ ├── ud-footer.jsx │ │ ├── ud-link.jsx │ │ ├── ud-modal.jsx │ │ ├── ud-navbar.jsx │ │ ├── ud-navigation.jsx │ │ └── ud-page.jsx │ ├── grid.jsx │ ├── hidden.jsx │ ├── icon-button.jsx │ ├── icon.jsx │ ├── index.js │ ├── link.jsx │ ├── list.jsx │ ├── paper.jsx │ ├── progress.jsx │ ├── radio.jsx │ ├── select.jsx │ ├── skeleton.jsx │ ├── slider.jsx │ ├── stepper.jsx │ ├── switch.jsx │ ├── table │ │ ├── components │ │ │ ├── baseTableBody.js │ │ │ ├── baseTableFooter.js │ │ │ └── baseTableHead.js │ │ ├── exportButton.jsx │ │ └── v2 │ │ │ ├── Alert.js │ │ │ ├── EditableCell.js │ │ │ ├── TablePaginationActions.js │ │ │ ├── baseTable.js │ │ │ ├── columns.js │ │ │ ├── filters.js │ │ │ ├── globalFilter.js │ │ │ ├── hooks │ │ │ └── useFetchData.js │ │ │ ├── table.js │ │ │ ├── toolbar.js │ │ │ └── utilities.js │ ├── tabs.jsx │ ├── textbox.jsx │ ├── timepicker.jsx │ ├── transition.jsx │ ├── treeview.jsx │ ├── typography.jsx │ ├── upload.jsx │ ├── utilities.jsx │ └── utilities │ │ └── utils.js │ ├── LICENSE │ ├── Scripts │ ├── alert.ps1 │ ├── appbar.ps1 │ ├── autocomplete.ps1 │ ├── avatar.ps1 │ ├── backdrop.ps1 │ ├── button.ps1 │ ├── card.ps1 │ ├── checkbox.ps1 │ ├── chips.ps1 │ ├── container.ps1 │ ├── dashboard.ps1 │ ├── datepicker.ps1 │ ├── datetime.ps1 │ ├── debugdashboard.ps1 │ ├── drawer.ps1 │ ├── dynamic.ps1 │ ├── error.ps1 │ ├── errorboundary.ps1 │ ├── event.ps1 │ ├── expansion-panel.ps1 │ ├── floating-action-button.ps1 │ ├── form.ps1 │ ├── grid.ps1 │ ├── heading.ps1 │ ├── hidden.ps1 │ ├── icon-button.ps1 │ ├── icon.ps1 │ ├── iframe.ps1 │ ├── image.ps1 │ ├── interactive │ │ ├── Add-Element.ps1 │ │ ├── Clear-Element.ps1 │ │ ├── Get-Element.ps1 │ │ ├── Hide-Modal.ps1 │ │ ├── Hide-Toast.ps1 │ │ ├── Invoke-JavaScript.ps1 │ │ ├── Invoke-Redirect.ps1 │ │ ├── Remove-Element.ps1 │ │ ├── Select-Element.ps1 │ │ ├── Set-Clipboard.ps1 │ │ ├── Set-Element.ps1 │ │ ├── Show-Modal.ps1 │ │ ├── Show-Toast.ps1 │ │ └── Sync-Element.ps1 │ ├── layout.ps1 │ ├── link.ps1 │ ├── list.ps1 │ ├── page.ps1 │ ├── paper.ps1 │ ├── paragraph.ps1 │ ├── progress.ps1 │ ├── radio.ps1 │ ├── select.ps1 │ ├── skeleton.ps1 │ ├── slider.ps1 │ ├── span.ps1 │ ├── splitpane.ps1 │ ├── stepper.ps1 │ ├── switch.ps1 │ ├── table.ps1 │ ├── tabs.ps1 │ ├── textbox.ps1 │ ├── theme.ps1 │ ├── timepicker.ps1 │ ├── tooltip.ps1 │ ├── transition.ps1 │ ├── treeview.ps1 │ ├── typography.ps1 │ └── upload.ps1 │ ├── Tests │ ├── README.md │ ├── appbar.tests.ps1 │ ├── autocomplete.tests.ps1 │ ├── avatar.tests.ps1 │ ├── button.tests.ps1 │ ├── card.tests.ps1 │ ├── checkbox.tests.ps1 │ ├── chips.tests.ps1 │ ├── clipboard.tests.ps1 │ ├── expansion-panel.tests.ps1 │ ├── floating-action-button.tests.ps1 │ ├── form.tests.ps1 │ ├── icon-button.tests.ps1 │ ├── icon.tests.ps1 │ ├── link.tests.ps1 │ ├── list.tests.ps1 │ ├── page.tests.ps1 │ ├── paper.tests.ps1 │ ├── progress.tests.ps1 │ ├── radio.tests.ps1 │ ├── select.tests.ps1 │ ├── stepper.tests.ps1 │ ├── switch.tests.ps1 │ ├── table.tests.ps1 │ ├── tabs.tests.ps1 │ ├── textbox.tests.ps1 │ └── treeview.tests.ps1 │ ├── UniversalDashboard.MaterialUI.psm1 │ ├── UniversalDashboard.psd1 │ ├── app │ ├── App.jsx │ ├── app-context.jsx │ ├── basics │ │ ├── datetime.jsx │ │ └── lazy-element.jsx │ ├── component-registration.js │ ├── config.jsx │ ├── faRegular.jsx │ ├── faSolid.jsx │ ├── index.jsx │ ├── log-service.jsx │ ├── polyfills.js │ ├── public-path.js │ ├── services │ │ ├── fetch-service.jsx │ │ ├── render-service.jsx │ │ ├── toaster.jsx │ │ └── universal-dashboard-service.jsx │ ├── ud-dashboard.jsx │ ├── ud-element.jsx │ ├── ud-html.jsx │ ├── ud-icon.jsx │ ├── ud-splitpane.jsx │ └── ud-tooltip.jsx │ ├── build.ps1 │ ├── dashboard.ps1 │ ├── example.ps1 │ ├── example │ ├── dashboard.ps1 │ ├── pages │ │ ├── charts │ │ │ ├── nivo-bar.ps1 │ │ │ ├── nivo-calendar.ps1 │ │ │ ├── nivo-heatmap.ps1 │ │ │ ├── nivo-line.ps1 │ │ │ ├── nivo-stream.ps1 │ │ │ ├── nivo-treemap.ps1 │ │ │ ├── nivo.ps1 │ │ │ └── sparklines.ps1 │ │ ├── data-display │ │ │ ├── avatar.ps1 │ │ │ ├── chip.ps1 │ │ │ ├── icon.ps1 │ │ │ ├── list.ps1 │ │ │ ├── table.ps1 │ │ │ ├── tree-view.ps1 │ │ │ └── typography.ps1 │ │ ├── feedback │ │ │ ├── modal.ps1 │ │ │ └── progress.ps1 │ │ ├── inputs │ │ │ ├── autocomplete.ps1 │ │ │ ├── button.ps1 │ │ │ ├── checkbox.ps1 │ │ │ ├── date-picker.ps1 │ │ │ ├── floating-action-button.ps1 │ │ │ ├── form.ps1 │ │ │ ├── radio.ps1 │ │ │ ├── select.ps1 │ │ │ ├── slider.ps1 │ │ │ ├── switch.ps1 │ │ │ ├── textbox.ps1 │ │ │ └── time-picker.ps1 │ │ ├── layout │ │ │ └── grid.ps1 │ │ ├── navigation │ │ │ ├── stepper.ps1 │ │ │ └── tabs.ps1 │ │ └── surfaces │ │ │ ├── appbar.ps1 │ │ │ ├── card.ps1 │ │ │ ├── expansion-panel.ps1 │ │ │ └── paper.ps1 │ └── start.ps1 │ ├── favicon.ico │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── sandbox.ps1 │ ├── tests.build.ps1 │ └── webpack.config.js ├── LICENSE ├── README.md ├── Templates ├── ActiveDirectory │ ├── .universal │ │ ├── dashboards.ps1 │ │ ├── scripts.ps1 │ │ └── variables.ps1 │ └── dashboards │ │ └── ActiveDirectory │ │ ├── ActiveDirectory.ps1 │ │ └── pages │ │ ├── group-membership.ps1 │ │ ├── object-info.ps1 │ │ ├── object-search.ps1 │ │ ├── password-reset.ps1 │ │ └── restore-deleted-user.ps1 ├── Demo │ ├── .universal │ │ ├── dashboards.ps1 │ │ ├── endpoints.ps1 │ │ ├── environments.ps1 │ │ ├── schedules.ps1 │ │ ├── scripts.ps1 │ │ └── tags.ps1 │ ├── CacheProcesses.ps1 │ ├── FindLargeFiles.ps1 │ ├── StartProcess.ps1 │ └── dashboards │ │ ├── CSV Editor │ │ └── CSV Editor.ps1 │ │ ├── Components │ │ ├── Components.ps1 │ │ ├── chartjs.ps1 │ │ ├── dynamic.ps1 │ │ ├── element.ps1 │ │ ├── form.ps1 │ │ ├── map.ps1 │ │ ├── nivo.ps1 │ │ └── table.ps1 │ │ └── ComputerInfo │ │ └── ComputerInfo.ps1 └── Windows │ ├── .universal │ ├── dashboards.ps1 │ ├── endpoints.ps1 │ └── environments.ps1 │ └── dashboards │ └── Windows │ └── Windows.ps1 ├── docs ├── README.md └── _config.yml └── images ├── New-UDAzureAppInsightsCounter.png ├── New-UDHVVMCard.png ├── New-UDHVVMWizard.png ├── New-UDProcessTable.png └── querytool.png /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a Bug for PowerShell Universal components 4 | labels: bug 5 | --- 6 | 7 | ### About 8 | 9 | Note that an issue reported here is in regard to the components in this repository. If you need to open an issue for the PowerShell Universal platform, please use the [Ironman Software Issue Tracker](https://github.com/ironmansoftware/issues). 10 | 11 | #### Description 12 | 13 | A clear and concise description of what the issue is. 14 | 15 | #### Additional Information 16 | 17 | Please provide additional information. This may include a forum post, some info about your environment that might be helpful or a script example to reproduce this issue. 18 | 19 | 20 | #### Version Information 21 | 22 | - Universal: 1.3.0 23 | - Universal Hosting Method (IIS, Executable, docker etc): Any 24 | - PowerShell: Any 25 | - Operating System: Any 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Request a feature for PowerShell Universal 4 | labels: enhancement 5 | --- 6 | 7 | ### About 8 | 9 | Note that an issue reported here is in regard to the components in this repository. If you need to open an issue for the PowerShell Universal platform, please use the [Ironman Software Issue Tracker](https://github.com/ironmansoftware/issues). 10 | 11 | #### Description 12 | 13 | What would you like to see and which feature does it apply to. 14 | -------------------------------------------------------------------------------- /.github/workflows/publish.activedirectory.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - Active Directory Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/ActiveDirectory/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /.github/workflows/publish.azure.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - Azure Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/Azure/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /.github/workflows/publish.hyperv.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - Hyper-V Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/Hyper-V/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /.github/workflows/publish.monitoring.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - Monitoring Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/Monitoring/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /.github/workflows/publish.network.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - Network Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/Network/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /.github/workflows/publish.sql.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - SQL Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/SQL/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /.github/workflows/publish.windows.yaml: -------------------------------------------------------------------------------- 1 | name: Publish - Windows Module 2 | on: [workflow_dispatch] 3 | 4 | jobs: 5 | build: 6 | name: Build 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Release 11 | run: ./Components/Windows/release.ps1 12 | env: 13 | PowerShellGalleryKey: ${{ secrets.POWERSHELL_GALLERY_KEY }} 14 | shell: pwsh -------------------------------------------------------------------------------- /Components/ActiveDirectory/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/ActiveDirectory/icon.jpg -------------------------------------------------------------------------------- /Components/ActiveDirectory/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.ActiveDirectory' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/Azure/README.md: -------------------------------------------------------------------------------- 1 | ## New-UDAzureAppInsightsCounter 2 | 3 | Creates a counter based on Application Insights custom events. 4 | 5 | ![](https://github.com/ironmansoftware/powershell-universal/raw/master/images/New-UDAzureAppInsightsCounter.png) -------------------------------------------------------------------------------- /Components/Azure/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/Azure/logo.png -------------------------------------------------------------------------------- /Components/Azure/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.Azure' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/Hyper-V/README.md: -------------------------------------------------------------------------------- 1 | ## New-UDHVVMCard 2 | 3 | Creates a card based on a virtual machine. 4 | 5 | ![](https://github.com/ironmansoftware/powershell-universal/raw/master/images/New-UDHVVMCard.png) 6 | 7 | ## New-UDHVVMWizard 8 | 9 | Creates a wizard used for creating new Hyper-V Virtual Machines. 10 | 11 | ![](https://github.com/ironmansoftware/powershell-universal/raw/master/images/New-UDHVVMWizard.png) -------------------------------------------------------------------------------- /Components/Hyper-V/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/Hyper-V/logo.png -------------------------------------------------------------------------------- /Components/Hyper-V/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.HyperV' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/Monitoring/UniversalDashboard.Monitoring.psm1: -------------------------------------------------------------------------------- 1 | function New-UDPerformanceCounterGraph { 2 | <# 3 | .SYNOPSIS 4 | Creates a performance counter graph based on the specified counter. 5 | 6 | .DESCRIPTION 7 | Creates a performance counter graph based on the specified counter. 8 | 9 | .PARAMETER Counter 10 | The name of the performance counter. 11 | 12 | .EXAMPLE 13 | New-UDPerformanceCounterGraph -Counter '\Network Adapter(*)\Bytes Total/sec' 14 | #> 15 | param($Counter) 16 | New-UDTypography -Text $Counter 17 | New-UDChartJSMonitor -LoadData { 18 | $Value = 0 19 | try { 20 | $Value = (Get-Counter -Counter $Counter -ErrorAction SilentlyContinue).CounterSamples[0].CookedValue 21 | } catch {} 22 | $Value | Out-UDChartJSMonitorData 23 | } -Labels "Value" -ChartBackgroundColor "#297741" -RefreshInterval 3 -DataPointHistory 10 24 | } -------------------------------------------------------------------------------- /Components/Monitoring/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/Monitoring/icon.jpg -------------------------------------------------------------------------------- /Components/Monitoring/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.Monitoring' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/Network/UniversalDashboard.Network.psm1: -------------------------------------------------------------------------------- 1 | function New-UDPingForm { 2 | New-UDForm -Content { 3 | New-UDTextbox -Id 'txtComputer' -Label 'Computer or Address' 4 | } -OnSubmit { 5 | $Data = Test-NetConnection -ComputerName $EventData.txtComputer | Select-Object -Property ComputerName,NameResolutionSucceeded,PingSucceeded 6 | New-UDTable -Data $Data 7 | } 8 | } -------------------------------------------------------------------------------- /Components/Network/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/Network/icon.png -------------------------------------------------------------------------------- /Components/Network/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.Network' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/SQL/README.md: -------------------------------------------------------------------------------- 1 | ### New-UDSQLTable 2 | 3 | Easily create a table that performs server-side querying. 4 | 5 | ### New-UDSQLQueryTool 6 | 7 | Create a query tool that allows users to query a SQL database. 8 | 9 | ![](./images/querytool.png) -------------------------------------------------------------------------------- /Components/SQL/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/SQL/icon.jpg -------------------------------------------------------------------------------- /Components/SQL/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.SQL' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/Windows/README.md: -------------------------------------------------------------------------------- 1 | # Windows 2 | 3 | A collection of components for building dashboards for Windows. 4 | 5 | ### New-UDEventLogTable 6 | 7 | Creates a table that displays Windows Event Logs. 8 | 9 | ### New-UDProcessTable 10 | 11 | Creates a table that displays process information. 12 | 13 | ![](https://github.com/ironmansoftware/powershell-universal/raw/master/images/New-UDProcessTable.png) 14 | 15 | ### New-UDServiceTable 16 | 17 | Creates a table that displays Windows services and provides the ability to stop and start services. 18 | -------------------------------------------------------------------------------- /Components/Windows/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Components/Windows/icon.jpg -------------------------------------------------------------------------------- /Components/Windows/release.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot\..\release.psm1" 2 | 3 | Publish-PSUModule -ModuleName 'UniversalDashboard.Windows' -SourceDirectory "$PSScriptRoot" -------------------------------------------------------------------------------- /Components/release.psm1: -------------------------------------------------------------------------------- 1 | function Publish-PSUModule { 2 | param( 3 | $SourceDirectory, 4 | $ModuleName 5 | ) 6 | 7 | $Folder = Join-Path ([IO.Path]::GetTempPath()) $ModuleName 8 | Remove-Item $Folder -Recurse -Force -ErrorAction SilentlyContinue 9 | Copy-Item $SourceDirectory $Folder -Container -Recurse 10 | 11 | $Module = Import-Module "$Folder" -PassThru -Scope Global -ErrorAction Continue 12 | 13 | if (-not $Module) 14 | { 15 | throw "Failed to load: $ModuleName" 16 | } 17 | 18 | $ExistingModule = Find-Module -Name $Module.Name -RequiredVersion $Module.Version -ErrorAction SilentlyContinue 19 | if (-not $ExistingModule) 20 | { 21 | Publish-Module -Path "$Folder" -NuGetApiKey $Env:PowerShellGalleryKey 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/.gitignore: -------------------------------------------------------------------------------- 1 | output/ 2 | node_modules/ 3 | public/ -------------------------------------------------------------------------------- /Dashboard/README.md: -------------------------------------------------------------------------------- 1 | # Universal Dashboard Components and Frameworks 2 | 3 | This folder contains Universal Dashboard components and frameworks for use within PowerShell Universal. 4 | 5 | # Building 6 | 7 | You can build frameworks by using `Invoke-Build`. Node JS is also required to build the JavaScript components. 8 | 9 | You can build individual components and frameworks by navigating to their directory and then invoking a build. 10 | 11 | ``` 12 | cd v3 13 | Invoke-Build 14 | ``` 15 | 16 | # Installing 17 | 18 | Once you have built a component, the package will be available in the output directory for that item. You can copy that to `%ProgramData%\PowerShellUniversal\Dashboard`. You'll have to restart PowerShell Universal for it to read the new component or framework. 19 | 20 | # Contributing 21 | 22 | We accept pull requests on this repository. Please submit issues on the [https://github.com/ironmansoftware/issues](issues) repository. 23 | 24 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">0.5%", 8 | "not dead" 9 | ] 10 | } 11 | } 12 | ], 13 | "@babel/preset-react" 14 | ], 15 | "plugins": [ 16 | "@babel/plugin-proposal-class-properties", 17 | "@babel/plugin-syntax-dynamic-import" 18 | ] 19 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ironman Software, LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/README.md: -------------------------------------------------------------------------------- 1 | UD-Charts -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/UniversalDashboard.Charts.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/UniversalDashboard.Charts/UniversalDashboard.Charts.psd1 -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/build.ps1: -------------------------------------------------------------------------------- 1 | task Build { 2 | Remove-Item -Path "$PSScriptRoot\output" -Force -ErrorAction SilentlyContinue -Recurse 3 | New-Item -Path "$PSScriptRoot\output" -ItemType Directory 4 | 5 | Push-Location "$PSScriptRoot\classes" 6 | 7 | dotnet build -c Release 8 | Copy-Item "$PSScriptRoot\classes\bin\Release\netstandard2.0\classes.dll" -Destination "$PSScriptRoot\output" 9 | 10 | Pop-Location 11 | 12 | Push-Location "$PSScriptRoot" 13 | & { 14 | $ErrorActionPreference = 'SilentlyContinue' 15 | npm install --silent 16 | npm run build --silent 17 | } 18 | Pop-Location 19 | 20 | Copy-Item "$PSScriptRoot\UniversalDashboard.Charts.psm1" "$PSScriptRoot\output" 21 | Copy-Item "$PSScriptRoot\UniversalDashboard.Charts.psd1" "$PSScriptRoot\output" 22 | } 23 | 24 | task . Build 25 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/classes/Cmdlets/NewNivoFillCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Management.Automation; 3 | 4 | namespace UniversalDashboard.Enterprise.Cmdlets 5 | { 6 | [Cmdlet(VerbsCommon.New, "UDNivoFill")] 7 | public class NewNivoFillCommand : PSCmdlet 8 | { 9 | private readonly Dictionary _values = new Dictionary(); 10 | 11 | [Parameter(Mandatory = true)] 12 | public string ElementId { get; set; } 13 | 14 | [Alias("GradientId")] 15 | [Parameter(Mandatory = true)] 16 | public string PatternId { get; set; } 17 | 18 | protected override void BeginProcessing() 19 | { 20 | WriteObject(new Dictionary 21 | { 22 | { "match", new Dictionary { 23 | { "id", ElementId } 24 | } 25 | }, 26 | { "id", PatternId } 27 | }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/classes/classes.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/classes/classes.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28917.181 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "classes", "classes.csproj", "{E95B1845-A139-4038-939B-060E0FFE2064}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E95B1845-A139-4038-939B-060E0FFE2064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E95B1845-A139-4038-939B-060E0FFE2064}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E95B1845-A139-4038-939B-060E0FFE2064}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E95B1845-A139-4038-939B-060E0FFE2064}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {7511C456-2988-4E67-9B34-C220B9DFFF36} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/index.js: -------------------------------------------------------------------------------- 1 | import NivoBar from './nivo-bar'; 2 | import NivoCalendar from './nivo-calendar'; 3 | import NivoHeatmap from './nivo-heatmap'; 4 | import NivoLine from './nivo-line'; 5 | import NivoPie from './nivo-pie'; 6 | import NivoStream from './nivo-stream'; 7 | import NivoTreemap from './nivo-treemap'; 8 | import NivoBubble from './nivo-bubble'; 9 | import UDSparklines from './sparklines'; 10 | import UDChart from './ud-chart'; 11 | import UdMonitor from './monitor'; 12 | 13 | UniversalDashboard.register("nivo-bar", NivoBar); 14 | UniversalDashboard.register("nivo-calendar", NivoCalendar); 15 | UniversalDashboard.register("nivo-heatmap", NivoHeatmap); 16 | UniversalDashboard.register("nivo-line", NivoLine); 17 | UniversalDashboard.register("nivo-pie", NivoPie); 18 | UniversalDashboard.register("nivo-stream", NivoStream); 19 | UniversalDashboard.register("nivo-treemap", NivoTreemap); 20 | UniversalDashboard.register("nivo-bubble", NivoBubble); 21 | UniversalDashboard.register("sparklines", UDSparklines); 22 | UniversalDashboard.register("ud-chartjs", UDChart); 23 | UniversalDashboard.register("chartjs-monitor", UdMonitor); -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-bar.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ResponsiveBar, Bar } from '@nivo/bar'; 3 | 4 | export default class NivoBar extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | render() { 17 | if (this.props.responsive) { 18 | return
19 | } else { 20 | return 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-bubble.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ResponsiveBubble, Bubble } from '@nivo/circle-packing'; 3 | 4 | export default class NivoBubble extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | render() { 17 | if (this.props.responsive) { 18 | return
19 | } else { 20 | return 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-calendar.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Calendar, ResponsiveCalendar } from '@nivo/calendar'; 3 | 4 | export default class NivoCalendar extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | 17 | render() { 18 | 19 | if (this.props.responsive) { 20 | return
21 | } else { 22 | return 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-heatmap.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { HeatMap, ResponsiveHeatMap } from '@nivo/heatmap'; 3 | 4 | export default class NivoHeatmap extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | render() { 17 | 18 | 19 | if (this.props.responsive) { 20 | return
21 | } else { 22 | return 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-line.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Line, ResponsiveLine } from '@nivo/line'; 3 | 4 | export default class NivoLine extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | 17 | render() { 18 | 19 | if (this.props.responsive) { 20 | return
21 | } else { 22 | return 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-pie.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ResponsivePie, Pie } from '@nivo/pie'; 3 | 4 | export default class NivoPie extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | 17 | render() { 18 | if (this.props.responsive) { 19 | return
20 | } else { 21 | return 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-stream.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Stream, ResponsiveStream } from '@nivo/stream'; 3 | 4 | export default class NivoStream extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | 17 | render() { 18 | 19 | if (this.props.responsive) { 20 | return
21 | } else { 22 | return 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Charts/components/nivo-treemap.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { TreeMap, ResponsiveTreeMap } from '@nivo/treemap'; 3 | 4 | export default class NivoTreemap extends React.Component { 5 | onClick(e) { 6 | if (this.props.hasCallback) { 7 | UniversalDashboard.publish('element-event', { 8 | type: "clientEvent", 9 | eventId: this.props.id, 10 | eventName: 'onClick', 11 | eventData: JSON.stringify(e) 12 | }); 13 | } 14 | } 15 | 16 | 17 | render() { 18 | 19 | if (this.props.responsive) { 20 | return
21 | } else { 22 | return 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">0.5%", 8 | "not dead" 9 | ] 10 | } 11 | } 12 | ], 13 | "@babel/preset-react" 14 | ], 15 | "plugins": [ 16 | "@babel/plugin-proposal-class-properties", 17 | "@babel/plugin-syntax-dynamic-import" 18 | ] 19 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Components/MarkerCluster.css: -------------------------------------------------------------------------------- 1 | .leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { 2 | -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in; 3 | -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in; 4 | -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in; 5 | transition: transform 0.3s ease-out, opacity 0.3s ease-in; 6 | } 7 | 8 | .leaflet-cluster-spider-leg { 9 | /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */ 10 | -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in; 11 | -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in; 12 | -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in; 13 | transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in; 14 | } 15 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Components/index.js: -------------------------------------------------------------------------------- 1 | require('leaflet/dist/leaflet.css') 2 | require('leaflet/dist/leaflet.js') 3 | 4 | import UDMap from './map'; 5 | import {UDLayerControl, UDLayerControlBaseLayer, UDLayerControlOverlay} from './layer-control'; 6 | import UDMarker from './marker'; 7 | import UDVectorLayer from './vector-layer'; 8 | import UDRasterLayer from './raster-layer'; 9 | import UDFeatureGroup from './feature-group'; 10 | import UDHeatmapLayer from './heatmap-layer'; 11 | import UDClusterLayer from './cluster-layer'; 12 | 13 | UniversalDashboard.register("ud-map", UDMap); 14 | UniversalDashboard.register("map-layer-control", UDLayerControl); 15 | UniversalDashboard.register("map-base-layer", UDLayerControlBaseLayer); 16 | UniversalDashboard.register("map-overlay", UDLayerControlOverlay); 17 | UniversalDashboard.register("map-marker", UDMarker); 18 | UniversalDashboard.register("map-vector-layer", UDVectorLayer); 19 | UniversalDashboard.register("map-raster-layer", UDRasterLayer); 20 | UniversalDashboard.register("map-feature-group", UDFeatureGroup); 21 | UniversalDashboard.register("map-heatmap-layer", UDHeatmapLayer); 22 | UniversalDashboard.register("map-cluster-layer", UDClusterLayer); -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Components/popup.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Popup } from 'react-leaflet'; 3 | 4 | export default class UDPopup extends React.Component { 5 | render() { 6 | 7 | var content = null; 8 | if (Array.isArray(this.props.content)) { 9 | content = this.props.content.map(x => UniversalDashboard.renderComponent(x)); 10 | } else { 11 | content = UniversalDashboard.renderComponent(this.props.content); 12 | } 13 | 14 | var position = null; 15 | if (this.props.latitude && this.props.longitude) { 16 | position = [this.props.latitude, this.props.longitude]; 17 | } 18 | 19 | return 20 | {content} 21 | 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Components/raster-layer.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { TileLayer } from 'react-leaflet'; 3 | import BingLayer from './bing-layer'; 4 | 5 | export default class UDRasterLayer extends React.Component { 6 | render() { 7 | if (this.props.bing) { 8 | return 9 | } else { 10 | return 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Components/utils.jsx: -------------------------------------------------------------------------------- 1 | export function isGuid(str) { 2 | if (str == null) { return false } 3 | 4 | if (str[0] === "{") 5 | { 6 | str = str.substring(1, str.length - 1); 7 | } 8 | var regexGuid = /^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/gi; 9 | var regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; 10 | return regexGuid.test(str); 11 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/baselayer.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapBaseLayer { 2 | param( 3 | [Parameter()] 4 | [string]$Id = (New-Guid).ToString(), 5 | [Parameter(Mandatory)] 6 | [string]$Name, 7 | [Parameter(Mandatory)] 8 | [ScriptBlock]$Content, 9 | [Parameter()] 10 | [Switch]$Checked 11 | ) 12 | 13 | @{ 14 | type = "map-base-layer" 15 | isPlugin = $true 16 | assetId = $AssetId 17 | id = $Id 18 | name = $Name 19 | content = & $Content 20 | checked = $Checked.IsPresent 21 | } 22 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/cluster-layer.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapMarkerClusterLayer { 2 | param( 3 | [Parameter()] 4 | [string]$Id = (New-Guid).ToString(), 5 | [Parameter()] 6 | [Hashtable[]]$Markers, 7 | [Parameter()] 8 | [int]$MinimumClusterSize = 2, 9 | [Parameter()] 10 | [int]$GridSize = 60 11 | ) 12 | 13 | @{ 14 | type = "map-cluster-layer" 15 | isPlugin = $true 16 | assetId = $assetId 17 | 18 | id = $id 19 | markers = $Markers 20 | minClusterSize = $MinimumClusterSize 21 | gridSize = $GridSize 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/featuregroup.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapFeatureGroup 2 | { 3 | param( 4 | [Parameter()] 5 | [string]$Id = (New-Guid).ToString(), 6 | [Parameter()] 7 | [Hashtable]$Popup, 8 | [Parameter(Mandatory)] 9 | [ScriptBlock]$Content 10 | ) 11 | 12 | End { 13 | @{ 14 | type = 'map-feature-group' 15 | id = $id 16 | isPlugin = $true 17 | assetId = $AssetId 18 | content = & $Content 19 | popup = $Popup 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/heatmap.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapHeatmapLayer { 2 | param( 3 | [Parameter(Mandatory)] 4 | $Points, 5 | [Parameter()] 6 | [string]$Id = (New-Guid).ToString(), 7 | [Parameter()] 8 | [double]$MaxIntensity, 9 | [Parameter()] 10 | [double]$Radius, 11 | [Parameter()] 12 | [int]$MaxZoom, 13 | [Parameter()] 14 | [double]$MinOpacity, 15 | [Parameter()] 16 | [int]$Blur, 17 | [Parameter()] 18 | [Hashtable]$Gradient 19 | ) 20 | 21 | $Options = @{ 22 | type = 'map-heatmap-layer' 23 | isPlugin = $true 24 | assetId = $AssetId 25 | } 26 | 27 | foreach($boundParameter in $PSCmdlet.MyInvocation.BoundParameters.GetEnumerator()) { 28 | $Options[[char]::ToLowerInvariant($boundParameter.Key[0]) + $boundParameter.Key.Substring(1)] = $boundParameter.Value 29 | } 30 | 31 | $Options 32 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/icon.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapIcon { 2 | param( 3 | [Parameter(Mandatory)] 4 | [string]$Url, 5 | [Parameter()] 6 | [int]$Height, 7 | [Parameter()] 8 | [int]$Width, 9 | [Parameter()] 10 | [int]$AnchorX, 11 | [Parameter()] 12 | [int]$AnchorY, 13 | [Parameter()] 14 | [int]$PopupAnchorX, 15 | [Parameter()] 16 | [int]$PopupAnchorY 17 | ) 18 | 19 | $Options = @{ 20 | } 21 | 22 | foreach($boundParameter in $PSCmdlet.MyInvocation.BoundParameters.GetEnumerator()) { 23 | $Options[[char]::ToLowerInvariant($boundParameter.Key[0]) + $boundParameter.Key.Substring(1)] = $boundParameter.Value 24 | } 25 | 26 | $Options 27 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/layercontrol.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapLayerControl { 2 | param( 3 | [Parameter()] 4 | [string]$Id = (New-Guid).ToString(), 5 | [Parameter()] 6 | [ValidateSet("topright", "topleft", "bottomright", "bottomleft")] 7 | [string]$Position = "topright", 8 | [Parameter()] 9 | [ScriptBlock]$Content 10 | ) 11 | 12 | @{ 13 | type = 'map-layer-control' 14 | isPlugin = $true 15 | assetId = $AssetId 16 | id = $Id 17 | content = & $Content 18 | position = $Position 19 | } 20 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/overlay.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapOverlay { 2 | param( 3 | [Parameter()] 4 | [string]$Id = (New-Guid).ToString(), 5 | [Parameter(Mandatory)] 6 | [string]$Name, 7 | [Parameter(Mandatory)] 8 | [ScriptBlock]$Content, 9 | [Parameter()] 10 | [Switch]$Checked 11 | ) 12 | 13 | @{ 14 | type = 'map-overlay' 15 | isPlugin = $true 16 | assetId = $AssetId 17 | 18 | id = $id 19 | name = $Name 20 | content = & $Content 21 | checked = $Checked.IsPresent 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Scripts/popup.ps1: -------------------------------------------------------------------------------- 1 | function New-UDMapPopup { 2 | param( 3 | [Parameter()] 4 | [string]$Id = (New-Guid).ToString(), 5 | [Parameter()] 6 | [ScriptBlock]$Content, 7 | [Parameter()] 8 | [float]$Longitude, 9 | [Parameter()] 10 | [float]$Latitude, 11 | [Parameter()] 12 | [int]$MaxWidth, 13 | [Parameter()] 14 | [int]$MinWidth 15 | ) 16 | 17 | $Options = @{ 18 | type = "map-popup" 19 | isPlugin = $true 20 | assetId = $AssetId 21 | 22 | id = $id 23 | content = & $Content 24 | 25 | maxWidth = $MaxWidth 26 | minWidth = $MinWidth 27 | } 28 | 29 | if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("Longitude")) { 30 | $Options["longitude"] = $Longitude 31 | } 32 | 33 | if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("Latitude")) { 34 | $Options["latitude"] = $Latitude 35 | } 36 | 37 | $Options 38 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Tests/example.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/UniversalDashboard.Map/Tests/example.json -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Tests/point.geojson.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "Feature", 3 | "geometry": { 4 | "type": "Point", 5 | "coordinates": [ 6 | -88.039421081542969, 7 | 44.493793487548828 8 | ] 9 | }, 10 | "properties": { 11 | "DisplayText": "Trailer: 7563\u003cbr\u003eCargo Status: Empty\u003cbr\u003eHeading: Stopped\u003cbr\u003eAs Of: 06/11 @ 07:46 - CT\u003cbr\u003eTMW: Loaded @ GEOGRE on load 1383106 since 04/17 @ 14:24\u003cbr\u003eSpireon: Empty @ GEOGRE as of 06/11 @ 07:45", 12 | "visible": true 13 | }, 14 | "style": { 15 | "color": "trailer-green-empty" 16 | } 17 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/Tests/realworld.10000.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/UniversalDashboard.Map/Tests/realworld.10000.ps1 -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/UniversalDashboard.Map.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/UniversalDashboard.Map/UniversalDashboard.Map.psd1 -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Map/build.ps1: -------------------------------------------------------------------------------- 1 | task Stage { 2 | Push-Location "$PSScriptRoot" 3 | Copy-Item "$PSScriptRoot\UniversalDashboard.Map.psm1" "$PSScriptRoot\output\UniversalDashboard.Map.psm1" -Force 4 | Get-ChildItem "$PSScriptRoot\Scripts" -File -Recurse -Filter "*.ps1" | ForEach-Object { 5 | Get-Content $_.FullName -Raw | Out-File "$PSScriptRoot\output\UniversalDashboard.Map.psm1" -Append -Encoding UTF8 6 | } 7 | Copy-Item "$PSScriptRoot\UniversalDashboard.Map.psd1" "$PSScriptRoot\output" 8 | 9 | Pop-Location 10 | } 11 | 12 | task Build { 13 | Remove-Item "$PSScriptRoot\output" -Recurse -Force -ErrorAction SilentlyContinue 14 | Push-Location "$PSScriptRoot" 15 | & { 16 | $ErrorActionPreference = 'SilentlyContinue' 17 | npm install --silent 18 | npm run build --silent 19 | } 20 | Pop-Location 21 | } 22 | 23 | task . Build, Stage -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Monaco/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">0.5%", 8 | "not dead" 9 | ] 10 | } 11 | } 12 | ], 13 | "@babel/preset-react" 14 | ], 15 | "plugins": [ 16 | "@babel/plugin-proposal-class-properties", 17 | "@babel/plugin-syntax-dynamic-import" 18 | ] 19 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Monaco/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Monaco/Components/index.js: -------------------------------------------------------------------------------- 1 | 2 | import UDMonacoEditor from './monaco'; 3 | UniversalDashboard.register("ud-monaco", UDMonacoEditor); -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Monaco/Tests/monaco.tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Editor" { 2 | Context "Editor" { 3 | Set-TestDashboard { 4 | New-UDCodeEditor -Id 'editor2' -Language 'powershell' -Theme vs-dark -Code "Get-Process" -ReadOnly -AutoSize 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Monaco/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ud-monaco", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack -p --env production", 9 | "dev": "webpack-dev-server --config webpack.config.js -p --env development" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "monaco-editor": "^0.17.1", 15 | "react-monaco-editor": "0.30.1", 16 | "react-resize-detector": "^4.2.0", 17 | "universal-dashboard": "^1.0.1" 18 | }, 19 | "devDependencies": { 20 | "@babel/core": "7.1.2", 21 | "@babel/plugin-proposal-class-properties": "^7.1.0", 22 | "@babel/plugin-syntax-dynamic-import": "^7.0.0", 23 | "@babel/polyfill": "^7.0.0", 24 | "@babel/preset-env": "7.1.0", 25 | "@babel/preset-react": "7.0.0", 26 | "babel-loader": "8.0.4", 27 | "css-loader": "^0.28.7", 28 | "file-loader": "2.0.0", 29 | "monaco-editor-webpack-plugin": "1.7.0", 30 | "style-loader": "0.23.1", 31 | "uglifyjs-webpack-plugin": "0.4.6", 32 | "webpack": "4.21.0", 33 | "webpack-cli": "^3.3.10", 34 | "webpack-dev-server": "3.1.11" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">0.5%", 8 | "not dead" 9 | ] 10 | } 11 | } 12 | ], 13 | "@babel/preset-react" 14 | ], 15 | "plugins": [ 16 | "@babel/plugin-proposal-class-properties", 17 | "@babel/plugin-syntax-dynamic-import" 18 | ] 19 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/Components/index.js: -------------------------------------------------------------------------------- 1 | import UDStyle from './style'; 2 | UniversalDashboard.register("ud-style", UDStyle); -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/Components/style.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { css } from 'emotion'; 3 | 4 | export default class UDStyle extends React.Component { 5 | render() { 6 | 7 | var children = this.props.content; 8 | if (!Array.isArray(children)) 9 | { 10 | children = [children]; 11 | } 12 | 13 | children = children.map(x => UniversalDashboard.renderComponent(x)); 14 | 15 | const style = css(this.props.style); 16 | 17 | return ( 18 | React.createElement(this.props.tag, {className: style}, children) 19 | ); 20 | } 21 | } -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ironman Software, LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/Tests/style.test.ps1: -------------------------------------------------------------------------------- 1 | Import-Module UniversalDashboard 2 | Import-Module "$PSScriptRoot/../output/UniversalDashboard.Style/UniversalDashboard.Style.psd1" -Force 3 | 4 | $Dashboard = New-UDDashboard -Title "Style Test" -Content { 5 | New-UDStyle -Style ' 6 | padding: 32px; 7 | background-color: hotpink; 8 | font-size: 24px; 9 | border-radius: 4px; 10 | &:hover { 11 | color: white; 12 | } 13 | .card { 14 | background-color: green !important; 15 | }' -Content { 16 | New-UDCard -Title 'Test' -Content { 17 | "Hello" 18 | } 19 | } 20 | } 21 | 22 | Start-UDDashboard -Port 10001 -Dashboard $Dashboard -Force -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ud-style", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack -p --env production", 9 | "dev": "webpack -p --env development" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "emotion": "^10.0.17" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "7.1.2", 18 | "@babel/plugin-proposal-class-properties": "^7.1.0", 19 | "@babel/plugin-syntax-dynamic-import": "^7.0.0", 20 | "@babel/polyfill": "^7.0.0", 21 | "@babel/preset-env": "7.1.0", 22 | "@babel/preset-react": "7.0.0", 23 | "babel-loader": "8.0.4", 24 | "css-loader": "^0.28.7", 25 | "file-loader": "2.0.0", 26 | "style-loader": "0.23.1", 27 | "uglifyjs-webpack-plugin": "0.4.6", 28 | "webpack": "4.21.0", 29 | "webpack-cli": "^3.1.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Dashboard/UniversalDashboard.Style/webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var path = require('path'); 3 | 4 | var BUILD_DIR = path.resolve(__dirname, 'public'); 5 | var SRC_DIR = path.resolve(__dirname); 6 | var APP_DIR = path.resolve(__dirname, 'src/app'); 7 | 8 | module.exports = (env) => { 9 | const isDev = env == 'development' || env == 'isolated'; 10 | 11 | return { 12 | entry: { 13 | 'index' : __dirname + '/components/index.js' 14 | }, 15 | output: { 16 | path: BUILD_DIR, 17 | filename: isDev ? '[name].bundle.js' : '[name].[hash].bundle.js', 18 | sourceMapFilename: '[name].[hash].bundle.map', 19 | publicPath: "/", 20 | library: 'udstyle', 21 | libraryTarget: 'var' 22 | }, 23 | module : { 24 | rules : [ 25 | { test: /\.css$/, loader: "style-loader!css-loader" }, 26 | { test: /\.(js|jsx)$/, exclude: [/node_modules/, /public/], loader: 'babel-loader'}, 27 | { test: /\.(eot|ttf|woff2?|otf|svg)$/, loader:'file-loader' } 28 | ] 29 | }, 30 | externals: { 31 | UniversalDashboard: 'UniversalDashboard', 32 | $: "$", 33 | react: 'react' 34 | }, 35 | resolve: { 36 | extensions: ['.json', '.js', '.jsx'] 37 | }, 38 | devtool: 'source-map' 39 | }; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Dashboard/ud.build.ps1: -------------------------------------------------------------------------------- 1 | $OutputPath = "$PSScriptRoot\..\output" 2 | 3 | task Build { 4 | . "$PSScriptRoot\UniversalDashboard.Monaco\build.ps1" 5 | Invoke-Build -File "$PSScriptRoot\UniversalDashboard.Charts\build.ps1" 6 | Invoke-Build -File "$PSScriptRoot\UniversalDashboard.Map\build.ps1" 7 | Invoke-Build -File "$PSScriptRoot\UniversalDashboard.Style\build.ps1" 8 | Invoke-Build -File "$PSScriptRoot\v2\build.ps1" 9 | Invoke-Build -File "$PSScriptRoot\v3\build.ps1" 10 | } 11 | 12 | task . Build -------------------------------------------------------------------------------- /Dashboard/v2/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">0.5%", 8 | "not dead" 9 | ] 10 | } 11 | } 12 | ], 13 | "@babel/preset-react" 14 | ], 15 | "plugins": [ 16 | "@babel/plugin-proposal-class-properties", 17 | "@babel/plugin-syntax-dynamic-import" 18 | ] 19 | } -------------------------------------------------------------------------------- /Dashboard/v2/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj -------------------------------------------------------------------------------- /Dashboard/v2/Components/error-card.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Card, Row, Col} from 'react-materialize'; 3 | 4 | export default class ErrorCard extends React.Component { 5 | render() { 6 | 7 | var icon = UniversalDashboard.renderComponent({type: 'icon', icon:'ExclamationTriangle', color: 'red'}) 8 | 9 | return 10 | 11 | 12 |

{icon} {this.props.message}

13 |
{this.props.location}
14 | 15 |
16 |
17 | } 18 | } -------------------------------------------------------------------------------- /Dashboard/v2/Components/loading.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class Loading extends React.Component { 4 | render() { 5 | return
6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v2/Components/not-found.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class NotFound extends React.Component { 4 | render() { 5 | return ( 6 |

Page Not Found

7 | ) 8 | } 9 | } -------------------------------------------------------------------------------- /Dashboard/v2/Components/page-cycler.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactInterval from 'react-interval'; 3 | import {withRouter} from 'react-router-dom'; 4 | 5 | export default class PageCycler extends React.Component { 6 | constructor() { 7 | super(); 8 | 9 | this.state = { 10 | currentPageIndex: 0 11 | } 12 | } 13 | 14 | cyclePage() { 15 | 16 | var currentPageIndex = this.state.currentPageIndex + 1; 17 | if (this.state.currentPageIndex === this.props.pages.length - 1) { 18 | currentPageIndex = 0; 19 | } 20 | 21 | this.setState({ 22 | currentPageIndex: currentPageIndex 23 | }); 24 | 25 | if (this.props.pages[currentPageIndex].name == null) { 26 | this.props.history.push(this.props.pages[currentPageIndex].url) 27 | } 28 | else { 29 | this.props.history.push("/" + this.props.pages[currentPageIndex].name.replace(" ", "-")) 30 | } 31 | 32 | 33 | } 34 | 35 | render() { 36 | return 37 | } 38 | } 39 | 40 | PageCycler = withRouter(PageCycler); 41 | 42 | -------------------------------------------------------------------------------- /Dashboard/v2/Components/text-size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class TextSize extends React.Component { 4 | render() { 5 | if (this.props.size == "Small") { 6 | return this.props.children; 7 | } 8 | 9 | if (this.props.size == "Medium") { 10 | return
{this.props.children}
; 11 | } 12 | 13 | if (this.props.size == "Large") { 14 | return

{this.props.children}

; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Dashboard/v2/Components/ud-icon.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class UdIcon extends React.Component { 4 | render() { 5 | return UniversalDashboard.renderComponent({ 6 | ...this.props, 7 | type: 'icon' 8 | }); 9 | } 10 | } -------------------------------------------------------------------------------- /Dashboard/v2/Components/ud-image-carousel.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Slider, Slide } from "react-materialize"; 3 | 4 | const UDImageCarousel = ({ items, ...props }) => { 5 | 6 | return 7 | { 8 | items.map( 9 | item => 13 | 14 | 15 | } 16 | /> 17 | ) 18 | } 19 | 20 | } 21 | 22 | export default UDImageCarousel -------------------------------------------------------------------------------- /Dashboard/v2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ironman Software, LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/checkbox.ps1: -------------------------------------------------------------------------------- 1 | function New-UDCheckbox { 2 | param( 3 | [Parameter()] 4 | [String]$Id = ([Guid]::NewGuid()), 5 | [Parameter()] 6 | $Label, 7 | [Parameter()] 8 | [Switch]$Checked, 9 | [Parameter()] 10 | [Switch]$FilledIn, 11 | [Parameter()] 12 | [Switch]$Disabled, 13 | [Parameter()] 14 | [object]$OnChange 15 | ) 16 | 17 | if ($null -ne $OnChange) { 18 | if ($OnChange -is [scriptblock]) { 19 | $OnChange = New-UDEndpoint -Endpoint $OnChange -Id ($Id + "onChange") 20 | } 21 | elseif ($OnChange -isnot [UniversalDashboard.Models.Endpoint]) { 22 | throw "OnChange must be a script block or UDEndpoint" 23 | } 24 | } 25 | 26 | @{ 27 | type = 'ud-checkbox' 28 | isPlugin = $true 29 | 30 | onChange = $OnChange.Name 31 | checked = $Checked.IsPresent 32 | filledIn = $FilledIn.IsPresent 33 | disabled = $Disabled.IsPresent 34 | id = $Id 35 | label = $Label 36 | } 37 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/counter.ps1: -------------------------------------------------------------------------------- 1 | function New-UDCounter { 2 | param( 3 | [Parameter()] 4 | [string]$Id = [Guid]::NewGuid(), 5 | [Parameter()] 6 | [string]$Title, 7 | [Parameter()] 8 | [string]$Format = "0,0", 9 | [Parameter()] 10 | [string]$Icon, 11 | [Parameter()] 12 | [DashboardColor]$BackgroundColor, 13 | [Parameter()] 14 | [DashboardColor]$FontColor, 15 | [Parameter()] 16 | [Hashtable[]]$Links, 17 | [Parameter()] 18 | [string]$TextSize, 19 | [Parameter()] 20 | [string]$TextAlignment, 21 | [Parameter()] 22 | [Endpoint]$OnClick, 23 | [Parameter()] 24 | [Switch]$AutoRefresh, 25 | [Parameter()] 26 | [int]$RefreshInterval, 27 | [Parameter()] 28 | [Endpoint]$Endpoint 29 | ) 30 | 31 | @{ 32 | type = "ud-counter" 33 | id = $id 34 | title = $title 35 | format = $format 36 | icon = $icon 37 | backgroundColor = $BackgroundColor.HtmlColor 38 | fontColor = $FontColor.HtmlColor 39 | links = $Links 40 | textSize = $TextSize 41 | textAlignment = $TextAlignment 42 | autoRefresh = $AutoRefresh.IsPresent 43 | refreshInterval = $RefreshInterval 44 | } 45 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/error.ps1: -------------------------------------------------------------------------------- 1 | function New-UDError { 2 | param( 3 | [Parameter(Mandatory)] 4 | [string]$Message, 5 | [Parameter()] 6 | [string]$Title 7 | ) 8 | 9 | @{ 10 | type = "error" 11 | isPlugin = $true 12 | assetId = $AssetId 13 | 14 | message = $Message 15 | title = $Title 16 | } 17 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/footer.ps1: -------------------------------------------------------------------------------- 1 | function New-UDFooter { 2 | param( 3 | [Parameter()] 4 | [Hashtable[]]$Links, 5 | [Parameter()] 6 | [string]$Copyright, 7 | [Parameter()] 8 | [DashboardColor]$BackgroundColor, 9 | [Parameter()] 10 | [DashboardColor]$FontColor 11 | ) 12 | 13 | @{ 14 | type = "ud-footer" 15 | isPlugin = $true 16 | assetId = $AssetId 17 | 18 | links = $Links 19 | copyright = $Copyright 20 | backgroundColor = $BackgroundColor.HtmlColor 21 | fontColor = $FontColor.HtmlColor 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/heading.ps1: -------------------------------------------------------------------------------- 1 | function New-UDHeading { 2 | param( 3 | [Parameter()] 4 | [String]$Id = ([Guid]::NewGuid()), 5 | [Parameter(ParameterSetName = "Content")] 6 | [ScriptBlock]$Content, 7 | [Parameter(ParameterSetName = "Text")] 8 | [string]$Text, 9 | [Parameter()] 10 | [ValidateSet("1", "2", "3", "4", "5", "6")] 11 | $Size, 12 | [Parameter()] 13 | [UniversalDashboard.Models.DashboardColor]$Color = 'black' 14 | ) 15 | 16 | if ($PSCmdlet.ParameterSetName -eq "Text") { 17 | $Content = { $Text } 18 | } 19 | 20 | New-UDElement -Id $Id -Tag "h$size" -Content $Content -Attributes @{ 21 | style = @{ 22 | color = $Color.HtmlColor 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/iframe.ps1: -------------------------------------------------------------------------------- 1 | function New-UDIFrame { 2 | param( 3 | [Parameter()] 4 | [String]$Id = ([Guid]::NewGuid()), 5 | [Parameter()] 6 | $Uri 7 | ) 8 | 9 | New-UDElement -Id $Id -Tag "iframe" -Attributes @{ 10 | src = $Uri 11 | } 12 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/image.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/v2/Scripts/image.ps1 -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Add-Element.ps1: -------------------------------------------------------------------------------- 1 | function Add-UDElement { 2 | param( 3 | [Parameter(Mandatory)] 4 | [string]$ParentId, 5 | [Parameter(Mandatory)] 6 | [ScriptBlock]$Content, 7 | [Parameter()] 8 | [Switch]$Broadcast 9 | ) 10 | 11 | $NewContent = & $Content 12 | 13 | $Data = @{ 14 | componentId = $ParentId 15 | elements = $NewContent 16 | } 17 | 18 | if ($Broadcast) 19 | { 20 | $DashboardHub.SendWebSocketMessage("addElement", $Data) 21 | } 22 | else 23 | { 24 | $DashboardHub.SendWebSocketMessage($ConnectionId, "addElement", $Data) 25 | } 26 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Clear-Element.ps1: -------------------------------------------------------------------------------- 1 | function Clear-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Id, 6 | [Parameter()] 7 | [Switch]$Broadcast 8 | ) 9 | 10 | if ($Broadcast) 11 | { 12 | $DashboardHub.SendWebSocketMessage("clearElement", $Id) 13 | } 14 | else 15 | { 16 | $DashboardHub.SendWebSocketMessage($ConnectionId, "clearElement", $Id) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Get-Element.ps1: -------------------------------------------------------------------------------- 1 | function Get-UDElement 2 | { 3 | [CmdletBinding()] 4 | param( 5 | [Parameter(Mandatory)] 6 | [string]$Id 7 | ) 8 | 9 | $requestId = '' 10 | 11 | $requestId = [Guid]::NewGuid().ToString() 12 | 13 | $Data = @{ 14 | requestId = $requestId 15 | componentId = $Id 16 | } 17 | 18 | $DashboardHub.SendWebSocketMessage($ConnectionId, "requestState", $Data) 19 | $stateRequestService.Get($requestId) 20 | } 21 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Hide-Modal.ps1: -------------------------------------------------------------------------------- 1 | function Hide-UDModal 2 | { 3 | $DashboardHub.SendWebSocketMessage($ConnectionId, "closeModal", $null) 4 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Hide-Toast.ps1: -------------------------------------------------------------------------------- 1 | function Hide-UDToast 2 | { 3 | param( 4 | [Parameter(Mandatory, Position = 0)] 5 | [string]$Id 6 | ) 7 | 8 | $DashboardHub.SendWebSocketMessage($ConnectionId, "hideToast", $Id) 9 | } 10 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Invoke-JavaScript.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-UDJavaScript 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$JavaScript 6 | ) 7 | 8 | $DashboardHub.SendWebSocketMessage($ConnectionId, "invokejavascript", $JavaScript) 9 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Invoke-Redirect.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-UDRedirect 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Url, 6 | [Parameter()] 7 | [Switch]$OpenInNewWindow 8 | ) 9 | 10 | $Data = @{ 11 | url = $Url 12 | openInNewWindow = $OpenInNewWindow.IsPresent 13 | } 14 | 15 | $DashboardHub.SendWebSocketMessage($ConnectionId, "redirect", $Data) 16 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Remove-Element.ps1: -------------------------------------------------------------------------------- 1 | function Remove-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Id, 6 | [Parameter()] 7 | [string]$ParentId, 8 | [Parameter()] 9 | [Switch]$Broadcast 10 | ) 11 | 12 | $Data = @{ 13 | componentId = $Id 14 | parentId = $ParentId 15 | } 16 | 17 | if ($Broadcast) 18 | { 19 | $DashboardHub.SendWebSocketMessage("removeElement", $Data) 20 | } 21 | else 22 | { 23 | $DashboardHub.SendWebSocketMessage($ConnectionId, "removeElement", $Data) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Select-Element.ps1: -------------------------------------------------------------------------------- 1 | function Select-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory, ParameterSetName = "Normal")] 5 | [string]$Id, 6 | [Parameter(ParameterSetName = "Normal")] 7 | [Switch]$ScrollToElement 8 | ) 9 | 10 | $Data = @{ 11 | id = $Id 12 | scrollToElement = $ScrollToElement 13 | } 14 | 15 | $DashboardHub.SendWebSocketMessage($ConnectionId, "select", $Data) 16 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Set-Clipboard.ps1: -------------------------------------------------------------------------------- 1 | function Set-UDClipboard 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Data, 6 | [Parameter()] 7 | [Switch]$ToastOnSuccess, 8 | [Parameter()] 9 | [Switch]$ToastOnError 10 | ) 11 | 12 | $cpData = @{ 13 | data = $Data 14 | toastOnSuccess = $ToastOnSuccess.IsPresent 15 | toastOnError = $ToastOnError.IsPresent 16 | } 17 | 18 | $DashboardHub.SendWebSocketMessage($ConnectionId, "clipboard", $cpData) 19 | } 20 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Set-Element.ps1: -------------------------------------------------------------------------------- 1 | function Set-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Id, 6 | [Parameter()] 7 | [Hashtable]$Attributes, 8 | [Parameter()] 9 | [ScriptBlock]$Content, 10 | [Parameter()] 11 | [Switch]$Broadcast 12 | ) 13 | 14 | $c = @() 15 | if ($Content) 16 | { 17 | $c = . $Content 18 | } 19 | 20 | $Data = @{ 21 | componentId = $Id 22 | state = @{ 23 | attributes = $Attributes 24 | content = $c 25 | } 26 | } 27 | 28 | if ($Broadcast) 29 | { 30 | $DashboardHub.SendWebSocketMessage("setState", $data) 31 | } 32 | else 33 | { 34 | $DashboardHub.SendWebSocketMessage($ConnectionId, "setState", $Data) 35 | } 36 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Show-Modal.ps1: -------------------------------------------------------------------------------- 1 | function Show-UDModal 2 | { 3 | param( 4 | [Parameter()] 5 | [Switch]$FullScreen, 6 | [Parameter()] 7 | [ScriptBlock]$Footer, 8 | [Parameter()] 9 | [ScriptBlock]$Header, 10 | [Parameter()] 11 | [ScriptBlock]$Content, 12 | [Parameter()] 13 | [Switch]$Persistent, 14 | [Parameter()] 15 | [Switch]$FullWidth, 16 | [Parameter()] 17 | [ValidateSet("xs", "sm", "md", "lg", "xl")] 18 | [string]$MaxWidth 19 | ) 20 | 21 | $Modal = @{ 22 | dismissible = -not $Persistent.IsPresent 23 | max = $MaxWidth 24 | fullWidth = $FullWidth.IsPresent 25 | fullScreen = $FullScreen.IsPresent 26 | } 27 | 28 | if ($null -ne $Footer) 29 | { 30 | $Modal['footer'] = & $Footer 31 | } 32 | 33 | if ($null -ne $Header) 34 | { 35 | $Modal['header'] = & $Header 36 | } 37 | 38 | if ($null -ne $Content) 39 | { 40 | $Modal['content'] = & $Content 41 | } 42 | 43 | $DashboardHub.SendWebSocketMessage($ConnectionId, "showModal", $modal) 44 | } 45 | -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/interactive/Sync-Element.ps1: -------------------------------------------------------------------------------- 1 | function Sync-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory, ValueFromPipeline)] 5 | [string[]]$Id, 6 | [Parameter()] 7 | [Switch]$Broadcast 8 | ) 9 | 10 | Process 11 | { 12 | foreach($i in $Id) 13 | { 14 | if ($Broadcast) 15 | { 16 | $DashboardHub.SendWebSocketMessage("syncElement", $I) 17 | } 18 | else 19 | { 20 | $DashboardHub.SendWebSocketMessage($ConnectionId, "syncElement", $I) 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/layout.ps1: -------------------------------------------------------------------------------- 1 | function New-UDLayout { 2 | param( 3 | [Parameter(Mandatory = $true)] 4 | [ValidateRange(1, 12)] 5 | [int]$Columns, 6 | [Parameter(Mandatory = $true)] 7 | [ScriptBlock]$Content 8 | ) 9 | 10 | $Components = $Content.Invoke() 11 | 12 | if ($Columns -eq 1) 13 | { 14 | $LargeColumnSize = 12 15 | $MediumColumnSize = 12 16 | $SmallColumnSize = 12 17 | } 18 | else 19 | { 20 | $LargeColumnSize = 12 / $Columns 21 | $MediumColumnSize = 12 / ($Columns / 2) 22 | $SmallColumnSize = 12 23 | } 24 | 25 | $Offset = 0 26 | $ComponentCount = ($Components | Measure-Object).Count 27 | 28 | while ($Offset -lt $ComponentCount) { 29 | $ColumnObjects = $Components | Select-Object -Skip $Offset -First $Columns | ForEach-Object { 30 | New-UDColumn -SmallSize $SmallColumnSize -MediumSize $MediumColumnSize -LargeSize $LargeColumnSize -Content { 31 | $_ 32 | } 33 | } 34 | 35 | New-UDRow -Columns { 36 | $ColumnObjects 37 | } 38 | 39 | $Offset += $Columns 40 | } 41 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/paragraph.ps1: -------------------------------------------------------------------------------- 1 | function New-UDParagraph { 2 | param( 3 | [Parameter(ParameterSetName = 'content')] 4 | [ScriptBlock]$Content, 5 | [Parameter(ParameterSetName = 'text')] 6 | [string]$Text, 7 | [Parameter()] 8 | [UniversalDashboard.Models.DashboardColor]$Color = 'black' 9 | ) 10 | 11 | if ($PSCmdlet.ParameterSetName -eq 'content') { 12 | New-UDElement -Tag 'p' -Content $Content -Attributes @{ 13 | style = @{ 14 | color = $Color.HtmlColor 15 | } 16 | } 17 | } 18 | else { 19 | New-UDElement -Tag 'p' -Content { 20 | $Text 21 | } -Attributes @{ 22 | style = @{ 23 | color = $Color.HtmlColor 24 | } 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/radio.ps1: -------------------------------------------------------------------------------- 1 | function New-UDRadio { 2 | param( 3 | [Parameter()] 4 | [String]$Id = ([Guid]::NewGuid()), 5 | [Parameter()] 6 | [String]$Label, 7 | [Parameter()] 8 | [Switch]$WithGap, 9 | [Parameter()] 10 | [Switch]$Disabled, 11 | [Parameter()] 12 | [object]$OnChange, 13 | [Parameter()] 14 | [string]$Group, 15 | [Parameter()] 16 | [Switch]$Checked 17 | ) 18 | 19 | $Attributes = @{ 20 | type = "radio" 21 | onChange = $OnChange 22 | name = $Group 23 | } 24 | 25 | if ($Checked) { 26 | $Attributes.checked = 'checked' 27 | } 28 | 29 | if ($WithGap) { 30 | $Attributes.className = 'with-gap' 31 | } 32 | 33 | if ($Disabled) { 34 | $Attributes.disabled = $true 35 | } 36 | 37 | New-UDElement -Tag "p" -Content { 38 | New-UDElement -Tag 'label' -Content { 39 | New-UDElement -Id $Id -Tag "input" -Attributes $Attributes 40 | New-UDElement -Tag 'span' -Content { $label } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/row.ps1: -------------------------------------------------------------------------------- 1 | function New-UDRow { 2 | [CmdletBinding(DefaultParameterSetName = 'static')] 3 | param( 4 | [Parameter()] 5 | [String]$Id = ([Guid]::NewGuid()), 6 | [Parameter(ParameterSetName = "static", Position = 0)] 7 | [ScriptBlock]$Columns, 8 | [Parameter(ParameterSetName = "dynamic")] 9 | [object]$Endpoint, 10 | [Parameter(ParameterSetName = "dynamic")] 11 | [Switch]$AutoRefresh, 12 | [Parameter(ParameterSetName = "dynamic")] 13 | [int]$RefreshInterval = 5 14 | ) 15 | 16 | if ($PSCmdlet.ParameterSetName -eq 'static') { 17 | New-UDElement -Tag 'div' -Attributes @{ 18 | className = 'row' 19 | } -Content $Columns -Id $Id 20 | } 21 | else { 22 | New-UDElement -Tag 'div' -Attributes @{ 23 | className = 'row' 24 | } -Endpoint $Endpoint -AutoRefresh:$AutoRefresh -RefreshInterval $RefreshInterval -Id $Id 25 | } 26 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/span.ps1: -------------------------------------------------------------------------------- 1 | function New-UDSpan { 2 | param( 3 | [Parameter()] 4 | [String]$Id = ([Guid]::NewGuid()), 5 | [Parameter()] 6 | $Content 7 | ) 8 | 9 | New-UDElement -Id $Id -Tag "span" -Content { 10 | $Content 11 | } 12 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/splitpane.ps1: -------------------------------------------------------------------------------- 1 | function New-UDSplitPane { 2 | param( 3 | [Parameter()] 4 | [string]$Id = ([Guid]::NewGuid()).ToString(), 5 | [Parameter(Mandatory)] 6 | [ScriptBlock]$Content, 7 | [Parameter()] 8 | [ValidateSet("vertical", "horizontal")] 9 | [string]$Direction = "vertical", 10 | [Parameter()] 11 | [int]$MinimumSize, 12 | [Parameter()] 13 | [int]$DefaultSize 14 | ) 15 | 16 | $Children = & $Content 17 | 18 | if ($Children.Length -ne 2) { 19 | Write-Error "Split pane requires exactly two components in Content" 20 | return 21 | } 22 | 23 | $Options = @{ 24 | content = $Children 25 | id = $Id 26 | split = $Direction.ToLower() 27 | type = "ud-splitpane" 28 | } 29 | 30 | if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("MinimumSize")) { 31 | $Options["minSize"] = $MinimumSize 32 | } 33 | 34 | if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("DefaultSize")) { 35 | $Options["defaultSize"] = $DefaultSize 36 | } 37 | 38 | $Options 39 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/switch.ps1: -------------------------------------------------------------------------------- 1 | function New-UDSwitch { 2 | param( 3 | [Parameter()] 4 | [String]$Id = ([Guid]::NewGuid()), 5 | [Parameter()] 6 | $OnText = "On", 7 | [Parameter()] 8 | $OffText = "Off", 9 | [Parameter()] 10 | [Switch]$Disabled, 11 | [Parameter()] 12 | [object]$OnChange, 13 | [Parameter()] 14 | [Switch]$On 15 | ) 16 | 17 | $Attributes = @{ 18 | type = "checkbox" 19 | onChange = $OnChange 20 | } 21 | 22 | if ($On) { 23 | $Attributes.checked = 'checked' 24 | } 25 | 26 | 27 | if ($Disabled) { 28 | $Attributes.disabled = $true 29 | } 30 | 31 | New-UDElement -Tag "div" -Content { 32 | New-UDElement -Tag "label" -Content { 33 | $OffText 34 | New-UDElement -Tag "input" -Attributes $Attributes -Id $Id 35 | New-UDElement -Tag "span" -Attributes @{className = "lever"} 36 | $OnText 37 | } 38 | } -Attributes @{ 39 | className = "switch" 40 | } 41 | } -------------------------------------------------------------------------------- /Dashboard/v2/Scripts/tooltip.ps1: -------------------------------------------------------------------------------- 1 | function New-UDTooltip { 2 | param( 3 | [Parameter()] 4 | [string]$Id = [Guid]::NewGuid(), 5 | [Parameter()] 6 | [ValidateSet("top", "bottom", "left", "right")] 7 | [string]$Place = "top", 8 | [Parameter()] 9 | [ValidateSet("dark", "success", "warning", "error", "info", "light")] 10 | [string]$Type = "dark", 11 | [Parameter()] 12 | [ValidateSet("float", "solid")] 13 | [string]$Effect, 14 | [Parameter(Mandatory)] 15 | [ScriptBlock]$TooltipContent, 16 | [Parameter(Mandatory)] 17 | [ScriptBlock]$Content 18 | ) 19 | 20 | @{ 21 | type = "ud-tooltip" 22 | tooltipType = $Type 23 | effect = $Effect 24 | place = $Place 25 | id = $Id 26 | tooltipContent = & $TooltipContent 27 | content = & $Content 28 | } 29 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/v2/Tests/assets/logo.png -------------------------------------------------------------------------------- /Dashboard/v2/Tests/button.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl "$Address/Test/Button" -Target $Driver 2 | 3 | Describe "New-UDButton" { 4 | It "has text" { 5 | (Find-SeElement -Driver $Driver -Id "button1").Text | should be "Click Me" 6 | } 7 | 8 | It "is floating" { 9 | Find-SeElement -Driver $Driver -ClassName "btn-floating" | should not be $null 10 | } 11 | 12 | It "is flat" { 13 | Find-SeElement -Driver $Driver -ClassName "btn-flat" | should not be $null 14 | } 15 | 16 | It "has ud-button" { 17 | Find-SeElement -Driver $Driver -ClassName "ud-button" | should not be $null 18 | } 19 | 20 | It "was clicked" { 21 | Find-SeElement -Id 'button5' -Driver $Driver | Invoke-SeClick 22 | Get-TestData | Should be $true 23 | } 24 | 25 | It "has an icon" { 26 | $Element = Find-SeElement -ClassName 'fa-user' -Driver $Driver 27 | $Element | should not be $null 28 | } 29 | 30 | It "has colors" { 31 | $Element = Find-SeElement -Id 'button7' -Driver $Driver 32 | $Style = Get-SeElementAttribute -Element $Element -Attribute "style" 33 | $Style | Should be "color: rgb(0, 0, 0); background-color: rgb(255, 0, 0); " 34 | } 35 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/checkbox.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/checkbox" 2 | 3 | Describe "Checkbox" { 4 | It "is checked" { 5 | (Find-SeElement -Id 'Test1' -Driver $Driver).GetAttribute("checked") | should be $true 6 | } 7 | 8 | It "is checked" { 9 | (Find-SeElement -Id 'Test2' -Driver $Driver).GetAttribute("disabled") | should be $true 10 | } 11 | 12 | It "is checked" { 13 | Find-SeElement -ClassName 'filled-in' -Driver $Driver | should not be $null 14 | } 15 | 16 | It "should check item" { 17 | $Element = Find-SeElement -Id 'Test4' -Driver $Driver 18 | Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver 19 | Get-TestData | should be $true 20 | 21 | Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver 22 | Get-TestData | should be "False" 23 | } 24 | 25 | It "should check item" { 26 | $Element = Find-SeElement -Id 'Test5' -Driver $Driver 27 | Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver 28 | Start-Sleep 3 29 | 30 | (Find-SeElement -Id 'Result' -Driver $Driver).Text | Should be "true" 31 | } 32 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/collapsible.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/test/collapsible" -Target $Driver 2 | 3 | Describe "Collapsible" { 4 | Context "Simple Collapsible" { 5 | It "should have title text" { 6 | (Find-SeElement -Id "First" -Driver $Driver).Text.Contains("FirstHeader") | Should be $true 7 | } 8 | 9 | It "should have body text" { 10 | (Find-SeElement -Id "First" -Driver $Driver).Text.Contains("FirstBody") | Should be $true 11 | } 12 | 13 | It "should have title text for endpoint" { 14 | Start-Sleep 1 15 | 16 | (Find-SeElement -Id "First-Endpoint" -Driver $Driver).Text.Contains("Endpoint") | should be $true 17 | } 18 | 19 | It "should have correct colors" { 20 | Find-SeElement -Id "Collapsible2-Second" -Driver $Driver | Get-SeElementCssValue -Name "color" | Should be 'rgb(152, 255, 63)' 21 | Find-SeElement -Id "Collapsible2-Second" -Driver $Driver | Get-SeElementCssValue -Name "background-color" | Should be 'rgb(76, 255, 110)' 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/collection.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/test/collection" -Target $Driver 2 | 3 | Describe "New-UDCollection" { 4 | Context "With Header" { 5 | It "has a header" { 6 | Find-SeElement -Driver $Driver -ClassName "with-header" | Should not be $null 7 | (Find-SeElement -Driver $Driver -ClassName "collection-header").Text | should be "Header" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/fab.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/test/fab" -Target $Driver 2 | 3 | Describe "Fab" { 4 | Context "Fab with buttons" { 5 | It "should handle clicks" { 6 | $Element = Find-SeElement -Driver $Driver -Id 'main' 7 | $Element | Invoke-SeClick 8 | 9 | Get-TestData | should be "parent" 10 | 11 | Start-Sleep 1 12 | 13 | $Element = Find-SeElement -Driver $Driver -Id 'btn' 14 | $Element | Invoke-SeClick -JavascriptClick -Driver $Driver 15 | 16 | Get-TestData | should be "child" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/footer.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl "$Address/Test" -Target $Driver 2 | 3 | Describe "New-UDFooter" { 4 | It "should have footer" { 5 | Get-SeElement -Target $Driver -Id 'ud-footer' | should not be $null 6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/image-carousel.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/Test/image-carousel" -Target $Driver 2 | Describe "New-UDImageCarousel" { 3 | $carousel = Find-SeElement -Driver $driver -Id 'carousel-demo' 4 | 5 | it "Should have image carousel component" { 6 | $carousel -eq $null | Should be $false 7 | } 8 | 9 | it "Should have 3 slides in the image carousel" { 10 | $carousel.FindElementsByClassName('carousel-item').count | Should be 3 11 | } 12 | 13 | it "Should have fixed button" { 14 | $carousel.FindElementsByClassName('carousel-fixed-item').count | should be 1 15 | } 16 | 17 | it "Should have custom height Size" { 18 | $carousel.Size.Height | should be 750 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Dashboard/v2/Tests/link.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl "$Address/Test/Link" -Target $Driver 2 | 3 | Describe "New-UDLink" { 4 | It "should have fired onClick handler" { 5 | $Element = Find-SeElement -Driver $Driver -Id 'link' 6 | Invoke-SeClick -Element $Element 7 | Get-TestData | Should be 'Clicked' 8 | } 9 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/monitor.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/Test/Monitor" -Target $Driver 2 | 3 | Describe "New-UDMonitor" { 4 | It "should hide x axis" { 5 | } 6 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/navigation.tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Navigation" { 2 | Context "Named Dynamic Pages" { 3 | $Page1 = New-UDPage -Name 'Page1' -Endpoint { New-UDHeading -Id 'page1' -Text 'Page1' } 4 | $Page2 = New-UDPage -Name 'Page2' -Endpoint { New-UDHeading -Id 'page2' -Text 'Page2' } 5 | 6 | Set-TestDashboard -Dashboard ( 7 | New-UDDashboard -Title 'test' -Pages @($Page1, $Page2) 8 | ) 9 | 10 | It "should navigate between pages" { 11 | Start-Sleep 1 12 | 13 | $Element = Find-SeElement -Id "sidenavtrigger" -Driver $Driver 14 | Invoke-SeClick $Element -JavaScriptClick -Driver $Driver 15 | 16 | Start-Sleep 1 17 | 18 | $Element = Find-SeElement -LinkText "Page2" -Driver $Driver 19 | Invoke-SeClick $Element -JavaScriptClick -Driver $Driver 20 | 21 | Start-Sleep 1 22 | 23 | Find-SeElement -Id "page2" -Driver $Driver | Should not be $null 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/page.tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Page" { 2 | It "should have an error" { 3 | Enter-SeUrl "$Address/Test/Error" -Target $Driver 4 | } 5 | 6 | It "should have a single item" { 7 | Enter-SeUrl "$Address/Test/SingleItem" -Target $Driver 8 | } 9 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/preloader.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/Test/Preloader" -Target $Driver 2 | 3 | Describe "New-UDPreloader" { 4 | It 'should be indeterminate' { 5 | Find-SeElement -ClassName 'progress'-Driver $Driver | Should not be $null 6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/radio.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/Radio" 2 | 3 | Describe "New-UDRadio" { 4 | It 'selects first item' { 5 | Find-SeElement -Id 'first' -Driver $Driver | Invoke-SeClick -JavaScriptClick -Driver $Driver 6 | Find-SeElement -Id 'first' -Driver $Driver | Get-SeElementAttribute -Attribute "checked" | should be $true 7 | } 8 | 9 | It 'selects first item' { 10 | Find-SeElement -Id 'first2' -Driver $Driver | Invoke-SeClick -JavaScriptClick -Driver $Driver 11 | Get-TestData | Should be $true 12 | } 13 | 14 | It 'should have first item selected' { 15 | Find-SeElement -Id 'first3' -Driver $Driver | Get-SeElementAttribute -Attribute "checked" | should be $true 16 | } 17 | 18 | It 'should have first item selected' { 19 | Find-SeElement -Id 'first4' -Driver $Driver | Get-SeElementAttribute -Attribute "disabled" | should be $true 20 | } 21 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/row.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/Row" 2 | 3 | Describe "New-UDRow" { 4 | It "should have content" { 5 | Find-SeElement -Id "hi" -Driver $Driver | Should not be $null 6 | } 7 | 8 | It "should have content" { 9 | Find-SeElement -Id "hi2" -Driver $Driver | Should not be $null 10 | } 11 | 12 | It "should have an ID" { 13 | Find-SeElement -Id "MyRow" -Driver $Driver | Should not be $null 14 | } 15 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/sidenav.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/Test/Switch" -Target $Driver 2 | 3 | Describe "New-UDSideNav" { 4 | It "should have a side nav" { 5 | Find-SeElement -Id 'sideNav1' -Target $Driver | should not be $null 6 | Find-SeElement -Id 'sideNav2' -Target $Driver | should not be $null 7 | Find-SeElement -Id 'sideNav3' -Target $Driver | should not be $null 8 | Find-SeElement -Id 'sideNav4' -Target $Driver | should not be $null 9 | } 10 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/switch.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Url "$Address/Test/Switch" -Target $Driver 2 | 3 | Describe "New-UDSwitch" { 4 | It "should be checked" { 5 | Find-SeElement -Id 'switch1' -Driver $Driver | Get-SeElementAttribute -Attribute "checked" | should be $true 6 | } 7 | 8 | It "should be disabled" { 9 | Find-SeElement -Id 'switch2' -Driver $Driver | Get-SeElementAttribute -Attribute "disabled" | should be $true 10 | } 11 | 12 | It "should be checked" { 13 | Find-SeElement -Id 'switch3' -Driver $Driver | Invoke-SeClick -JavascriptCLick -Driver $Driver 14 | Get-TestData | Should be $true 15 | } 16 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/tabs.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/Tabs" 2 | 3 | Describe "New-UDTabContainer" { 4 | It "has tabs" { 5 | Find-SeElement -Driver $Driver -ClassName "mdc-tab-bar" | should not be $null 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /Dashboard/v2/Tests/theme.tests.ps1: -------------------------------------------------------------------------------- 1 | Describe 'theme' { 2 | . "$PSScriptRoot\..\scripts\theme.ps1" 3 | 4 | It "should return themes" { 5 | (Get-UDTheme | Measure-Object).Count | should be 9 6 | } 7 | 8 | It "should return theme by name" { 9 | Get-UDTheme -Name 'Azure' | should not be $null 10 | } 11 | 12 | It "should convert theme to css" { 13 | $Theme = Get-UDTheme -Name 'Azure' 14 | $css = ConvertTo-UDThemeCss -Theme $Theme 15 | } 16 | } -------------------------------------------------------------------------------- /Dashboard/v2/Tests/toast.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl "$Address/Test/Toast" -Target $Driver 2 | 3 | Describe 'toast' { 4 | It "should show toast icon" { 5 | Find-SeElement -Id 'button' -Target $Driver | Invoke-SeClick 6 | Find-SeElement -Id 'Toast' -Target $Driver 7 | } 8 | } -------------------------------------------------------------------------------- /Dashboard/v2/UniversalDashboard.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/v2/UniversalDashboard.psd1 -------------------------------------------------------------------------------- /Dashboard/v2/app/basics/datetime.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import moment from 'moment'; 3 | 4 | export default class DateTime extends React.Component { 5 | render() { 6 | var y = this.props.value; 7 | 8 | var moment2 = moment(y); 9 | if (moment2.isValid) { 10 | return {moment2.format(this.props.dateTimeFormat)}; 11 | } 12 | 13 | return {y}; 14 | } 15 | } -------------------------------------------------------------------------------- /Dashboard/v2/app/component-registration.js: -------------------------------------------------------------------------------- 1 | import UDSplitPane from './ud-splitpane'; 2 | import UDTooltip from './ud-tooltip'; 3 | 4 | UniversalDashboard.register("ud-splitpane", UDSplitPane); 5 | UniversalDashboard.register("ud-tooltip", UDTooltip); 6 | 7 | require("./../Components/index.js"); 8 | -------------------------------------------------------------------------------- /Dashboard/v2/app/config.jsx: -------------------------------------------------------------------------------- 1 | export function getApiPath() { 2 | return "" 3 | } 4 | 5 | export function getWsApiPath() { 6 | var protocol = "ws://"; 7 | if (window.location.protocol.toLowerCase().startsWith("https")) { 8 | protocol = "wss://"; 9 | } 10 | 11 | return protocol + window.location.hostname + (window.location.port ? ':' + window.location.port : ''); 12 | } 13 | 14 | function getMeta(metaName) { 15 | const metas = document.getElementsByTagName('meta'); 16 | 17 | for (let i = 0; i < metas.length; i++) { 18 | if (metas[i].getAttribute('name') === metaName) { 19 | return metas[i].getAttribute('content'); 20 | } 21 | } 22 | 23 | return ''; 24 | } 25 | 26 | export function getDashboardId() { 27 | var dashboardId = localStorage.getItem("ud-dashboard"); 28 | if (!dashboardId || dashboardId === '') 29 | { 30 | dashboardId = getMeta('ud-dashboard'); 31 | } 32 | 33 | return dashboardId; 34 | } -------------------------------------------------------------------------------- /Dashboard/v2/app/index.jsx: -------------------------------------------------------------------------------- 1 | import './public-path'; 2 | import '@babel/polyfill'; 3 | import React from 'react'; 4 | import {render} from 'react-dom'; 5 | import $ from "jquery"; 6 | import 'whatwg-fetch'; 7 | import Promise from 'promise-polyfill'; 8 | import { UniversalDashboardService } from './services/universal-dashboard-service.jsx'; 9 | import App from './App'; 10 | 11 | window.react = require('react'); 12 | window['reactdom'] = require('react-dom'); 13 | window['reactrouterdom'] = require('react-router-dom'); 14 | 15 | // To add to window 16 | if (!window.Promise) { 17 | window.Promise = Promise; 18 | } 19 | 20 | window.UniversalDashboard = UniversalDashboardService; 21 | require('./component-registration'); 22 | 23 | render(, document.getElementById('app')); -------------------------------------------------------------------------------- /Dashboard/v2/app/log-service.jsx: -------------------------------------------------------------------------------- 1 | import {fetchPost} from './services/fetch-service.jsx'; 2 | 3 | function Log(component, level, message) { 4 | fetchPost(`/log/${component}/${level}`, {message: message}) 5 | } 6 | 7 | export function LogDebug(component, message) { 8 | Log(component, "debug", message); 9 | } 10 | 11 | export function LogError(component, message) { 12 | Log(component, "error", message); 13 | } 14 | 15 | export function LogInfo(component, message) { 16 | Log(component, "info", message); 17 | } -------------------------------------------------------------------------------- /Dashboard/v2/app/public-path.js: -------------------------------------------------------------------------------- 1 | if (document.getElementsByTagName('base')[0].href.indexOf("_BASEHREF_") == -1) 2 | { 3 | __webpack_public_path__ = document.getElementsByTagName('base')[0].href; 4 | window.baseUrl = document.getElementsByTagName('base')[0].href.replace(window.location.origin, "").replace(/\/$/, "");; 5 | } 6 | else 7 | { 8 | __webpack_public_path__ = "/" 9 | window.baseUrl = "" 10 | } -------------------------------------------------------------------------------- /Dashboard/v2/app/services/toaster.jsx: -------------------------------------------------------------------------------- 1 | import iziToast from 'izitoast/dist/js/iziToast.min.js' 2 | import 'izitoast/dist/css/iziToast.min.css'; 3 | 4 | const toaster = { 5 | show: (model) => { 6 | iziToast.show(model); 7 | }, 8 | hide: (id) => { 9 | var toast = document.querySelector('#' + id); 10 | iziToast.hide({}, toast); 11 | }, 12 | info: (model) => { 13 | iziToast.info(model); 14 | }, 15 | success: (model) => { 16 | iziToast.success(model); 17 | }, 18 | warning: (model) => { 19 | iziToast.warning(model); 20 | }, 21 | error: (model) => { 22 | iziToast.error(model); 23 | } 24 | } 25 | 26 | export default toaster; -------------------------------------------------------------------------------- /Dashboard/v2/app/ud-html.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class UdHtml extends React.Component { 4 | render() { 5 | return
6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v2/build.ps1: -------------------------------------------------------------------------------- 1 | task Stage { 2 | Push-Location "$PSScriptRoot" 3 | Copy-Item "$PSScriptRoot\UniversalDashboard.Materialize.psm1" "$PSScriptRoot\output\UniversalDashboard.Materialize.psm1" -Force 4 | Get-ChildItem "$PSScriptRoot\Scripts" -File -Recurse -Filter "*.ps1" | ForEach-Object { 5 | Get-Content $_.FullName -Raw | Out-File "$PSScriptRoot\output\UniversalDashboard.Materialize.psm1" -Append -Encoding UTF8 6 | } 7 | Copy-Item "$PSScriptRoot\themes" "$PSScriptRoot\output\Themes" -Container -Recurse 8 | Copy-Item "$PSScriptRoot\UniversalDashboard.psd1" "$PSScriptRoot\output" 9 | Copy-Item "$PSScriptRoot\example.ps1" "$PSScriptRoot\output" 10 | 11 | Pop-Location 12 | } 13 | 14 | task Build { 15 | Remove-Item "$PSScriptRoot\output" -Recurse -Force -ErrorAction SilentlyContinue 16 | Push-Location "$PSScriptRoot" 17 | & { 18 | $ErrorActionPreference = 'SilentlyContinue' 19 | npm install --silent 20 | npm run build --silent 21 | } 22 | Pop-Location 23 | } 24 | 25 | task . Build, Stage -------------------------------------------------------------------------------- /Dashboard/v2/example.ps1: -------------------------------------------------------------------------------- 1 | New-UDDashboard -Title "Hello, World!" -Content { 2 | 3 | } -------------------------------------------------------------------------------- /Dashboard/v2/example/footer.ps1: -------------------------------------------------------------------------------- 1 | New-UDFooter -Copyright "Ironman Software, LLC" -Links ( 2 | New-UDLink -Url "https://ironmansoftware.com" -Text "Ironman Software, LLC" -Icon dashboard 3 | ) -------------------------------------------------------------------------------- /Dashboard/v2/example/test.ps1: -------------------------------------------------------------------------------- 1 | Import-Module ("$PSScriptRoot\..\output\UniversalDashboard.Community.psd1") -Force 2 | Get-UDDashboard | Stop-UDDashboard 3 | $Dashboard = . "$PSScriptRoot\dashboard.ps1" 4 | Start-UDDashboard -Dashboard $Dashboard -Port 10001 -------------------------------------------------------------------------------- /Dashboard/v2/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/v2/favicon.ico -------------------------------------------------------------------------------- /Dashboard/v2/themes/Blue.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Name = "Blue" 3 | Definition = @{ 4 | UDDashboard = @{ 5 | BackgroundColor = "#333333" 6 | FontColor = "#FFFFF" 7 | } 8 | UDNavBar = @{ 9 | BackgroundColor = "#067DB2" 10 | FontColor = "#55b3ff" 11 | } 12 | UDCard = @{ 13 | BackgroundColor = "#05608A" 14 | FontColor = "#FFFFFF" 15 | } 16 | UDChart = @{ 17 | BackgroundColor = "#05608A" 18 | FontColor = "#FFFFFF" 19 | } 20 | UDMonitor = @{ 21 | BackgroundColor = "#05608A" 22 | FontColor = "#FFFFFF" 23 | } 24 | UDTable = @{ 25 | BackgroundColor = "#05608A" 26 | FontColor = "#FFFFFF" 27 | } 28 | UDGrid = @{ 29 | BackgroundColor = "#05608A" 30 | FontColor = "#FFFFFF" 31 | } 32 | UDCounter = @{ 33 | BackgroundColor = "#252525" 34 | FontColor = "#FFFFFF" 35 | } 36 | UDInput = @{ 37 | BackgroundColor = "#05608A" 38 | FontColor = "#FFFFFF" 39 | } 40 | UDFooter = @{ 41 | BackgroundColor = "#067DB2" 42 | FontColor = "#55b3ff" 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Dashboard/v2/themes/Earth.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Name = "Earth" 3 | Definition = @{ 4 | UDDashboard = @{ 5 | BackgroundColor = "#AB7D06" 6 | FontColor = "#FFFFF" 7 | } 8 | UDNavBar = @{ 9 | BackgroundColor = "#8A6505" 10 | FontColor = "#55b3ff" 11 | } 12 | UDCard = @{ 13 | BackgroundColor = "#6B4E04" 14 | FontColor = "#FFFFFF" 15 | } 16 | UDChart = @{ 17 | BackgroundColor = "#6B4E04" 18 | FontColor = "#FFFFFF" 19 | } 20 | UDMonitor = @{ 21 | BackgroundColor = "#6B4E04" 22 | FontColor = "#FFFFFF" 23 | } 24 | UDTable = @{ 25 | BackgroundColor = "#6B4E04" 26 | FontColor = "#FFFFFF" 27 | } 28 | UDGrid = @{ 29 | BackgroundColor = "#6B4E04" 30 | FontColor = "#FFFFFF" 31 | } 32 | UDCounter = @{ 33 | BackgroundColor = "#6B4E04" 34 | FontColor = "#FFFFFF" 35 | } 36 | UDInput = @{ 37 | BackgroundColor = "#6B4E04" 38 | FontColor = "#FFFFFF" 39 | } 40 | UDFooter = @{ 41 | BackgroundColor = "#8A6505" 42 | FontColor = "#55b3ff" 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Dashboard/v2/themes/Green.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Name = "Green" 3 | Definition = @{ 4 | UDDashboard = @{ 5 | BackgroundColor = "#628C3C" 6 | FontColor = "#000000" 7 | } 8 | UDNavBar = @{ 9 | BackgroundColor = "#72C220" 10 | FontColor = "#000000" 11 | } 12 | UDCard = @{ 13 | BackgroundColor = "#70B24B" 14 | FontColor = "#000000" 15 | } 16 | UDChart = @{ 17 | BackgroundColor = "#70B24B" 18 | FontColor = "#000000" 19 | } 20 | UDMonitor = @{ 21 | BackgroundColor = "#70B24B" 22 | FontColor = "#000000" 23 | } 24 | UDTable = @{ 25 | BackgroundColor = "#70B24B" 26 | FontColor = "#000000" 27 | } 28 | UDGrid = @{ 29 | BackgroundColor = "#70B24B" 30 | FontColor = "#000000" 31 | } 32 | UDCounter = @{ 33 | BackgroundColor = "#70B24B" 34 | FontColor = "#000000" 35 | } 36 | UDInput = @{ 37 | BackgroundColor = "#70B24B" 38 | FontColor = "#000000" 39 | } 40 | UDFooter = @{ 41 | BackgroundColor = "#72C220" 42 | FontColor = "#000000" 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Dashboard/v2/themes/Red.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Name = "Red" 3 | Definition = @{ 4 | UDDashboard = @{ 5 | BackgroundColor = "#333333" 6 | FontColor = "#FFFFF" 7 | } 8 | UDNavBar = @{ 9 | BackgroundColor = "#C2290F" 10 | FontColor = "#55b3ff" 11 | } 12 | UDCard = @{ 13 | BackgroundColor = "#A1220C" 14 | FontColor = "#FFFFFF" 15 | } 16 | UDChart = @{ 17 | BackgroundColor = "#A1220C" 18 | FontColor = "#FFFFFF" 19 | } 20 | UDMonitor = @{ 21 | BackgroundColor = "#A1220C" 22 | FontColor = "#FFFFFF" 23 | } 24 | UDTable = @{ 25 | BackgroundColor = "#A1220C" 26 | FontColor = "#FFFFFF" 27 | } 28 | UDGrid = @{ 29 | BackgroundColor = "#A1220C" 30 | FontColor = "#FFFFFF" 31 | } 32 | UDCounter = @{ 33 | BackgroundColor = "#A1220C" 34 | FontColor = "#FFFFFF" 35 | } 36 | UDInput = @{ 37 | BackgroundColor = "#A1220C" 38 | FontColor = "#FFFFFF" 39 | } 40 | UDFooter = @{ 41 | BackgroundColor = "#C2290F" 42 | FontColor = "#55b3ff" 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Dashboard/v3/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">1.0%", 8 | "not dead", 9 | "IE 11" 10 | ] 11 | } 12 | } 13 | ], 14 | "babel-preset-react-app" 15 | ], 16 | "plugins": [ 17 | ["minify-dead-code-elimination", { "optimizeRawSize": true }], 18 | "@babel/plugin-proposal-class-properties", 19 | "@babel/plugin-syntax-dynamic-import", 20 | "@babel/plugin-transform-arrow-functions" 21 | ] 22 | } -------------------------------------------------------------------------------- /Dashboard/v3/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj 65 | 66 | *.bom.xml -------------------------------------------------------------------------------- /Dashboard/v3/Components/alert.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Alert, AlertTitle } from '@material-ui/lab'; 3 | import { withComponentFeatures } from 'universal-dashboard'; 4 | 5 | function UDAlert(props) { 6 | return 7 | {props.title && props.title !== "" ? {props.title} : } 8 | {props.render(props.children)} 9 | 10 | } 11 | 12 | export default withComponentFeatures(UDAlert); -------------------------------------------------------------------------------- /Dashboard/v3/Components/avatar.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { withStyles } from '@material-ui/core/styles'; 4 | import Avatar from '@material-ui/core/Avatar'; 5 | import classNames from 'classnames' 6 | 7 | function UDMuAvatar(props) { 8 | 9 | const { classes } = props; 10 | 11 | return ( 12 | 13 | ); 14 | } 15 | 16 | export default UDMuAvatar; 17 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/backdrop.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Backdrop } from '@material-ui/core'; 3 | import { withComponentFeatures } from 'universal-dashboard'; 4 | import { makeStyles } from '@material-ui/core/styles'; 5 | 6 | const useStyles = makeStyles((theme) => ({ 7 | backdrop: props => ({ 8 | zIndex: theme.zIndex.drawer + 1, 9 | color: props.color, 10 | }), 11 | })); 12 | 13 | 14 | function UDBackdrop(props) { 15 | const classes = useStyles(props); 16 | 17 | return props.onClick()}>{props.render(props.children)} 18 | } 19 | 20 | export default withComponentFeatures(UDBackdrop); -------------------------------------------------------------------------------- /Dashboard/v3/Components/card-body.jsx: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from "react"; 2 | import { withStyles, CssBaseline, CardContent } from "@material-ui/core"; 3 | import classNames from "classnames"; 4 | 5 | const styles = theme => ({ 6 | content: { 7 | display: "flex" 8 | } 9 | }); 10 | 11 | export class UDCardBody extends React.Component { 12 | render() { 13 | const { 14 | className, 15 | classes, 16 | id, 17 | style 18 | } = this.props; 19 | 20 | return ( 21 | 22 | 23 | 24 | 29 | {UniversalDashboard.renderComponent(this.props.content)} 30 | 31 | 32 | ); 33 | } 34 | } 35 | 36 | export default withStyles(styles)(UDCardBody); 37 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/card-header.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import CardHeader from '@material-ui/core/CardHeader'; 3 | 4 | const UDCardHeader = (props) => { 5 | return ( 6 | 7 | ) 8 | } 9 | 10 | export default UDCardHeader; -------------------------------------------------------------------------------- /Dashboard/v3/Components/card-media.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import classNames from "classnames" 3 | import { makeStyles } from '@material-ui/core/styles'; 4 | import { CardMedia } from "@material-ui/core"; 5 | 6 | const useStyles = makeStyles(theme => ({ 7 | media: { 8 | objectFit: "cover", 9 | backgroundColor: "transparent" 10 | // height: "100%" 11 | } 12 | })); 13 | 14 | 15 | const UDCardMedia = (props) => { 16 | const classes = useStyles(); 17 | const { component, alt, height, image, title, source } = props; 18 | 19 | return ( 20 | 30 | ); 31 | } 32 | 33 | export default UDCardMedia; 34 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/container.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Container from '@material-ui/core/Container'; 3 | import { withComponentFeatures } from 'universal-dashboard' 4 | 5 | const UDContainer = props => { 6 | return {props.render(props.children)} 7 | } 8 | 9 | export default withComponentFeatures(UDContainer) -------------------------------------------------------------------------------- /Dashboard/v3/Components/datetime.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | var dayjs = require('dayjs') 3 | var localizedFormat = require('dayjs/plugin/localizedFormat') 4 | var relativeTime = require('dayjs/plugin/relativeTime') 5 | dayjs.extend(relativeTime) 6 | dayjs.extend(localizedFormat) 7 | 8 | const DayTime = (props) => { 9 | return dayjs(props.inputObject).format(props.format); 10 | } 11 | 12 | export default DayTime; 13 | 14 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/drawer.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Drawer from '@material-ui/core/Drawer' 3 | import { withComponentFeatures } from 'universal-dashboard' 4 | import { makeStyles } from '@material-ui/core/styles' 5 | 6 | const useStyles = makeStyles(theme => ({ 7 | button: { 8 | margin: theme.spacing.unit, 9 | }, 10 | leftIcon: { 11 | marginRight: theme.spacing.unit, 12 | }, 13 | rightIcon: { 14 | marginLeft: theme.spacing.unit, 15 | }, 16 | list: { 17 | width: 250, 18 | }, 19 | })) 20 | 21 | const UDDrawer = props => { 22 | const classes = useStyles() 23 | 24 | const onClose = () => { 25 | props.setState({open: false}) 26 | } 27 | 28 | return ( 29 | 30 |
31 | {props.render(props.children)} 32 |
33 |
34 | ) 35 | } 36 | 37 | export default withComponentFeatures(UDDrawer) 38 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/floating-action-button.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { makeStyles } from '@material-ui/core/styles'; 3 | import Fab from '@material-ui/core/Fab'; 4 | import Icon from './icon'; 5 | 6 | function onClick(props) { 7 | if (props.onClick) { 8 | UniversalDashboard.publish('element-event', { 9 | type: "clientEvent", 10 | eventId: props.onClick, 11 | eventName: 'onChange', 12 | eventData: '' 13 | }); 14 | } 15 | } 16 | 17 | export default function FloatingActionButton(props) { 18 | const useStyles = makeStyles(theme => ({ 19 | root: { 20 | '& > *': { 21 | margin: theme.spacing(1), 22 | }, 23 | }, 24 | extendedIcon: { 25 | marginRight: theme.spacing(1), 26 | }, 27 | })); 28 | 29 | const classes = useStyles(); 30 | 31 | var icon = null; 32 | if (props.icon) { 33 | icon = UniversalDashboard.renderComponent(props.icon) 34 | } 35 | 36 | return ( 37 |
38 | onClick(props)} size={props.size} id={props.id}> 39 | {icon} 40 | 41 |
42 | ); 43 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/framework/loading.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class Loading extends React.Component { 4 | render() { 5 | return
6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/framework/not-authorized.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Typography from '@material-ui/core/Typography'; 3 | import UDIcon from '../icon'; 4 | 5 | export default class NotAuthorized extends React.Component { 6 | render() { 7 | return ( 8 |
9 | Not Authorized 10 |
11 | ) 12 | } 13 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/framework/not-found.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Typography from '@material-ui/core/Typography'; 3 | import UDIcon from '../icon'; 4 | 5 | export default class NotFound extends React.Component { 6 | render() { 7 | return ( 8 |
9 | Page Not Found 10 |
11 | ) 12 | } 13 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/framework/not-running.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Typography from '@material-ui/core/Typography'; 3 | import UDIcon from '../icon'; 4 | import { Redirect } from 'react-router-dom' 5 | 6 | const NotRunning = () => { 7 | 8 | const [redirect, setRedirect] = React.useState(false); 9 | 10 | React.useEffect(() => { 11 | var token = setInterval(() => { 12 | UniversalDashboard.get('/api/internal/dashboard', function(json) { 13 | setRedirect(true); 14 | }); 15 | }, 5000); 16 | 17 | return () => { clearInterval(token) } 18 | }, [true]); 19 | 20 | if (redirect) { 21 | return 22 | } 23 | 24 | return ( 25 |
26 | Dashboard is not running 27 |
28 | ) 29 | } 30 | 31 | export default NotRunning; -------------------------------------------------------------------------------- /Dashboard/v3/Components/framework/togglecolormodes.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import IconButton from '@material-ui/core/IconButton'; 3 | import DarkIcon from '@material-ui/icons/Brightness7'; 4 | import LightIcon from '@material-ui/icons/Brightness4'; 5 | import {AppContext} from './../../app/app-context'; 6 | 7 | export default props => { 8 | return ( 9 | 10 | {context => { 11 | return ( 12 | { 15 | const next = context.theme === 'dark' ? 'light' : 'dark' 16 | sessionStorage.setItem('theme', next); 17 | context.setTheme(next) 18 | }} 19 | > 20 | {context.theme === 'dark' ? : } 21 | 22 | ) 23 | 24 | }} 25 | 26 | 27 | ) 28 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/framework/ud-footer.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import AppBar from '@material-ui/core/AppBar'; 3 | import Toolbar from '@material-ui/core/Toolbar'; 4 | import Link from '@material-ui/core/Link'; 5 | import { makeStyles } from '@material-ui/core/styles'; 6 | 7 | const useStyles = makeStyles(theme => ({ 8 | appBar: { 9 | top: 'auto', 10 | bottom: 0, 11 | } 12 | })); 13 | 14 | 15 | const UDFooter = (props) => { 16 | const classes = useStyles(); 17 | 18 | return ( 19 | 20 | Created with PowerShell Universal Dashboard 21 | 22 | ) 23 | } 24 | 25 | export default UDFooter; -------------------------------------------------------------------------------- /Dashboard/v3/Components/grid.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Grid from '@material-ui/core/Grid'; 3 | 4 | const UDGrid = (props) => { 5 | return ( 6 | 7 | { props.children && UniversalDashboard.renderComponent(props.children)} 8 | 9 | ) 10 | } 11 | 12 | export default UDGrid; -------------------------------------------------------------------------------- /Dashboard/v3/Components/hidden.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Hidden from '@material-ui/core/Hidden'; 3 | 4 | const UDHidden = (props) => { 5 | return ( 6 | 7 | { props.children && UniversalDashboard.renderComponent(props.children)} 8 | 9 | ) 10 | } 11 | 12 | export default UDHidden; -------------------------------------------------------------------------------- /Dashboard/v3/Components/icon.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react' 3 | import classNames from "classnames" 4 | 5 | export default class UDIcon extends React.Component { 6 | render(){ 7 | return UniversalDashboard.renderComponent({ 8 | className: classNames(this.props.className, "ud-mu-icon"), 9 | style: {...this.props.style}, 10 | ...this.props, 11 | type: 'icon' 12 | }) 13 | } 14 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/link.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { makeStyles } from '@material-ui/core/styles'; 3 | import Link from '@material-ui/core/Link'; 4 | import classNames from 'classnames' 5 | import { withComponentFeatures } from 'universal-dashboard' 6 | 7 | const useStyles = makeStyles(theme => { 8 | link: { 9 | margin: theme.spacing.unit 10 | } 11 | }); 12 | 13 | const UDLink = (props) => { 14 | const classes = useStyles(); 15 | 16 | const { 17 | id, 18 | url, 19 | underline, 20 | style, 21 | variant, 22 | className, 23 | openInNewWindow, 24 | content, 25 | text, 26 | onClick 27 | } = props; 28 | 29 | return ( 30 | { 40 | if (onClick) 41 | { 42 | e.preventDefault(); 43 | onClick(); 44 | } 45 | }}> 46 | {!text ? (UniversalDashboard.renderComponent(content)) : text} 47 | 48 | ) 49 | } 50 | 51 | export default withComponentFeatures(UDLink); 52 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/paper.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { makeStyles } from "@material-ui/core/styles"; 3 | import Paper from "@material-ui/core/Paper"; 4 | import classNames from "classnames" 5 | import { withComponentFeatures } from 'universal-dashboard'; 6 | 7 | const useStyles = makeStyles(theme => ({ 8 | root: { 9 | flexGrow: 1, 10 | display: "flex", 11 | padding: theme.spacing.unit * 2, 12 | margin: theme.spacing.unit 13 | } 14 | })); 15 | 16 | const UdPaper = (props) => { 17 | 18 | const classes = useStyles(); 19 | 20 | const { 21 | elevation, 22 | style, 23 | height, 24 | width, 25 | square 26 | } = props; 27 | 28 | return ( 29 | 38 | {props.render(props.children)} 39 | 40 | ); 41 | } 42 | 43 | export default withComponentFeatures(UdPaper); 44 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/progress.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import CircularProgress from '@material-ui/core/CircularProgress'; 3 | import LinearProgress from '@material-ui/core/LinearProgress'; 4 | import { makeStyles } from '@material-ui/core/styles'; 5 | 6 | const useStyles = makeStyles((theme) => ({ 7 | bar: props => ({ 8 | backgroundColor: props.progressColor ?? null 9 | }), 10 | root: props => ({ 11 | backgroundColor: props.backgroundColor ?? null 12 | }), 13 | circular: props => ({ 14 | color: props.progressColor ?? null 15 | }) 16 | })) 17 | 18 | export default function Progress(props) { 19 | 20 | const classes = useStyles(props); 21 | 22 | if (props.circular) { 23 | return 26 | } 27 | 28 | return
32 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/skeleton.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Skeleton } from '@material-ui/lab'; 3 | import { withComponentFeatures } from 'universal-dashboard'; 4 | 5 | function UDSkeleton(props) { 6 | 7 | var animation = null; 8 | if (props.animation === "disabled") 9 | { 10 | animation = false; 11 | } 12 | 13 | if (props.animation === "wave") 14 | { 15 | animation = 'wave'; 16 | } 17 | 18 | return 23 | } 24 | 25 | export default withComponentFeatures(UDSkeleton); -------------------------------------------------------------------------------- /Dashboard/v3/Components/slider.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | import {withComponentFeatures} from 'universal-dashboard'; 3 | import Slider from '@material-ui/core/Slider'; 4 | import {FormContext} from './form'; 5 | 6 | const UDSliderWithContext = (props) => { 7 | return ( 8 | 9 | { 10 | ({onFieldChange}) => 11 | } 12 | 13 | ) 14 | } 15 | 16 | const UDSlider = (props) => { 17 | const onChange = (e, value) => { 18 | props.setState({ value }) 19 | props.onFieldChange({id: props.id, value }); 20 | } 21 | 22 | const onChangeCommitted = (e, value) => { 23 | if (props.onChange) 24 | { 25 | props.onChange(value); 26 | } 27 | } 28 | 29 | useEffect(() => { 30 | props.onFieldChange({id: props.id, value: props.value }); 31 | return () => {} 32 | }, true) 33 | 34 | return 35 | } 36 | 37 | export default withComponentFeatures(UDSliderWithContext); -------------------------------------------------------------------------------- /Dashboard/v3/Components/table/components/baseTableBody.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { TableBody, TableCell, TableRow } from "@material-ui/core"; 3 | import { setCellPadding, setEmptyRows } from "../v2/utilities"; 4 | 5 | export default function BaseTableBody({ 6 | getTableBodyProps, 7 | prepareRow, 8 | totalData, 9 | pageSize, 10 | pageIndex, 11 | visibleColumns, 12 | // getCellProps, 13 | isDense, 14 | page 15 | }) { 16 | return ( 17 | 18 | {page.map((row, i) => { 19 | prepareRow(row); 20 | return ( 21 | 22 | {row.cells.map((cell, index) => { 23 | return ( 24 | 30 | {cell.render("Cell")} 31 | 32 | ); 33 | })} 34 | 35 | ); 36 | })} 37 | {setEmptyRows({ totalData, pageSize, pageIndex, visibleColumns, isDense })} 38 | 39 | ); 40 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/table/v2/Alert.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Alert, AlertTitle } from '@material-ui/lab' 3 | 4 | export default function AlertCard({ error }) { 5 | return ( 6 | 7 | Error 8 | {error.message} 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /Dashboard/v3/Components/table/v2/EditableCell.js: -------------------------------------------------------------------------------- 1 | import { Input } from '@material-ui/core' 2 | 3 | export default function EditableCell({ 4 | cell: { value }, 5 | row: { index }, 6 | column: { id }, 7 | updateData, 8 | inputProps, 9 | }) { 10 | const onChange = (event) => { 11 | updateData(index, id, event.target.value) 12 | } 13 | 14 | return 15 | } -------------------------------------------------------------------------------- /Dashboard/v3/Components/utilities.jsx: -------------------------------------------------------------------------------- 1 | import {useEffect, useRef} from 'react'; 2 | 3 | export function useTraceUpdate(props) { 4 | const prev = useRef(props); 5 | useEffect(() => { 6 | const changedProps = Object.entries(props).reduce((ps, [k, v]) => { 7 | if (prev.current[k] !== v) { 8 | ps[k] = [prev.current[k], v]; 9 | } 10 | return ps; 11 | }, {}); 12 | if (Object.keys(changedProps).length > 0) { 13 | console.log('Changed props:', changedProps); 14 | } 15 | prev.current = props; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /Dashboard/v3/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ironman Software, LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/error.ps1: -------------------------------------------------------------------------------- 1 | function New-UDError { 2 | <# 3 | .SYNOPSIS 4 | Creates a new error card. 5 | 6 | .DESCRIPTION 7 | Creates a new error card. 8 | 9 | .PARAMETER Message 10 | The message to display. 11 | 12 | .PARAMETER Title 13 | A title for the card. 14 | 15 | .EXAMPLE 16 | Displays the error 'Invalid data' on the page. 17 | 18 | New-UDError -Message 'Invalid data' 19 | #> 20 | param( 21 | [Parameter(Mandatory)] 22 | [string]$Message, 23 | [Parameter()] 24 | [string]$Title 25 | ) 26 | 27 | @{ 28 | type = "error" 29 | isPlugin = $true 30 | assetId = $AssetId 31 | 32 | errorRecords = @(@{message= $Message}) 33 | title = $Title 34 | } 35 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/errorboundary.ps1: -------------------------------------------------------------------------------- 1 | function New-UDErrorBoundary { 2 | <# 3 | .SYNOPSIS 4 | Defines a new error boundary around a section of code. 5 | 6 | .DESCRIPTION 7 | Defines a new error boundary around a section of code. Error boundaries are used to trap errors and display them on the page. 8 | 9 | .PARAMETER Content 10 | The content to trap in an error boundary. 11 | 12 | .EXAMPLE 13 | Defines an error boundary that traps the exception that is thrown and displays it on the page. 14 | 15 | New-UDErrorBoundary -Content { 16 | throw 'This is an error' 17 | } 18 | #> 19 | param( 20 | [Parameter(Mandatory)] 21 | [ScriptBlock]$Content 22 | ) 23 | 24 | try 25 | { 26 | & $Content 27 | } 28 | catch 29 | { 30 | New-UDError -Message $_ 31 | } 32 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/event.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-UDEvent { 2 | param( 3 | [Parameter( 4 | Mandatory = $true, 5 | ValueFromPipeline = $true, 6 | Position = 0 7 | )] 8 | [String]$Id, 9 | [Parameter( 10 | Mandatory = $true, 11 | Position = 1, 12 | ParameterSetName = "onClick" 13 | )] 14 | [ValidateSet("onClick")] 15 | [string]$event 16 | ) 17 | 18 | Begin { 19 | 20 | } 21 | 22 | Process { 23 | if ($PSCmdlet.ParameterSetName -eq "onClick") { 24 | Invoke-UDJavaScript -javaScript " 25 | document.getElementById('$Id').click(); 26 | " 27 | } 28 | } 29 | 30 | End { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/hidden.ps1: -------------------------------------------------------------------------------- 1 | function New-UDHidden { 2 | param( 3 | [Parameter()] 4 | [string]$Id = [Guid]::NewGuid(), 5 | [Parameter(ParameterSetName = 'Down')] 6 | [ValidateSet('xs', 'sm', 'md', 'lg', 'xl')] 7 | [string]$Down, 8 | [Parameter(ParameterSetName = 'Up')] 9 | [ValidateSet('xs', 'sm', 'md', 'lg', 'xl')] 10 | [string]$Up, 11 | [Parameter(ParameterSetName = 'Only')] 12 | [ValidateSet('xs', 'sm', 'md', 'lg', 'xl')] 13 | [string[]]$Only, 14 | [Parameter()] 15 | [ScriptBlock]$Content 16 | ) 17 | 18 | $Component = @{ 19 | type = 'mu-hidden' 20 | id = $Id 21 | isPlugin = $true 22 | 23 | children = & $Content 24 | } 25 | 26 | if ($PSCmdlet.ParameterSetName -eq 'Only') 27 | { 28 | $Component['only'] = $Only 29 | } 30 | 31 | if ($PSCmdlet.ParameterSetName -eq 'Down') 32 | { 33 | $Component["$($Down.ToLower())Down"] = $true 34 | } 35 | 36 | if ($PSCmdlet.ParameterSetName -eq 'Up') 37 | { 38 | $Component["$($Up.ToLower())Up"] = $true 39 | } 40 | 41 | $Component 42 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/iframe.ps1: -------------------------------------------------------------------------------- 1 | function New-UDIFrame { 2 | <# 3 | .SYNOPSIS 4 | An HTML IFrame component. 5 | 6 | .DESCRIPTION 7 | An HTML IFrame component. 8 | 9 | .PARAMETER Id 10 | The ID of this component. 11 | 12 | .PARAMETER Uri 13 | The URI for the iframe. 14 | 15 | .EXAMPLE 16 | Defines an IFrame for Google. 17 | 18 | New-UDIFrame -Uri https://www.google.com 19 | #> 20 | param( 21 | [Parameter()] 22 | [String]$Id = ([Guid]::NewGuid()), 23 | [Parameter()] 24 | $Uri 25 | ) 26 | 27 | New-UDElement -Id $Id -Tag "iframe" -Attributes @{ 28 | src = $Uri 29 | } 30 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Add-Element.ps1: -------------------------------------------------------------------------------- 1 | function Add-UDElement { 2 | param( 3 | [Parameter(Mandatory)] 4 | [string]$ParentId, 5 | [Parameter(Mandatory)] 6 | [ScriptBlock]$Content, 7 | [Parameter()] 8 | [Switch]$Broadcast 9 | ) 10 | 11 | $NewContent = & $Content 12 | 13 | $Data = @{ 14 | componentId = $ParentId 15 | elements = $NewContent 16 | } 17 | 18 | if ($Broadcast) 19 | { 20 | $DashboardHub.SendWebSocketMessage("addElement", $Data) 21 | } 22 | else 23 | { 24 | $DashboardHub.SendWebSocketMessage($ConnectionId, "addElement", $Data) 25 | } 26 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Clear-Element.ps1: -------------------------------------------------------------------------------- 1 | function Clear-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Id, 6 | [Parameter()] 7 | [Switch]$Broadcast 8 | ) 9 | 10 | if ($Broadcast) 11 | { 12 | $DashboardHub.SendWebSocketMessage("clearElement", $Id) 13 | } 14 | else 15 | { 16 | $DashboardHub.SendWebSocketMessage($ConnectionId, "clearElement", $Id) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Get-Element.ps1: -------------------------------------------------------------------------------- 1 | function Get-UDElement 2 | { 3 | [CmdletBinding()] 4 | param( 5 | [Parameter(Mandatory)] 6 | [string]$Id 7 | ) 8 | 9 | $requestId = '' 10 | 11 | $requestId = [Guid]::NewGuid().ToString() 12 | 13 | $Data = @{ 14 | requestId = $requestId 15 | componentId = $Id 16 | } 17 | 18 | $DashboardHub.SendWebSocketMessage($ConnectionId, "requestState", $Data) 19 | $stateRequestService.Get($requestId) 20 | } 21 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Hide-Modal.ps1: -------------------------------------------------------------------------------- 1 | function Hide-UDModal 2 | { 3 | $DashboardHub.SendWebSocketMessage($ConnectionId, "closeModal", $null) 4 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Hide-Toast.ps1: -------------------------------------------------------------------------------- 1 | function Hide-UDToast 2 | { 3 | param( 4 | [Parameter(Mandatory, Position = 0)] 5 | [string]$Id 6 | ) 7 | 8 | $DashboardHub.SendWebSocketMessage($ConnectionId, "hideToast", $Id) 9 | } 10 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Invoke-JavaScript.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-UDJavaScript 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$JavaScript 6 | ) 7 | 8 | $DashboardHub.SendWebSocketMessage($ConnectionId, "invokejavascript", $JavaScript) 9 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Invoke-Redirect.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-UDRedirect 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Url, 6 | [Parameter()] 7 | [Switch]$OpenInNewWindow 8 | ) 9 | 10 | $Data = @{ 11 | url = $Url 12 | openInNewWindow = $OpenInNewWindow.IsPresent 13 | } 14 | 15 | $DashboardHub.SendWebSocketMessage($ConnectionId, "redirect", $Data) 16 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Remove-Element.ps1: -------------------------------------------------------------------------------- 1 | function Remove-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Id, 6 | [Parameter()] 7 | [string]$ParentId, 8 | [Parameter()] 9 | [Switch]$Broadcast 10 | ) 11 | 12 | $Data = @{ 13 | componentId = $Id 14 | parentId = $ParentId 15 | } 16 | 17 | if ($Broadcast) 18 | { 19 | $DashboardHub.SendWebSocketMessage("removeElement", $Data) 20 | } 21 | else 22 | { 23 | $DashboardHub.SendWebSocketMessage($ConnectionId, "removeElement", $Data) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Select-Element.ps1: -------------------------------------------------------------------------------- 1 | function Select-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory, ParameterSetName = "Normal")] 5 | [string]$Id, 6 | [Parameter(ParameterSetName = "Normal")] 7 | [Switch]$ScrollToElement 8 | ) 9 | 10 | $Data = @{ 11 | id = $Id 12 | scrollToElement = $ScrollToElement 13 | } 14 | 15 | $DashboardHub.SendWebSocketMessage($ConnectionId, "select", $Data) 16 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Set-Clipboard.ps1: -------------------------------------------------------------------------------- 1 | function Set-UDClipboard 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Data, 6 | [Parameter()] 7 | [Switch]$ToastOnSuccess, 8 | [Parameter()] 9 | [Switch]$ToastOnError 10 | ) 11 | 12 | $cpData = @{ 13 | data = $Data 14 | toastOnSuccess = $ToastOnSuccess.IsPresent 15 | toastOnError = $ToastOnError.IsPresent 16 | } 17 | 18 | $DashboardHub.SendWebSocketMessage($ConnectionId, "clipboard", $cpData) 19 | } 20 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Set-Element.ps1: -------------------------------------------------------------------------------- 1 | function Set-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory)] 5 | [string]$Id, 6 | [Alias("Attributes")] 7 | [Parameter()] 8 | [Hashtable]$Properties, 9 | [Parameter()] 10 | [Switch]$Broadcast, 11 | [Parameter()] 12 | [ScriptBlock]$Content 13 | ) 14 | 15 | if ($Content -and -not $Properties) 16 | { 17 | $Properties = @{} 18 | } 19 | 20 | if ($Content) 21 | { 22 | $Properties['content'] = [Array](& $Content) 23 | } 24 | 25 | $Data = @{ 26 | componentId = $Id 27 | state = $Properties 28 | } 29 | 30 | if ($Broadcast) 31 | { 32 | $DashboardHub.SendWebSocketMessage("setState", $data) 33 | } 34 | else 35 | { 36 | $DashboardHub.SendWebSocketMessage($ConnectionId, "setState", $Data) 37 | } 38 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Show-Modal.ps1: -------------------------------------------------------------------------------- 1 | function Show-UDModal 2 | { 3 | param( 4 | [Parameter()] 5 | [Switch]$FullScreen, 6 | [Parameter()] 7 | [ScriptBlock]$Footer, 8 | [Parameter()] 9 | [ScriptBlock]$Header, 10 | [Parameter()] 11 | [ScriptBlock]$Content, 12 | [Parameter()] 13 | [Switch]$Persistent, 14 | [Parameter()] 15 | [Switch]$FullWidth, 16 | [Parameter()] 17 | [ValidateSet("xs", "sm", "md", "lg", "xl")] 18 | [string]$MaxWidth 19 | ) 20 | 21 | $Modal = @{ 22 | dismissible = -not $Persistent.IsPresent 23 | maxWidth = $MaxWidth 24 | fullWidth = $FullWidth.IsPresent 25 | fullScreen = $FullScreen.IsPresent 26 | } 27 | 28 | if ($null -ne $Footer) 29 | { 30 | $Modal['footer'] = & $Footer 31 | } 32 | 33 | if ($null -ne $Header) 34 | { 35 | $Modal['header'] = & $Header 36 | } 37 | 38 | if ($null -ne $Content) 39 | { 40 | $Modal['content'] = & $Content 41 | } 42 | 43 | $DashboardHub.SendWebSocketMessage($ConnectionId, "showModal", $modal) 44 | } 45 | -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/interactive/Sync-Element.ps1: -------------------------------------------------------------------------------- 1 | function Sync-UDElement 2 | { 3 | param( 4 | [Parameter(Mandatory, ValueFromPipeline)] 5 | [string[]]$Id, 6 | [Parameter()] 7 | [Switch]$Broadcast 8 | ) 9 | 10 | Process 11 | { 12 | foreach($i in $Id) 13 | { 14 | if ($Broadcast) 15 | { 16 | $DashboardHub.SendWebSocketMessage("syncElement", $I) 17 | } 18 | else 19 | { 20 | $DashboardHub.SendWebSocketMessage($ConnectionId, "syncElement", $I) 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/paragraph.ps1: -------------------------------------------------------------------------------- 1 | function New-UDParagraph { 2 | <# 3 | .SYNOPSIS 4 | A paragraph. 5 | 6 | .DESCRIPTION 7 | A paragraph. Used to define a P HTML tag. 8 | 9 | .PARAMETER Content 10 | The content of the paragraph. 11 | 12 | .PARAMETER Text 13 | The text of the paragraph. 14 | 15 | .PARAMETER Color 16 | The font color of the paragraph. 17 | 18 | .EXAMPLE 19 | A simple paragraph. 20 | 21 | New-UDParagraph -Text 'Hello, world!' 22 | #> 23 | param( 24 | [Parameter(ParameterSetName = 'content')] 25 | [ScriptBlock]$Content, 26 | [Parameter(ParameterSetName = 'text')] 27 | [string]$Text, 28 | [Parameter()] 29 | [UniversalDashboard.Models.DashboardColor]$Color = 'black' 30 | ) 31 | 32 | if ($PSCmdlet.ParameterSetName -eq 'content') { 33 | New-UDElement -Tag 'p' -Content $Content -Attributes @{ 34 | style = @{ 35 | color = $Color.HtmlColor 36 | } 37 | } 38 | } 39 | else { 40 | New-UDElement -Tag 'p' -Content { 41 | $Text 42 | } -Attributes @{ 43 | style = @{ 44 | color = $Color.HtmlColor 45 | } 46 | } 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/span.ps1: -------------------------------------------------------------------------------- 1 | function New-UDSpan { 2 | <# 3 | .SYNOPSIS 4 | A span component. 5 | 6 | .DESCRIPTION 7 | A span component. Defines a span HTML tag. 8 | 9 | .PARAMETER Id 10 | The ID of this component. 11 | 12 | .PARAMETER Content 13 | The content of the span. 14 | 15 | .EXAMPLE 16 | An example 17 | 18 | New-UDSpan -Content { 19 | New-UDTypography -Text 'Text' 20 | } 21 | #> 22 | param( 23 | [Parameter()] 24 | [String]$Id = ([Guid]::NewGuid()), 25 | [Parameter()] 26 | $Content 27 | ) 28 | 29 | New-UDElement -Id $Id -Tag "span" -Content { 30 | $Content 31 | } 32 | } -------------------------------------------------------------------------------- /Dashboard/v3/Scripts/splitpane.ps1: -------------------------------------------------------------------------------- 1 | function New-UDSplitPane { 2 | param( 3 | [Parameter()] 4 | [string]$Id = ([Guid]::NewGuid()).ToString(), 5 | [Parameter(Mandatory)] 6 | [ScriptBlock]$Content, 7 | [Parameter()] 8 | [ValidateSet("vertical", "horizontal")] 9 | [string]$Direction = "vertical", 10 | [Parameter()] 11 | [int]$MinimumSize, 12 | [Parameter()] 13 | [int]$DefaultSize 14 | ) 15 | 16 | try { 17 | $Children = & $Content 18 | } 19 | catch { 20 | $Children = New-UDError -Message $_ 21 | } 22 | 23 | if ($Children.Length -ne 2) { 24 | Write-Error "Split pane requires exactly two components in Content" 25 | return 26 | } 27 | 28 | $Options = @{ 29 | content = $Children 30 | id = $Id 31 | split = $Direction.ToLower() 32 | type = "ud-splitpane" 33 | } 34 | 35 | if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("MinimumSize")) { 36 | $Options["minSize"] = $MinimumSize 37 | } 38 | 39 | if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("DefaultSize")) { 40 | $Options["defaultSize"] = $DefaultSize 41 | } 42 | 43 | $Options 44 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/README.md: -------------------------------------------------------------------------------- 1 | # Build for Tests 2 | 3 | Build the UnviersalDashboard Core in release more. 4 | 5 | ``` 6 | .\src\build.ps1 -Configuration Release -NoHelp 7 | ``` 8 | 9 | Build the Material-UD module 10 | 11 | ``` 12 | .\src\UniversalDashboard.MaterialUI\build.ps1 13 | ``` 14 | 15 | # Running Tests 16 | 17 | To run tests, execute the driver.ps1 file. We could update this file to execute only the file you want to run. Use -NoClose to 18 | avoid closing the browser\dashboard after running. 19 | 20 | ``` 21 | .\src\UniversalDashboard.MaterialUI\Tests\driver.ps1 22 | ``` -------------------------------------------------------------------------------- /Dashboard/v3/Tests/appbar.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/AppBar" 2 | 3 | Describe 'AppBar' { 4 | It 'has custom navigation' { 5 | Find-SeElement -Id 'btndrawer' -Driver $Driver | Invoke-SeClick 6 | Find-SeElement -Id 'lstHome' -Driver $Driver | Invoke-SeClick 7 | Get-TestData | should be "Home" 8 | } 9 | 10 | It 'has nested navigation' { 11 | Find-SeElement -TagName 'body' -Driver $Driver | Invoke-SeClick 12 | Find-SeElement -Id 'btndrawer' -Driver $Driver | Invoke-SeClick 13 | Find-SeElement -Id 'lstHome' -Driver $Driver | Invoke-SeClick 14 | Get-TestData | should be "Home" 15 | Find-SeElement -id 'lstNested' -Driver $Driver | Invoke-SeClick 16 | Get-TestData | should be "Nested" 17 | } 18 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/autocomplete.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/Autocomplete" 2 | 3 | Describe 'AutoComplete' { 4 | It 'has static autocomplete options' { 5 | Find-SeElement -Id 'autoComplete' -Driver $Driver | Send-SeKeys -Keys '2' 6 | $Element = Find-SeElement -ClassName 'MuiAutocomplete-popper' -Driver $Driver 7 | $Element.FindElementByTagName('li') | Invoke-SeClick 8 | Get-TestData | Should be "Test2" 9 | } 10 | 11 | It 'has dynamic autocomplete options' { 12 | Find-SeElement -Id 'autoCompleteDynamic' -Driver $Driver | Send-SeKeys -Keys '3' 13 | $Element = Find-SeElement -ClassName 'MuiAutocomplete-popper' -Driver $Driver 14 | $Element.FindElementByTagName('li') | Invoke-SeClick 15 | Get-TestData | Should be "Test3" 16 | } 17 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/avatar.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/Avatar" 2 | 3 | Describe 'avatar' { 4 | It 'has content' { 5 | $element = Find-SeElement -Id 'avatarContent' -Driver $Driver 6 | $element.Text | should not be $null 7 | } 8 | 9 | It 'has width of 80' { 10 | $element = Find-SeElement -Id 'avatarStyle' -Driver $Driver 11 | $element.GetCssValue('width') | should be '40px' 12 | } 13 | It 'has height of 80' { 14 | $element = Find-SeElement -Id 'avatarStyle' -Driver $Driver 15 | $element.GetCssValue('height') | should be '40px' 16 | } 17 | 18 | It 'has large variant' { 19 | $element = Find-SeElement -Id 'avatarSquare' -Driver $Driver 20 | $element.GetCssValue('height') | should be '40px' 21 | } 22 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/chips.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/chips" 2 | 3 | Describe "chips" { 4 | It 'has a label' { 5 | (Find-SeElement -Id 'chipLabel' -Driver $Driver).Text | should be "my Label" 6 | } 7 | 8 | It 'has an icon' { 9 | $Element = Find-SeElement -Id 'chipIcon' -Driver $Driver 10 | $Element.FindElementByTagName("svg").GetAttribute("data-icon") | Should be "user" 11 | } 12 | 13 | It "should click and have test data" { 14 | Find-SeElement -Id 'chipClick' -Driver $Driver | Invoke-SeClick 15 | Get-TestData | Should be "chipClick" 16 | } 17 | 18 | It "should click delete and have test data" { 19 | $Element = Find-SeElement -Id 'chipDelete' -Driver $Driver 20 | $Element.FindElementByClassName("MuiChip-deleteIcon") | Invoke-SeClick 21 | Get-TestData | Should be "chipDelete" 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/clipboard.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/clipboard" 2 | 3 | Describe "clipboard" { 4 | It 'should set item in clipboard' { 5 | Find-SeElement -Id 'btnClip' -Driver $Driver | Invoke-SeClick 6 | Find-SeElement -Id 'btnClip2' -Driver $Driver | Invoke-SeClick 7 | Get-Clipboard | Should be "hello world!" 8 | } 9 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/expansion-panel.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/expansion-panel" 2 | 3 | Describe "expansion panel" { 4 | It 'has a label' { 5 | $Element = Find-SeElement -Id 'expTitle' -Driver $Driver | Select-Object -First 1 6 | $Element.FindElementByClassName('MuiTypography-root').Text | Should be "Hello" 7 | } 8 | 9 | It 'has a content' { 10 | Find-SeElement -Id 'expContent' -Driver $Driver | Select-Object -First 1 | Invoke-SeClick 11 | (Find-SeElement -Id 'expContentDiv' -Driver $Driver).Text | Should be "Hello" 12 | } 13 | 14 | It 'works with one expansion panel' { 15 | Find-SeElement -Id 'expContent2' -Driver $Driver | Select-Object -First 1 | Invoke-SeClick 16 | (Find-SeElement -Id 'expContentDiv2' -Driver $Driver).Text | Should be "Hello" 17 | } 18 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/floating-action-button.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/floating-action-button" 2 | 3 | Describe "floating action button" { 4 | It 'has a icon' { 5 | $Element = Find-SeElement -Id 'fabIcon' -Driver $Driver 6 | $Element.FindElementByTagName('svg').GetAttribute('data-icon') | Should be "user" 7 | } 8 | 9 | It 'clicks' { 10 | Find-SeElement -Id 'fabClick' -Driver $Driver | Invoke-SeClick 11 | Get-TestData | Should be "fabClick" 12 | } 13 | 14 | It 'has small size' { 15 | $Element = Find-SeElement -Id 'fabSmall' -Driver $Driver 16 | $Element.GetAttribute("class").Contains('MuiFab-sizeSmall') | should be $true 17 | } 18 | 19 | It 'has medium size' { 20 | $Element = Find-SeElement -Id 'fabMedium' -Driver $Driver 21 | $Element.GetAttribute("class").Contains('MuiFab-sizeMedium') | should be $true 22 | } 23 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/link.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/link" 2 | 3 | Describe "link" { 4 | It 'has content' { 5 | $element = Find-SeElement -Id 'card-link' -Driver $Driver 6 | $element.Text | should not be $null 7 | } 8 | It 'has text' { 9 | $element = Find-SeElement -Id 'demo-link' -Driver $Driver 10 | $element.Text | should be 'demo' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Dashboard/v3/Tests/list.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/list" 2 | 3 | Describe "list" { 4 | It 'has content' { 5 | Find-SeElement -Id 'listContent' -Driver $Driver | should not be $null 6 | } 7 | 8 | It 'has 5 list items' { 9 | (Find-SeElement -Id 'listContentItem' -Driver $Driver).count | should be 5 10 | } 11 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/page.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/NotFound" 2 | 3 | Describe "page" { 4 | It 'has not found' { 5 | Find-SeElement -Id 'not-found' -Driver $Driver | should not be $null 6 | } 7 | 8 | It 'has named page' { 9 | Enter-SeUrl -Target $Driver -Url "$Address/Test/Named-Page" 10 | Find-SeElement -Id 'namedPage' -Driver $Driver | should not be $null 11 | } 12 | 13 | It 'has URL page' { 14 | Enter-SeUrl -Target $Driver -Url "$Address/Test/myurl" 15 | Find-SeElement -Id 'urlPage' -Driver $Driver | should not be $null 16 | } 17 | 18 | It 'has URL page with variable' { 19 | Enter-SeUrl -Target $Driver -Url "$Address/Test/myurl/123" 20 | (Find-SeElement -Id 'urlPageWithVariable' -Driver $Driver).Text | should be "123" 21 | } 22 | 23 | It 'has custom loading dialog' { 24 | Enter-SeUrl -Target $Driver -Url "$Address/Test/loading" 25 | (Find-SeElement -Id 'loading' -Driver $Driver).Text | should be "Loading..." 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Dashboard/v3/Tests/paper.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/paper" 2 | 3 | Describe "paper" { 4 | 5 | It 'has content' { 6 | Find-SeElement -Id 'hi' -Driver $Driver | should not be $null 7 | } 8 | 9 | It 'has background color of #90caf9 (rgb(144, 202, 249))' { 10 | $element = Find-SeElement -Id 'paperStyle' -Driver $Driver 11 | $style = Get-SeElementAttribute -Element $element -Attribute 'style' 12 | $style.Split(':')[1].trim().replace(';','') | should be 'rgb(144, 202, 249)' 13 | } 14 | 15 | It 'has elevation of 4' { 16 | $element = Find-SeElement -Id 'paperElevation' -Driver $Driver 17 | (Get-SeElementAttribute -Element $element -Attribute 'class') -match '.MuiPaper-elevation4' | should be $true 18 | } 19 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/progress.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/progress" 2 | 3 | Describe "progress" { 4 | 5 | It 'is circular indeterminate' { 6 | (Find-SeElement -Id 'progressCircularIndeterminate' -Driver $Driver).GetAttribute("class").Contains("MuiCircularProgress-indeterminate") | should be $true 7 | } 8 | 9 | It 'is linear indeterminate' { 10 | (Find-SeElement -Id 'progressLinearIndeterminate' -Driver $Driver).GetAttribute("class").Contains("MuiLinearProgress-indeterminate") | should be $true 11 | } 12 | 13 | It 'is linear determinate' { 14 | (Find-SeElement -Id 'progressLinearDeterminate' -Driver $Driver).GetAttribute("class").Contains("MuiLinearProgress-determinate") | should be $true 15 | (Find-SeElement -Id 'progressLinearDeterminate' -Driver $Driver).GetAttribute("aria-valuenow") | should be "75" 16 | } 17 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/radio.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/radio" 2 | 3 | Describe "radio" { 4 | It 'should have all options' { 5 | Find-SeElement -Target $Driver -Id 'adam' | should not be $Null 6 | Find-SeElement -Target $Driver -Id 'alon' | should not be $Null 7 | Find-SeElement -Target $Driver -Id 'lee' | should not be $Null 8 | } 9 | 10 | It 'should fire onChange event' { 11 | Find-SeElement -Target $Driver -Id 'alonOnChange' | Invoke-SeClick 12 | Get-TestData | should be 'alon' 13 | } 14 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/stepper.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/stepper" 2 | 3 | Describe "Stepper" { 4 | It 'should set data throughout the stepper' { 5 | Find-SeElement -Id 'txtStep1' -Driver $Driver | Send-SeKeys -Keys "Step1Data" 6 | Find-SeElement -Id 'stepperbtnNext' -Driver $Driver | Invoke-SeClick 7 | $Data = Get-TestData 8 | $Data.context.txtStep1 | Should be "Step1Data" 9 | 10 | Find-SeElement -Id 'txtStep2' -Driver $Driver | Send-SeKeys -Keys "Step2Data" 11 | Find-SeElement -Id 'stepperbtnNext' -Driver $Driver | Invoke-SeClick 12 | $Data = Get-TestData 13 | $Data.context.txtStep1 | Should be "Step1Data" 14 | $Data.context.txtStep2 | Should be "Step2Data" 15 | 16 | Find-SeElement -Id 'txtStep3' -Driver $Driver | Send-SeKeys -Keys "Step3Data" 17 | Find-SeElement -Id 'stepperbtnNext' -Driver $Driver | Invoke-SeClick 18 | $Data = Get-TestData 19 | 20 | $Data.context.txtStep1 | Should be "Step1Data" 21 | $Data.context.txtStep2 | Should be "Step2Data" 22 | $Data.context.txtStep3 | Should be "Step3Data" 23 | } 24 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/switch.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/switch" 2 | 3 | Describe "Switch" { 4 | It 'is not checked' { 5 | (Find-SeElement -Id 'switchOff' -Driver $Driver).GetAttribute("value") | should be "" 6 | } 7 | 8 | It 'is not checked explicit' { 9 | (Find-SeElement -Id 'switchOffExplicit' -Driver $Driver).GetAttribute("value") | should be "" 10 | } 11 | 12 | It 'is checked' { 13 | (Find-SeElement -Id 'switchOn' -Driver $Driver).GetAttribute("checked") | should be $true 14 | } 15 | 16 | It 'should send test data' { 17 | Find-SeElement -Id 'switchOnChange' -Driver $Driver | Invoke-SeClick 18 | Get-TestData | should be $true 19 | } 20 | 21 | It 'should be disabled' { 22 | (Find-SeElement -Id 'switchDisabled' -Driver $Driver).GetAttribute("disabled") | should be $true 23 | } 24 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/textbox.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/textbox" 2 | 3 | Describe "Textbox" { 4 | It 'has label' { 5 | $Element = Find-SeElement -Id 'txtLabel' -Driver $Driver 6 | $Element.FindElementByXPath('../..').FindElementByTagName('label').Text | should be 'text' 7 | } 8 | 9 | It 'has value' { 10 | (Find-SeElement -Id 'txtValue' -Driver $Driver).GetAttribute('value') | should be 'value' 11 | } 12 | 13 | It 'has placeholder' { 14 | $Element = Find-SeElement -Id 'txtPlaceholder' -Driver $Driver 15 | $Element.FindElementByXPath('../..').FindElementByTagName('p').Text | should be 'placeholder' 16 | } 17 | 18 | It 'is password' { 19 | (Find-SeElement -Id 'txtPassword' -Driver $Driver).GetAttribute('type') | should be "password" 20 | } 21 | 22 | It 'is email' { 23 | (Find-SeElement -Id 'txtEmail' -Driver $Driver).GetAttribute('type') | should be "email" 24 | } 25 | 26 | It 'is disabled' { 27 | (Find-SeElement -Id 'txtDisabled' -Driver $Driver).GetAttribute('disabled') | should be $true 28 | } 29 | } -------------------------------------------------------------------------------- /Dashboard/v3/Tests/treeview.tests.ps1: -------------------------------------------------------------------------------- 1 | Enter-SeUrl -Target $Driver -Url "$Address/Test/treeview" 2 | 3 | Describe "Textbox" { 4 | It 'has nodes' { 5 | Find-SeElement -Id 'Root' -Driver $Driver | Invoke-SeClick 6 | Find-SeElement -Id 'Level1' -Driver $Driver | Invoke-SeClick 7 | Find-SeElement -Id 'Level2' -Driver $Driver | should not be $null 8 | } 9 | } -------------------------------------------------------------------------------- /Dashboard/v3/UniversalDashboard.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/v3/UniversalDashboard.psd1 -------------------------------------------------------------------------------- /Dashboard/v3/app/app-context.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const theme = sessionStorage.getItem('theme') 4 | 5 | export const DefaultAppContext = { 6 | theme: theme ? theme : 'light', 7 | setTheme: () => {} 8 | } 9 | 10 | export const AppContext = React.createContext(DefaultAppContext); -------------------------------------------------------------------------------- /Dashboard/v3/app/basics/datetime.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import moment from 'moment'; 3 | 4 | export default class DateTime extends React.Component { 5 | render() { 6 | var y = this.props.value; 7 | 8 | var moment2 = moment(y); 9 | if (moment2.isValid) { 10 | return {moment2.format(this.props.dateTimeFormat)}; 11 | } 12 | 13 | return {y}; 14 | } 15 | } -------------------------------------------------------------------------------- /Dashboard/v3/app/component-registration.js: -------------------------------------------------------------------------------- 1 | import UDSplitPane from './ud-splitpane'; 2 | import UDTooltip from './ud-tooltip'; 3 | require ('./../Components/index.js'); 4 | 5 | UniversalDashboard.register("ud-splitpane", UDSplitPane); 6 | UniversalDashboard.register("ud-tooltip", UDTooltip); 7 | -------------------------------------------------------------------------------- /Dashboard/v3/app/config.jsx: -------------------------------------------------------------------------------- 1 | export function getApiPath() { 2 | return ""; 3 | } 4 | 5 | export function getWsApiPath() { 6 | var protocol = "ws://"; 7 | if (window.location.protocol.toLowerCase().startsWith("https")) { 8 | protocol = "wss://"; 9 | } 10 | 11 | return protocol + window.location.hostname + (window.location.port ? ':' + window.location.port : ''); 12 | } 13 | 14 | function getMeta(metaName) { 15 | const metas = document.getElementsByTagName('meta'); 16 | 17 | for (let i = 0; i < metas.length; i++) { 18 | if (metas[i].getAttribute('name') === metaName) { 19 | return metas[i].getAttribute('content'); 20 | } 21 | } 22 | 23 | return ''; 24 | } 25 | 26 | export function getDashboardId() { 27 | var dashboardId = localStorage.getItem("ud-dashboard"); 28 | if (!dashboardId || dashboardId === '') 29 | { 30 | dashboardId = getMeta('ud-dashboard'); 31 | } 32 | 33 | return dashboardId; 34 | } -------------------------------------------------------------------------------- /Dashboard/v3/app/index.jsx: -------------------------------------------------------------------------------- 1 | import './public-path'; 2 | import '@babel/polyfill'; 3 | import React from 'react'; 4 | import {render} from 'react-dom'; 5 | import $ from "jquery"; 6 | import 'whatwg-fetch'; 7 | import Promise from 'promise-polyfill'; 8 | import { UniversalDashboardService } from './services/universal-dashboard-service.jsx'; 9 | import App from './App'; 10 | 11 | window.react = require('react'); 12 | window['reactdom'] = require('react-dom'); 13 | window['reactrouterdom'] = require('react-router-dom'); 14 | 15 | // To add to window 16 | if (!window.Promise) { 17 | window.Promise = Promise; 18 | } 19 | 20 | window.UniversalDashboard = UniversalDashboardService; 21 | require('./component-registration'); 22 | 23 | render(, document.getElementById('app')); -------------------------------------------------------------------------------- /Dashboard/v3/app/log-service.jsx: -------------------------------------------------------------------------------- 1 | import {fetchPost} from './services/fetch-service.jsx'; 2 | 3 | function Log(component, level, message) { 4 | fetchPost(`/log/${component}/${level}`, {message: message}) 5 | } 6 | 7 | export function LogDebug(component, message) { 8 | Log(component, "debug", message); 9 | } 10 | 11 | export function LogError(component, message) { 12 | Log(component, "error", message); 13 | } 14 | 15 | export function LogInfo(component, message) { 16 | Log(component, "info", message); 17 | } -------------------------------------------------------------------------------- /Dashboard/v3/app/public-path.js: -------------------------------------------------------------------------------- 1 | if (document.getElementsByTagName('base')[0].href.indexOf("_BASEHREF_") == -1) 2 | { 3 | __webpack_public_path__ = document.getElementsByTagName('base')[0].href; 4 | window.baseUrl = document.getElementsByTagName('base')[0].href.replace(window.location.origin, "").replace(/\/$/, "");; 5 | } 6 | else 7 | { 8 | __webpack_public_path__ = "/" 9 | window.baseUrl = "" 10 | } -------------------------------------------------------------------------------- /Dashboard/v3/app/services/toaster.jsx: -------------------------------------------------------------------------------- 1 | import iziToast from 'izitoast/dist/js/iziToast.min.js' 2 | require('izitoast/dist/css/iziToast.min.css') 3 | require('@fortawesome/fontawesome-free/css/all.min.css') 4 | 5 | const toaster = { 6 | show: (model) => { 7 | 8 | 9 | iziToast.show(model); 10 | }, 11 | hide: (id) => { 12 | var toast = document.querySelector('#' + id); 13 | iziToast.hide({}, toast); 14 | }, 15 | info: (model) => { 16 | iziToast.info(model); 17 | }, 18 | success: (model) => { 19 | iziToast.success(model); 20 | }, 21 | warning: (model) => { 22 | iziToast.warning(model); 23 | }, 24 | error: (model) => { 25 | iziToast.error(model); 26 | } 27 | } 28 | 29 | export default toaster; -------------------------------------------------------------------------------- /Dashboard/v3/app/ud-html.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class UdHtml extends React.Component { 4 | render() { 5 | return
6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v3/example.ps1: -------------------------------------------------------------------------------- 1 | New-UDDashboard -Title "Hello, World!" -Content { 2 | New-UDTypography -Text "Hello, World!" 3 | 4 | New-UDButton -Text "Learn more about Universal Dashboard" -OnClick { 5 | Invoke-UDRedirect https://docs.ironmansoftware.com 6 | } 7 | } -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/charts/nivo-bar.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Nivo Bar' -Description 'Creates a bar chart based on the Nivo library' -Content { 2 | New-Example -Title 'Bar' -Description '' -Example { 3 | $Data = 1..10 | ForEach-Object { 4 | $item = Get-Random -Max 1000 5 | [PSCustomObject]@{ 6 | Name = "Test$item" 7 | Value = $item 8 | } 9 | } 10 | New-UDNivoChart -Bar -Keys "Value" -IndexBy 'name' -Data $Data -Height 500 -Width 1000 11 | } 12 | } -Cmdlet @("New-UDNivoChart") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/charts/nivo-calendar.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Nivo Calendar' -Description 'Creates a calendar display' -Content { 2 | New-Example -Title 'Calendar' -Description '' -Example { 3 | $Data = @() 4 | for($i = 365; $i -gt 0; $i--) { 5 | $Data += @{ 6 | day = (Get-Date).AddDays($i * -1).ToString("yyyy-MM-dd") 7 | value = Get-Random 8 | } 9 | } 10 | 11 | $From = (Get-Date).AddDays(-365) 12 | $To = Get-Date 13 | 14 | New-UDNivoChart -Calendar -Data $Data -From $From -To $To -Height 500 -Width 1000 -MarginTop 50 -MarginRight 130 -MarginBottom 50 -MarginLeft 60 15 | } 16 | } -Cmdlet @("New-UDNivoChart") 17 | 18 | -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/charts/nivo-line.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Nivo Line' -Description 'Creates a line chart' -Content { 2 | New-Example -Title 'Line' -Description '' -Example { 3 | $Data = 1..10 | ForEach-Object { 4 | @{ 5 | id = "Line$_" 6 | data = @( 7 | $item = Get-Random -Max 1000 8 | [PSCustomObject]@{ 9 | x = "Test$item" 10 | y = $item 11 | } 12 | ) 13 | } 14 | } 15 | 16 | New-UDNivoChart -Line -Data $Data -Height 500 -Width 1000 -UseMesh -LineWidth 1 17 | } 18 | } -Cmdlet @("New-UDNivoChart") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/charts/nivo-stream.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Nivo Stream' -Description 'Creates a stream chart' -Content { 2 | New-Example -Title 'Stream' -Description '' -Example { 3 | $Data = 1..10 | ForEach-Object { 4 | @{ 5 | "Adam" = Get-Random 6 | "Alon" = Get-Random 7 | "Lee" = Get-Random 8 | "Frank" = Get-Random 9 | "Bill" = Get-Random 10 | } 11 | } 12 | 13 | New-UDNivoChart -Stream -Data $Data -Height 500 -Width 1000 -Keys @("Adam", "Alon", "Lee", "Frank", "Bill") 14 | } 15 | } -Cmdlet @("New-UDNivoChart") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/charts/nivo-treemap.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Nivo Treemap' -Description 'Creates a treemap chart' -Content { 2 | New-Example -Title 'Treemap' -Description '' -Example { 3 | $TreeData = @{ 4 | Name = "root" 5 | children = @( 6 | @{ 7 | Name = "first" 8 | children = @( 9 | @{ 10 | Name = "first-first" 11 | Count = 7 12 | } 13 | @{ 14 | Name = "first-second" 15 | Count = 8 16 | } 17 | ) 18 | }, 19 | @{ 20 | Name = "second" 21 | Count = 21 22 | } 23 | ) 24 | } 25 | 26 | New-UDNivoChart -Treemap -Data $TreeData -Value "Count" -Identity "Name" -Height 500 -Width 800 27 | } 28 | } -Cmdlet @("New-UDNivoChart") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/charts/sparklines.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Sparklines' ` 2 | -Description 'Sparklines are tiny, little charts.' ` 3 | -SecondDescription "Sparklines are great for putting in other controls like AppBars or tables. " -Content { 4 | 5 | New-Example -Title 'Sparklines' -Example { 6 | $Data = 1..10 | ForEach-Object { Get-Random -Max 1000 } 7 | New-UDSparklines -Data $Data -Max 1000 -Height 100 -Width 500 8 | New-UDSparklines -Data $Data -Type 'bars' -Max 1000 -Height 100 -Width 500 9 | New-UDSparklines -Data $Data -Type 'both' -Max 1000 -Height 100 -Width 500 10 | } 11 | } -Cmdlet 'New-UDSparklines' -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/data-display/avatar.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Avatar' ` 2 | -Description 'Avatars are found throughout material design with uses in everything from tables to dialog menus.' ` 3 | -SecondDescription "" -Content { 4 | 5 | New-Example -Title 'Avatar' -Example { 6 | New-UDAvatar -Image 'https://avatars2.githubusercontent.com/u/34351424?s=460&v=4' -Alt 'alon gvili avatar' -Id 'avatarContent' -Variant small 7 | 8 | New-UDAvatar -Image 'https://avatars2.githubusercontent.com/u/34351424?s=460&v=4' -Alt 'alon gvili avatar' -Id 'avatarStyle' -Variant medium 9 | 10 | $AvatarProps = @{ 11 | Image = 'https://avatars2.githubusercontent.com/u/34351424?s=460&v=4' 12 | Alt = 'alon gvili avatar' 13 | Id = 'avatarSquare' 14 | variant = 'large' 15 | } 16 | New-UDAvatar @AvatarProps 17 | } 18 | } -Cmdlet 'New-UDAvatar' -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/data-display/chip.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Chips' -Description 'Chips are compact elements that represent an input, attribute, or action.' -SecondDescription "Chips allow users to enter information, make selections, filter content, or trigger actions. 2 | 3 | While included here as a standalone component, the most common use will be in some form of input, so some of the behaviour demonstrated here is not shown in context." -Content { 4 | New-Example -Title 'Basic Chips' -Description '' -Example { 5 | New-UDChip -Label 'Basic' 6 | } 7 | 8 | New-Example -Title 'With Icon' -Description '' -Example { 9 | New-UDChip -Label 'Basic' -Icon (New-UDIcon -Icon 'user') 10 | } 11 | 12 | New-Example -Title 'OnClick' -Description '' -Example { 13 | New-UDChip -Label 'OnClick' -OnClick { 14 | Show-UDToast -Message 'Hello!' 15 | } 16 | } 17 | 18 | New-Example -Title 'OnDelete' -Description '' -Example { 19 | New-UDChip -Label 'OnDelete' -OnClick { 20 | Show-UDToast -Message 'Goodbye!' 21 | } 22 | } 23 | } -Cmdlet "New-UDChip" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/data-display/icon.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Icons' -Description 'FontAwesome icons to include in your dashboard.' -SecondDescription "" -Content { 2 | 3 | New-UDTextbox -Id 'txtIconSearch' -Label 'Search' 4 | New-UDButton -Text 'Search' -OnClick { 5 | Sync-UDElement -Id 'icons' 6 | } 7 | 8 | New-UDElement -tag 'p' -Content {} 9 | 10 | New-UDDynamic -Id 'icons' -Content { 11 | $Icons = [Enum]::GetNames([UniversalDashboard.Models.FontAwesomeIcons]) 12 | $IconSearch = (Get-UDElement -Id 'txtIconSearch').value 13 | if ($null -ne $IconSearch -and $IconSearch -ne '') 14 | { 15 | $Icons = $Icons.where({ $_ -match $IconSearch}) 16 | } 17 | 18 | foreach($icon in $icons) { 19 | New-UDIcon -Icon $icon -Size lg 20 | } 21 | } 22 | } -Cmdlet "New-UDIcon" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/data-display/list.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'List' -Description 'Lists are continuous, vertical indexes of text or images.' -SecondDescription "Lists are a continuous group of text or images. They are composed of items containing primary and supplemental actions, which are represented by icons and text." -Content { 2 | New-Example -Title 'List' -Description '' -Example { 3 | New-UDList -Content { 4 | New-UDListItem -Label 'Inbox' -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle 'New Stuff' 5 | New-UDListItem -Label 'Drafts' -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I'm working on " 6 | New-UDListItem -Label 'Trash' -Icon (New-UDIcon -Icon trash -Size 3x) -SubTitle 'Stuff I deleted' 7 | New-UDListItem -Label 'Spam' -Icon (New-UDIcon -Icon bug -Size 3x) -SubTitle "Stuff I didn't want" 8 | } 9 | } 10 | } -Cmdlet @("New-UDList", "New-UDListItem") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/data-display/tree-view.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Tree View' -Description 'A tree view widget presents a hierarchical list.' -SecondDescription "Tree views can be used to represent a file system navigator displaying folders and files, an item representing a folder can be expanded to reveal the contents of the folder, which may be files, folders, or both." -Content { 2 | New-Example -Title 'Tree view' -Description '' -Example { 3 | New-UDTreeView -Node { 4 | New-UDTreeNode -Id 'Root' -Name 'Root' -Children { 5 | New-UDTreeNode -Id 'Level1' -Name 'Level 1' -Children { 6 | New-UDTreeNode -Id 'Level2' -Name 'Level 2' 7 | } 8 | New-UDTreeNode -Name 'Level 1' -Children { 9 | New-UDTreeNode -Name 'Level 2' 10 | } 11 | New-UDTreeNode -Name 'Level 1' -Children { 12 | New-UDTreeNode -Name 'Level 2' 13 | } 14 | } 15 | New-UDTreeNode -Id 'Root2' -Name 'Root 2' 16 | } 17 | } 18 | } -Cmdlet @("New-UDTreeView", "New-UDTreeNode") 19 | -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/data-display/typography.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Typography' -Description 'Use typography to present your design and content as clearly and efficiently as possible.' -SecondDescription "Too many type sizes and styles at once can spoil any layout. A typographic scale has a limited set of type sizes that work well together along with the layout grid." -Content { 2 | New-Example -Title 'Variants' -Description '' -Example { 3 | @("h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", 4 | "caption", "button", "overline", "srOnly", "inherit", 5 | "display4", "display3", "display2", "display1", "headline", "title", "subheading") | ForEach-Object { 6 | New-UDTypography -Variant $_ -Text $_ -GutterBottom 7 | New-UDElement -Tag 'p' -Content {} 8 | } 9 | } 10 | } -Cmdlet @("New-UDTypography") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/feedback/progress.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Progress' -Description 'Progress indicators commonly known as spinners, express an unspecified wait time or display the length of a process.' -SecondDescription "Progress indicators inform users about the status of ongoing processes, such as loading an app, submitting a form, or saving updates. They communicate an app’s state and indicate available actions, such as whether users can navigate away from the current screen. 2 | 3 | Determinate indicators display how long an operation will take. 4 | 5 | Indeterminate indicators visualize an unspecified wait time." -Content { 6 | New-Example -Title 'Circular Progress' -Description '' -Example { 7 | New-UDProgress -Circular -Color Red 8 | New-UDProgress -Circular -Color Green 9 | New-UDProgress -Circular -Color Blue 10 | New-UDProgress -Circular -Size Small 11 | New-UDProgress -Circular -Size Medium 12 | New-UDProgress -Circular -Size Large 13 | } 14 | 15 | New-Example -Title 'Linear Indeterminate' -Description '' -Example { 16 | New-UDProgress 17 | } 18 | 19 | New-Example -Title 'Linear Determinate' -Description '' -Example { 20 | New-UDProgress -PercentComplete 75 21 | } 22 | 23 | } -Cmdlet "New-UDProgress" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/inputs/autocomplete.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Autocomplete' ` 2 | -Description 'The autocomplete is a normal text input enhanced by a panel of suggested options.' ` 3 | -SecondDescription "This is a useful control for allowing the user to select from a large set of options." -Content { 4 | 5 | New-Example -Title 'Autocomplete with a static list of options' -Example { 6 | New-UDAutocomplete -Options @('Test', 'Test2', 'Test3', 'Test4') 7 | } 8 | 9 | New-Example -Title 'Autocomplete with a dynamic list of options' -Example { 10 | New-UDAutocomplete -OnLoadOptions { 11 | @('Test', 'Test2', 'Test3', 'Test4') | Where-Object { $_ -match $Body } | ConvertTo-Json 12 | } 13 | } 14 | 15 | New-Example -Title 'Autocomplete with an OnChange script block' -Example { 16 | New-UDAutocomplete -OnLoadOptions { 17 | @('Test', 'Test2', 'Test3', 'Test4') | Where-Object { $_ -match $Body } | ConvertTo-Json 18 | } -OnChange { 19 | Show-UDToast $Body 20 | } 21 | } 22 | 23 | } -Cmdlet 'New-UDAutocomplete' -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/inputs/date-picker.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Date Picker' -Description 'Date pickers pickers provide a simple way to select a single value from a pre-determined set.' -SecondDescription "" -Content { 2 | New-Example -Title 'Date Picker' -Description '' -Example { 3 | New-UDDatePicker 4 | } 5 | } -Cmdlet "New-UDDatePicker" 6 | -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/inputs/floating-action-button.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Floating Action Button' -Description 'A floating action button (FAB) performs the primary, or most common, action on a screen.' -SecondDescription "A floating action button appears in front of all screen content, typically as a circular shape with an icon in its center. FABs come in two types: regular, and extended. 2 | 3 | Only use a FAB if it is the most suitable way to present a screen’s primary action. 4 | 5 | Only one floating action button is recommended per screen to represent the most common action." -Content { 6 | New-Example -Title 'Floating Action Button' -Description '' -Example { 7 | New-UDFloatingActionButton -Icon (New-UDIcon -Icon user) -Size Small 8 | New-UDFloatingActionButton -Icon (New-UDIcon -Icon user) -Size Medium 9 | New-UDFloatingActionButton -Icon (New-UDIcon -Icon user) -Size Large 10 | } 11 | 12 | New-Example -Title 'OnClick' -Description '' -Example { 13 | New-UDFloatingActionButton -Icon (New-UDIcon -Icon user) -OnClick { 14 | Show-UDToast -Message "Hello!" 15 | } 16 | } 17 | } -Cmdlet "New-UDFloatingActionButton" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/inputs/switch.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Switch' -Description 'Switches toggle the state of a single setting on or off.' -SecondDescription "Switches are the preferred way to adjust settings on mobile. The option that the switch controls, as well as the state it’s in, should be made clear from the corresponding inline label." -Content { 2 | New-Example -Title 'Switch' -Description '' -Example { 3 | New-UDSwitch -Checked $true 4 | New-UDSwitch -Checked $true -Disabled 5 | } 6 | 7 | New-Example -Title 'OnChange Event' -Description '' -Example { 8 | New-UDSwitch -OnChange { Show-UDToast -Message $Body } 9 | } 10 | 11 | } -Cmdlet "New-UDSwitch" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/inputs/textbox.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Textbox' -Description 'A textbox lets users enter and edit text.' -SecondDescription "" -Content { 2 | New-Example -Title 'Textbox' -Description '' -Example { 3 | New-UDTextbox -Label 'Standard' -Placeholder 'Textbox' 4 | New-UDTextbox -Label 'Disabled' -Placeholder 'Textbox' -Disabled 5 | New-UDTextbox -Label 'Textbox' -Value 'With value' 6 | } 7 | 8 | New-Example -Title 'Password Textbox' -Description '' -Example { 9 | New-UDTextbox -Label 'Password' -Type password 10 | } 11 | 12 | New-Example -Title 'Retrieving a textbox value' -Description 'You can use Get-UDElement to get the value of a textbox' -Example { 13 | New-UDTextbox -Id 'txtExample' 14 | New-UDButton -OnClick { 15 | $Value = (Get-UDElement -Id 'txtExample').value 16 | Show-UDToast -Message $Value 17 | } -Text "Get textbox value" 18 | } 19 | } -Cmdlet "New-UDTextbox" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/inputs/time-picker.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Time Picker' -Description 'Time pickers pickers provide a simple way to select a single value from a pre-determined set.' -SecondDescription "" -Content { 2 | New-Example -Title 'Time Picker' -Description '' -Example { 3 | New-UDTimePicker 4 | } 5 | } -Cmdlet "New-UDTimePicker" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/navigation/stepper.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Stepper' -Description 'Steppers convey progress through numbered steps. It provides a wizard-like workflow.' -SecondDescription "Steppers display progress through a sequence of logical and numbered steps. They may also be used for navigation. Steppers may display a transient feedback message after a step is saved." -Content { 2 | New-Example -Title 'Stepper' -Description '' -Example { 3 | New-UDStepper -Steps { 4 | New-UDStep -OnLoad { 5 | New-UDElement -tag 'div' -Content { "Step 1" } 6 | New-UDTextbox -Id 'txtStep1' 7 | } -Label "Step 1" 8 | New-UDStep -OnLoad { 9 | New-UDElement -tag 'div' -Content { "Step 2" } 10 | New-UDElement -tag 'div' -Content { "Previous data: $Body" } 11 | New-UDTextbox -Id 'txtStep2' 12 | } -Label "Step 2" 13 | New-UDStep -OnLoad { 14 | New-UDElement -tag 'div' -Content { "Step 3" } 15 | New-UDElement -tag 'div' -Content { "Previous data: $Body" } 16 | New-UDTextbox -Id 'txtStep3' 17 | } -Label "Step 3" 18 | } -OnFinish { 19 | New-UDTypography -Text 'Nice! You did it!' -Variant h3 20 | New-UDElement -Tag 'div' -Id 'result' -Content {$Body} 21 | } 22 | } 23 | 24 | } -Cmdlet @("New-UDStepper", "New-UDStep") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/navigation/tabs.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Tabs' -Description 'Tabs make it easy to explore and switch between different views.' -SecondDescription "Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy." -Content { 2 | New-Example -Title 'Simple Tables' -Description 'A simple example with no frills.' -Example { 3 | New-UDTabs -Tabs { 4 | New-UDTab -Text 'Item One' -Content { New-UDTypography -Text 'Item One' -Variant 'h2' } 5 | New-UDTab -Text 'Item Two' -Content { New-UDTypography -Text 'Item Two' -Variant 'h2' } 6 | New-UDTab -Text 'Item Three' -Content { New-UDTypography -Text 'Item Three' -Variant 'h2' } 7 | } 8 | } 9 | 10 | New-Example -Title 'Vertical Tables' -Description 'Vertical tabs' -Example { 11 | New-UDTabs -Tabs { 12 | New-UDTab -Text 'Item One' -Content { New-UDTypography -Text 'Item One' -Variant 'h2' } 13 | New-UDTab -Text 'Item Two' -Content { New-UDTypography -Text 'Item Two' -Variant 'h2' } 14 | New-UDTab -Text 'Item Three' -Content { New-UDTypography -Text 'Item Three' -Variant 'h2' } 15 | } -Orientation vertical 16 | } 17 | 18 | } -Cmdlet @("New-UDTabs", "New-UDTab") -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/surfaces/appbar.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'AppBar' ` 2 | -Description 'The App Bar displays information and actions relating to the current screen.' ` 3 | -SecondDescription "The top App Bar provides content and actions related to the current screen. It's used for branding, screen titles, navigation, and actions." -Content { 4 | 5 | New-Example -Title 'AppBar with Custom Drawer' -Example { 6 | $Drawer = New-UDDrawer -Children { 7 | New-UDList -Children { 8 | New-UDListItem -Label "Home" 9 | New-UDListItem -Label "Getting Started" -Children { 10 | New-UDListItem -Label "Installation" -OnClick {} 11 | New-UDListItem -Label "Usage" -OnClick {} 12 | New-UDListItem -Label "FAQs" -OnClick {} 13 | New-UDListItem -Label "System Requirements" -OnClick {} 14 | New-UDListItem -Label "Purchasing" -OnClick {} 15 | } 16 | } 17 | } 18 | 19 | New-UDAppBar -Position relative -Children { New-UDElement -Tag 'div' -Content { "Title" } } -Drawer $Drawer 20 | } 21 | } -Cmdlet 'New-UDAppBar' 22 | -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/surfaces/card.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Card' -Description 'Cards contain content and actions about a single subject.' -SecondDescription "Cards are surfaces that display content and actions on a single topic. 2 | 3 | They should be easy to scan for relevant and actionable information. Elements, like text and images, should be placed on them in a way that clearly indicates hierarchy." -Content { 4 | New-Example -Title 'Simple Card' -Description 'Although cards can support multiple actions, UI controls, and an overflow menu, use restraint and remember that cards are entry points to more complex and detailed information.' -Example { 5 | New-UDCard -Title 'Simple Card' -Content { 6 | "This is some content" 7 | } 8 | } 9 | } -Cmdlet "New-UDCard" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/surfaces/expansion-panel.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Expansion Panel' -Description 'Expansion panels contain creation flows and allow lightweight editing of an element.' -SecondDescription "An expansion panel is a lightweight container that may either stand alone or be connected to a larger surface, such as a card." -Content { 2 | New-Example -Title 'Simple Expansion Panel' -Description '' -Example { 3 | New-UDExpansionPanelGroup -Children { 4 | New-UDExpansionPanel -Title "Hello" -Children {} 5 | 6 | New-UDExpansionPanel -Title "Hello" -Id 'expContent' -Children { 7 | New-UDElement -Tag 'div' -Content { "Hello" } 8 | } 9 | } 10 | } 11 | } -Cmdlet "New-UDExpansionPanel" -------------------------------------------------------------------------------- /Dashboard/v3/example/pages/surfaces/paper.ps1: -------------------------------------------------------------------------------- 1 | New-ComponentPage -Title 'Paper' -Description 'In Material Design, the physical properties of paper are translated to the screen.' -SecondDescription "The background of an application resembles the flat, opaque texture of a sheet of paper, and an application’s behavior mimics paper’s ability to be re-sized, shuffled, and bound together in multiple sheets." -Content { 2 | New-Example -Title 'Paper' -Description '' -Example { 3 | New-UDPaper -Elevation 0 -Content {} 4 | New-UDPaper -Elevation 1 -Content {} 5 | New-UDPaper -Elevation 3 -Content {} 6 | } 7 | } -Cmdlet "New-UDPaper" -------------------------------------------------------------------------------- /Dashboard/v3/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/Dashboard/v3/favicon.ico -------------------------------------------------------------------------------- /Dashboard/v3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | PowerShell Universal Dashboard 9 | 34 | 35 | 36 |
37 | 38 | -------------------------------------------------------------------------------- /Dashboard/v3/sandbox.ps1: -------------------------------------------------------------------------------- 1 | $Env:SkipMaterial = $true 2 | 3 | Import-Module (Join-Path $PSScriptRoot "../output/UniversalDashboard.Community.psd1") 4 | Import-Module (Join-Path $PSScriptRoot "UniversalDashboard.MaterialUI.psm1") -Force -ArgumentList $true 5 | 6 | Set-Location $PSScriptRoot 7 | Start-Process npm -ArgumentList @("run", "dev") 8 | 9 | $Dashboard = . (Join-Path $PSScriptRoot 'dashboard.ps1') 10 | Start-UDDashboard -Port 10001 -Dashboard $Dashboard -AutoReload -Force 11 | Start-Process http://localhost:10001 12 | -------------------------------------------------------------------------------- /Templates/ActiveDirectory/.universal/dashboards.ps1: -------------------------------------------------------------------------------- 1 | New-PSUDashboard -Name "ActiveDirectory" -FilePath "dashboards\ActiveDirectory\ActiveDirectory.ps1" -BaseUrl "/dashboard" -Framework "UniversalDashboard:Latest" -SessionTimeout 0 -AutoDeploy -------------------------------------------------------------------------------- /Templates/ActiveDirectory/.universal/scripts.ps1: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Templates/ActiveDirectory/.universal/variables.ps1: -------------------------------------------------------------------------------- 1 | New-PSUVariable -Name "ActiveDirectoryServer" -Value "172.31.63.235" -Description "The AD domain or server to connect to." 2 | New-PSUVariable -Name "ActiveDirectoryCredential" -Vault "BuiltInLocalVault" -Type "PSCredential" -Description "The AD credentials used for connecting to the domain." -------------------------------------------------------------------------------- /Templates/ActiveDirectory/dashboards/ActiveDirectory/ActiveDirectory.ps1: -------------------------------------------------------------------------------- 1 |  2 | $Navigation = @( 3 | New-UDListItem -Label "Group Membership" -OnClick { Invoke-UDRedirect '/Groups' } 4 | New-UDListItem -Label "Reset Password" -OnClick { Invoke-UDRedirect '/Reset-Password' } 5 | New-UDListItem -Label "Restore Deleted User" -OnClick { Invoke-UDRedirect '/Restore-Deleted-User' } 6 | New-UDListItem -Label "Object Search" -OnClick { Invoke-UDRedirect '/Object-Search' } 7 | ) 8 | 9 | New-UDDashboard -Title "Active Directory Tools" -Pages @( 10 | . "$PSScriptRoot\pages\group-membership.ps1" 11 | . "$PSScriptRoot\pages\password-reset.ps1" 12 | . "$PSScriptRoot\pages\restore-deleted-user.ps1" 13 | . "$PSScriptRoot\pages\object-search.ps1" 14 | . "$PSScriptRoot\pages\object-info.ps1" 15 | ) -------------------------------------------------------------------------------- /Templates/ActiveDirectory/dashboards/ActiveDirectory/pages/object-info.ps1: -------------------------------------------------------------------------------- 1 | 2 | function New-UDADObjectInfoTable 3 | { 4 | param( 5 | [string]$Server = $ActiveDirectoryServer, 6 | [PSCredential]$Credential = $ActiveDirectoryCredential, 7 | [string]$Id 8 | ) 9 | 10 | $Object = Get-ADObject -Server $Server -Credential $Credential -IncludeDeletedObjects:$EventData.includeDeleted -Identity $Id -Properties * 11 | New-UDTable -Data $Object.PSObject.Properties -Columns @( 12 | New-UDTableColumn -Property Name -Title "Name" -Filter 13 | New-UDTableColumn -Property Value -Title "Value" -Filter -Render { if ($EventData.Value) { $EventData.Value.ToString() } else { "" } } 14 | ) -Filter -Paging 15 | } 16 | 17 | New-UDPage -Name 'Object Info' -Url "Object-Info/:guid" -Content { 18 | New-UDADObjectInfoTable -Id $Guid 19 | } -Navigation $Navigation -------------------------------------------------------------------------------- /Templates/Demo/.universal/dashboards.ps1: -------------------------------------------------------------------------------- 1 | New-PSUDashboard -Name "ComputerInfo" -FilePath "dashboards\ComputerInfo\ComputerInfo.ps1" -BaseUrl "/dashboard" -Framework "UniversalDashboard:Latest" -SessionTimeout 0 -Credential "Default" 2 | New-PSUDashboard -Name "Components" -FilePath "dashboards\Components\Components.ps1" -BaseUrl "/components" -Framework "UniversalDashboard:Latest" -Component @("UniversalDashboard.Charts:1.3.2", "UniversalDashboard.Map:1.0") -SessionTimeout 0 -Description "Example of components of PowerShell Universal Dashboard" -Credential "Default" 3 | New-PSUDashboard -Name "CSV Editor" -FilePath "dashboards\CSV Editor\CSV Editor.ps1" -BaseUrl "/csv-editor" -Framework "UniversalDashboard:Latest" -SessionTimeout 0 -AutoDeploy -------------------------------------------------------------------------------- /Templates/Demo/.universal/endpoints.ps1: -------------------------------------------------------------------------------- 1 | New-PSUEndpoint -Url "/service/:name" -Description "Stops a service" -Method "DELETE" -Endpoint { 2 | Stop-Service $Name 3 | } 4 | New-PSUEndpoint -Url "/service/:name" -Description "Starts a service." -Method "POST" -Endpoint { 5 | Start-Service $Name 6 | } 7 | New-PSUEndpoint -Url "/service" -Description "Returns the services on this machine. " -Endpoint { 8 | Get-Service | ForEach-Object { 9 | @{ 10 | Name = $_.Name 11 | Status = $_.Status.ToString() 12 | } 13 | } 14 | } 15 | New-PSUEndpoint -Url "/process/:name" -Description "Starts a process. " -Method "POST" -Endpoint { 16 | # Try it: Invoke-RestMethod http://localhost:5000/process/code?arguments=file.txt -Method post 17 | $arg = @{} 18 | if ($Arguments) 19 | { 20 | $arg = @{ 21 | ArgumentList = $Arguments 22 | } 23 | } 24 | 25 | 26 | Start-Process $Name @arg 27 | } 28 | New-PSUEndpoint -Url "/process" -Description "Returns processes for this machine." -Endpoint { 29 | Get-Process | ForEach-Object { 30 | @{ 31 | ID = $_.Id 32 | Name = $_.Name 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Templates/Demo/.universal/environments.ps1: -------------------------------------------------------------------------------- 1 | New-PSUEnvironment -Name "7.1.0" -Path "C:\Program Files\PowerShell\7\pwsh.exe" -Variables @('*') 2 | New-PSUEnvironment -Name "5.1.19041.1023" -Path "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -Variables @('*') 3 | New-PSUEnvironment -Name "Integrated" -Path "PowerShell Version: 7.1.3" -Variables @('*') 4 | New-PSUEnvironment -Name "Persistent" -Path "pwsh.exe" -PersistentRunspace -------------------------------------------------------------------------------- /Templates/Demo/.universal/schedules.ps1: -------------------------------------------------------------------------------- 1 | New-PSUSchedule -Cron "0 * * * *" -Script "StartProcess.ps1" -TimeZone "America/Chicago" -Credential "Default" -FilePath 'Notepad' -Name "Start Notepad every hour" 2 | New-PSUSchedule -Cron "* * * * *" -Script "CacheProcesses.ps1" -TimeZone "America/Chicago" -Credential "Default" -Name "Cache processes every minute." -------------------------------------------------------------------------------- /Templates/Demo/.universal/scripts.ps1: -------------------------------------------------------------------------------- 1 | New-PSUScript -Name "FindLargeFiles.ps1" -Tag @("Files") -Path "FindLargeFiles.ps1" -Environment "5.1.19041.1023" -InformationAction "Continue" 2 | New-PSUScript -Name "StartProcess.ps1" -Tag @("Processes") -Path "StartProcess.ps1" -InformationAction "Continue" 3 | New-PSUScript -Name "CacheProcesses.ps1" -Path "CacheProcesses.ps1" -InformationAction "Continue" -------------------------------------------------------------------------------- /Templates/Demo/.universal/tags.ps1: -------------------------------------------------------------------------------- 1 | New-PSUTag -Name "Files" -Color "#85a5ff" 2 | New-PSUTag -Name "Processes" -Color "#c41d7f" -------------------------------------------------------------------------------- /Templates/Demo/CacheProcesses.ps1: -------------------------------------------------------------------------------- 1 | $Processes = Get-Process | Select-Object Name, ID 2 | Set-PSUCache -Key "Processes" -value $Processes -------------------------------------------------------------------------------- /Templates/Demo/FindLargeFiles.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length -------------------------------------------------------------------------------- /Templates/Demo/StartProcess.ps1: -------------------------------------------------------------------------------- 1 | param($FilePath) 2 | 3 | Start-Process $FilePath -------------------------------------------------------------------------------- /Templates/Demo/dashboards/Components/Components.ps1: -------------------------------------------------------------------------------- 1 | $Pages = @() 2 | 3 | $Pages += . "$PSScriptRoot\chartjs.ps1" 4 | $Pages += . "$PSScriptRoot\dynamic.ps1" 5 | $Pages += . "$PSScriptRoot\element.ps1" 6 | $Pages += . "$PSScriptRoot\form.ps1" 7 | $Pages += . "$PSScriptRoot\map.ps1" 8 | $Pages += . "$PSScriptRoot\nivo.ps1" 9 | $Pages += . "$PSScriptRoot\table.ps1" 10 | 11 | New-UDDashboard -Title "Components" -Pages $Pages -------------------------------------------------------------------------------- /Templates/Demo/dashboards/Components/dynamic.ps1: -------------------------------------------------------------------------------- 1 | New-UDPage -Name 'New-UDDynamic' -Content { 2 | New-UDTypography -Text 'Basic Dynamic Region' -Variant 'h4' 3 | 4 | New-UDDynamic -Id 'date' -Content { 5 | New-UDTypography -Text "$(Get-Date)" 6 | } 7 | 8 | New-UDButton -Text 'Reload Date' -OnClick { Sync-UDElement -Id 'date' } 9 | 10 | New-UDElement -Tag 'hr' 11 | 12 | New-UDTypography -Text 'Auto-Refresh' -Variant 'h4' 13 | 14 | New-UDDynamic -Id 'date' -Content { 15 | New-UDTypography -Text "$(Get-Date)" 16 | New-UDTypography -Text "$(Get-Random)" 17 | } -AutoRefresh -AutoRefreshInterval 1 18 | 19 | New-UDElement -Tag 'hr' 20 | 21 | New-UDTypography -Text 'Loading Component' -Variant 'h4' 22 | 23 | New-UDDynamic -Content { 24 | Start-Sleep -Seconds 10 25 | New-UDTypography -Text "Done!" 26 | } -LoadingComponent { 27 | New-UDProgress -Circular 28 | } 29 | } -------------------------------------------------------------------------------- /Templates/Demo/dashboards/ComputerInfo/ComputerInfo.ps1: -------------------------------------------------------------------------------- 1 | New-UDDashboard -Title "Hello, World!" -Content { 2 | $Data = Get-PSUCache -Key 'Processes' 3 | 4 | New-UDTable -Data $Data -Paging 5 | } -------------------------------------------------------------------------------- /Templates/Windows/.universal/dashboards.ps1: -------------------------------------------------------------------------------- 1 | New-PSUDashboard -Name "Windows" -FilePath "dashboards\Windows\Windows.ps1" -BaseUrl "/dashboard" -Framework "UniversalDashboard:Latest" -Environment "Windows PowerShell" -Component @("UniversalDashboard.Charts:1.3.2") -SessionTimeout 0 -Credential "Default" -------------------------------------------------------------------------------- /Templates/Windows/.universal/endpoints.ps1: -------------------------------------------------------------------------------- 1 | New-PSUEndpoint -Url "/service" -Description "Returns services on this machine. " -Endpoint { 2 | Get-Service | ForEach-Object { 3 | @{ 4 | Name = $_.Name 5 | Status = $_.Status.ToString() 6 | } 7 | } 8 | } 9 | New-PSUEndpoint -Url "/process" -Description "Returns processes running on this machine." -Endpoint { 10 | Get-Process | ForEach-Object { 11 | @{ 12 | Name = $_.Name 13 | Id = $_.Id 14 | } 15 | } 16 | } 17 | New-PSUEndpoint -Url "/info" -Description "Returns computer information about this machine." -Endpoint { 18 | Get-ComputerInfo 19 | } 20 | New-PSUEndpoint -Url "/disk" -Description "Returns disk information for this machine." -Endpoint { 21 | Get-Disk | ForEach-Object { 22 | @{ 23 | FriendlyName = $_.FriendlyName 24 | Size = $_.Size 25 | Path = $_.Path 26 | OperationalStatus = $_.OperationalStatus.ToString() 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Templates/Windows/.universal/environments.ps1: -------------------------------------------------------------------------------- 1 | New-PSUEnvironment -Name "7.1.0" -Path "C:\Program Files\PowerShell\7\pwsh.exe" -Variables @('*') 2 | New-PSUEnvironment -Name "5.1.19041.1023" -Path "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -Variables @('*') 3 | New-PSUEnvironment -Name "Integrated" -Path "PowerShell Version: 7.1.3" -Variables @('*') 4 | New-PSUEnvironment -Name "Windows PowerShell" -Path "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -Variables @('*') -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell Universal 2 | 3 | PowerShell Universal is the ultimate platform for building web-based IT tools. 4 | 5 | # Features 6 | 7 | - [APIs](https://docs.ironmansoftware.com/api/about) - Build custom APIs with PowerShell 8 | - [Automation](https://docs.ironmansoftware.com/automation/about) - Execute, audit and schedule PowerShell scripts 9 | - [Dashboard](https://docs.ironmansoftware.com/dashboard/about) - Build webpages with PowerShell 10 | 11 | # Resources 12 | 13 | - [Downloads](https://ironmansoftware.com/downloads) 14 | - [Documentation](https://docs.ironmansoftware.com/) 15 | - [Pricing](https://store.ironmansoftware.com/pricing/powershell-universal) 16 | - [Forums](https://forums.universaldashboard.io/) 17 | 18 | 21 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /images/New-UDAzureAppInsightsCounter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/images/New-UDAzureAppInsightsCounter.png -------------------------------------------------------------------------------- /images/New-UDHVVMCard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/images/New-UDHVVMCard.png -------------------------------------------------------------------------------- /images/New-UDHVVMWizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/images/New-UDHVVMWizard.png -------------------------------------------------------------------------------- /images/New-UDProcessTable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/images/New-UDProcessTable.png -------------------------------------------------------------------------------- /images/querytool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/powershell-universal-legacy/42b8d1ef078d052f3170c0408f2b44063b1165ed/images/querytool.png --------------------------------------------------------------------------------