Hello Folks,
I made a page formating using a div table created using New-UDElement cmdlet and I was wondering if it could cause the slow loading of the page as I tested every functions and data gathering script and it those runs in approx 2-3 seconds and the page takes between 10-15 seconds to load.
Is there another way to acheive this ? New-UDRow and New-UDColumns are not really great for the page formating I’m aiming to do
I’d love some thoughts about this.
Many thanks in advance !
Cheers
Edit : Code Example:
Blockquote
$DivCellCSSContent = @{
display = ‘table-cell’
border = ‘0x solid #999999’
padding = ‘10px 10px’
‘vertical-align’ = ‘middle’
margin = ‘auto’
‘font-size’ = ‘12px’
}
$DivCellCSSLogo = @{
display = ‘table-cell’
border = ‘0px solid #999999’
padding = ‘10px 10px’
‘vertical-align’ = ‘middle’
width = ‘10%’
margin = ‘auto’
color = ‘#A9A9A9’
}
New-UDElement -Tag ‘div’ -Content {
# Row Group
New-UDElement -Tag ‘div’ -Content {
# Row 1
New-UDElement -Tag ‘div’ -Content {
# Cell
New-UDElement -Tag ‘div’ -Content {
New-UDElement -Tag ‘div’ -Content {
New-UDIcon -Icon desktop -Size 3x
}
} -Attributes @{
style = $DivCellCSSLogo
}
# Cell
New-UDElement -Tag ‘div’ -Content {
New-UDElement -Tag 'div' -Content {
"Last Machine Policy Refresh"
} -Attributes @{
style = @{
'font-weight' = 'bold'
}
}
New-UDElement -Tag 'div' -Content {
$CMDevice.LastPolicyRequest
}
} -Attributes @{
style = $DivCellCSSContent
}
# Cell
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDIcon -Icon desktop -Size 3x
}
} -Attributes @{
style = $DivCellCSSLogo
}
# Cell
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
"Last Hardware Scan"
} -Attribute @{
style = @{
'font-weight' = 'bold'
}
}
New-UDElement -Tag 'div' -Content {
$CMDevice.LastHardwareScan
}
} -Attributes @{
style = $DivCellCSSContent
}
} -Attributes @{
style = @{
display = 'table-row'
}
}
# Row 2
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDIcon -Icon desktop -Size 3x
}
} -Attributes @{
style = $DivCellCSSLogo
}
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
"Last Software Scan"
} -Attributes @{
style = @{
'font-weight' = 'bold'
}
}
New-UDElement -Tag 'div' -Content {
$CMDevice.LastSoftwareScan
}
} -Attributes @{
style = $DivCellCSSContent
}
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDIcon -Icon desktop -Size 3x
}
} -Attributes @{
style = $DivCellCSSLogo
}
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
"Client Version"
} -Attribute @{
style = @{
'font-weight' = 'bold'
}
}
New-UDElement -Tag 'div' -Content {
$CMDevice.ClientVersion
}
} -Attributes @{
style = $DivCellCSSContent
}
} -Attributes @{
style = @{
display = 'table-row'
}
}
# Row 3
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDIcon -Icon desktop -Size 3x
}
} -Attributes @{
style = $DivCellCSSLogo
}
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
"Resource ID"
} -Attributes @{
style = @{
'font-weight' = 'bold'
}
}
New-UDElement -Tag 'div' -Content {
$CMDevice.ResourceID
}
} -Attributes @{
style = $DivCellCSSContent
}
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
New-UDIcon -Icon desktop -Size 3x
}
} -Attributes @{
style = $DivCellCSSLogo
}
New-UDElement -Tag 'div' -Content {
New-UDElement -Tag 'div' -Content {
"Logged On User"
} -Attribute @{
style = @{
'font-weight' = 'bold'
}
}
New-UDElement -Tag 'div' -Content {
$CMDevice.CurrentLogonUser
}
} -Attributes @{
style = $DivCellCSSContent
}
} -Attributes @{
style = @{
display = 'table-row'
}
}
} -Attributes @{
style = @{
display = 'table-row-group'
}
}
} -Attributes @{
style = @{
display = ‘table’
width = ‘90%’
‘margin-left’ = ‘5%’
‘margin-right’ = ‘5%’
}
}