update
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
$Navigation = @(
|
||||
New-UDListItem -Label 'Home' -OnClick {
|
||||
Invoke-UDRedirect -Url '/Home'
|
||||
}
|
||||
switch($env:computername){
|
||||
"ITDWINAUTOT1" {
|
||||
New-UDListItem -Label 'Infra-VMware.Snapshot_NPD' -OnClick {
|
||||
Invoke-UDRedirect -Url '/NPD'
|
||||
}
|
||||
}
|
||||
"ITDWINAUTOP1" {
|
||||
New-UDListItem -Label 'Infra-VMware.Snapshot_PRD' -OnClick {
|
||||
Invoke-UDRedirect -Url '/PRD'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
New-UDListItem -Label 'Live Snapshots' -OnClick {
|
||||
Invoke-UDRedirect -Url '/LiveSnapshots'
|
||||
}
|
||||
)
|
||||
|
||||
New-UDApp -Title 'PowerShell Universal' -Pages @(
|
||||
Get-UDPage -Name 'Home'
|
||||
switch($env:computername){
|
||||
"ITDWINAUTOT1" { Get-UDPage -Name 'NPD' }
|
||||
"ITDWINAUTOP1" { Get-UDPage -Name 'PRD' }
|
||||
}
|
||||
Get-UDPage -Name 'LiveSnapshots'
|
||||
) -Navigation $Navigation
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
New-UDPage -Url "/PRD" -Name "PRD" -Content {
|
||||
New-UDTypography -Text 'PRD'
|
||||
<#New-UDForm -Content {
|
||||
|
||||
New-UDRow -Columns {
|
||||
New-UDColumn -SmallSize 6 -LargeSize 6 -Content {
|
||||
New-UDTextBox -Label "VMName" -Id VMName
|
||||
New-UDTextBox -Label "DateTime" -Id DateTime
|
||||
New-UDTextBox -Label "DurationHours" -Id DurationHours
|
||||
New-UDTextBox -Label "Email" -Id Email
|
||||
}
|
||||
}
|
||||
} -OnSubmit {
|
||||
$InvokePSUScriptParams = @{
|
||||
Script = 'New-ITDVMwareSnapshotTask.ps1'
|
||||
VMName = $EventData.VMName;
|
||||
DateTime = $EventData.DateTime;
|
||||
DurationHours = $EventData.DurationHours;
|
||||
Email = $EventData.Email
|
||||
}
|
||||
$InvokePSUScriuptResult = Invoke-PSUScript @InvokePSUScriptParams -Wait
|
||||
Show-UDToast -Message ("attempting snapshot")
|
||||
} #>
|
||||
|
||||
switch($env:COMPUTERNAME){
|
||||
"ITDWINAUTOT1" {
|
||||
$ServerInstance = "itdintsql22p1.nd.gov\INTSQL22P1"
|
||||
$Database = "ITD-Systems-Automation"
|
||||
$SnapshotTable = "Infra_VMware_VirtualMachine_VMSnapshots_NPD"
|
||||
}
|
||||
"ITDWINAUTOP1" {
|
||||
$ServerInstance = "itdintsql22p1.nd.gov\INTSQL22P1"
|
||||
$Database = "ITD-Systems-Automation"
|
||||
$SnapshotTable = "Infra_VMware_VirtualMachine_VMSnapshots_PRD"
|
||||
}
|
||||
}
|
||||
|
||||
$SqlQuery = "SELECT [ID],[VMName],[DateTime],[RequestedBy],[DurationHours],[Status],[NotifyEmail],[PSUJobIdRequest],[PSUJobIdDelete],[TakenDateTime],[ExpireDateTime],[DeleteDateTime] FROM [$Database].[dbo].[$SnapshotTable]"
|
||||
$SqlRecords = Invoke-Sqlcmd -ServerInstance $ServerInstance -Database $Database -Query $SqlQuery -Credential $Secret:sql_itdpsu1 -Verbose
|
||||
|
||||
New-UDTable -Columns @(
|
||||
New-UDTableColumn -Property 'Id' -Title 'Id' -ShowFilter
|
||||
New-UDTableColumn -Property 'VMName' -Title 'VMName' -ShowFilter
|
||||
New-UDTableColumn -Property 'DateTime' -Title 'DateTime'
|
||||
New-UDTableColumn -Property 'RequestedBy' -Title 'RequestedBy' -ShowFilter
|
||||
New-UDTableColumn -Property 'DurationHours' -Title 'DurationHours'
|
||||
New-UDTableColumn -Property 'Status' -Title 'Status' -ShowFilter
|
||||
New-UDTableColumn -Property 'NotifyEmail' -Title 'NotifyEmail' -ShowFilter
|
||||
New-UDTableColumn -Property 'PSUJobIdRequest' -Title 'PSUJobIDRequest' -ShowFilter
|
||||
New-UDTableColumn -Property 'PSUJobIdDelete' -Title 'PSUJobIDDelete' -ShowFilter
|
||||
New-UDTableColumn -Property 'TakenDateTime' -Title 'TakenDateTime'
|
||||
New-UDTableColumn -Property 'ExpireDateTime' -Title 'ExpireDateTime'
|
||||
) -Data ($SqlRecords | Sort-Object -Descending Id) -ShowPagination -PageSize 20 -Dense
|
||||
} -Title "PRD" -Icon @{
|
||||
id = 'd0f3391d-efa6-4210-b4dd-ef0cad028382'
|
||||
type = 'icon'
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
New-UDPage -Name 'Home' -Content {
|
||||
New-UDTypography -Text 'Home' -Id 'homeText'
|
||||
} -Generated
|
||||
Reference in New Issue
Block a user