poshud/pages/monitors.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$Basic = {
    New-UDMonitor -Title "Downloads per second" -Type Line  -Endpoint {
        Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData
    }
}

$RefreshIntervalDataRetention = {
    New-UDMonitor -Title "Downloads per second" -Type Line  -Endpoint {
        Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData
    } -DataPointHistory 20 -RefreshInterval 5
}

$CustomColors = {
    New-UDMonitor -Title "Downloads per second" -Type Line  -Endpoint {
        Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData
    } -ChartBackgroundColor '#59FF681B' -ChartBorderColor '#FFFF681B' -BackgroundColor "#252525" -FontColor "#FFFFFF"
}

New-UDPage -Name "Monitors" -Icon chart_line -Content {
    New-UDPageHeader -Title "Monitors" -Icon "line-chart" -Description "Visual data using dynamic charts that trace information over time" -DocLink "https://docs.universaldashboard.io/components/monitors"
    New-UDExample -Title "Basic Monitors" -Description "Create basic monitors from any type of data." -Script $Basic
    New-UDExample -Title "Customize refresh rate and data retention" -Description "Customize how often data is returned from the server and how much data to keep" -Script $RefreshIntervalDataRetention
    New-UDExample -Title "Custom colors" -Description "Adjust colors of different components within the monitor." -Script $CustomColors
}