-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAzureThemeRadio.ps1
More file actions
120 lines (111 loc) · 4.26 KB
/
AzureThemeRadio.ps1
File metadata and controls
120 lines (111 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
###import module ready to use
Import-Module -Name UniversalDashboard.Community
###get and stop any existing dashboards so no conflict with port numbers
Get-UDDashboard | Stop-UDDashboard
###Set your endpoint and how often you want your cached variables inside the endpoint update
$Schedule = New-UDEndpointSchedule -Every 60 -Second
####initialise the endpoint variable to load when the dashboard loads...you can include functions, and use the cache variable very important
$Endpoint = New-UDEndpoint -Schedule $Schedule -Endpoint {
$Cache:files = Get-ChildItem $ENV:HOMEDRIVE | Select-Object Name | Export-csv $ENV:HOMEDRIVE\files.csv -NoTypeInformation
}
##Get Ready for the dashboard
$NavBarLinks = @((New-UDLink -Text "Visit My Website" -Url "https://wwww.yoursite.com" -Icon medkit))
$Link = New-UDLink -Text 'Company Website' -Url 'http://www.yourcompany.com' -Icon globe
$Footer = New-UDFooter -Copyright 'Designed by Your Name' -Links $Link
$theme = New-UDTheme -Name "Azure" -Definition @{
UDDashboard = @{
BackgroundColor = "#333333"
FontColor = "#FFFFF"
}
UDNavBar = @{
BackgroundColor = "#1c1c1c"
FontColor = "#55b3ff"
}
UDCard = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDChart = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDMonitor = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDTable = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDGrid = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDCounter = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDInput = @{
BackgroundColor = "#252525"
FontColor = "#FFFFFF"
}
UDFooter = @{
BackgroundColor = "#1c1c1c"
FontColor = "#55b3ff"
}
'.tabs .tab' = @{
'color' = "#252525"
}
'.tabs .tab a:hover' = @{
'background-color' = "#252525"
'color' = "#55b3ff"
}
'.tabs .tab a.active' = @{
'background-color' = "#1c1c1c"
'color' = "#55b3ff"
}
'.tabs .tab a:focus.active' = @{
'background-color' = "#252525"
'color' = "#55b3ff"
}
'.tabs .indicator' = @{
'background-color' = "#55b3ff"
}
'.tabs .tab a' = @{
'color' = "#FFFFFF"
}
'.tabs' = @{
'background-color' = "#333333"
}
'[type="radio"]:checked + span::after' = @{
'background-color' = "#55b3ff"
}
}
$Homep = New-UDPage -Name "Home Page" -Icon home -Content {
New-UDTabContainer -Tabs {
New-UDTab -Text "HOME" -Content {
$Layout = '{"lg":[{"w":8,"h":12,"x":0,"y":0,"i":"grid-element-left","moved":false,"static":false},{"w":3,"h":7,"x":8,"y":0,"i":"grid-element-right","moved":false,"static":false}]}'
New-UDGridLayout -Layout $Layout -Content {
New-UDMonitor -Id "left" -Title "Number of files on $ENV:HOMEDRIVE" -Type Line -Endpoint {
$csvcount = Import-Csv $ENV:HOMEDRIVE\files.csv
$csvcount.Name.count | Out-UDMonitorData
}
New-UDCounter -Id "right" -Title "Files on $ENV:HOMEDRIVE" -Icon calculator -Endpoint {
$csvcount = Import-Csv $ENV:HOMEDRIVE\files.csv
$csvcount.Name.count
}
}
}
New-UDTab -Text "TEST" -Content {
New-UDCard -Content {
New-UDRadio -Label 'Option 1' -Group 'Group 1'
New-UDRadio -Label 'Option 2' -Group 'Group 1'
New-UDRadio -Label 'Option 3' -Group 'Group 1'
}
}
}
}
$dashboard = New-UDDashboard -Title "Montior Counter Demo" -Pages (
$Homep
) -NavbarLinks $NavBarLinks -Footer $Footer -Theme $theme
Start-UDDashboard -Dashboard $dashboard -Port 8091 -Name DemoDashboard -AutoReload -Endpoint $Endpoint