Feature: Display detailed device hardware audit information

The device Details tab now displays processor, memory, disk and network adapter information collected at the previous enrolment
This commit is contained in:
Gary Sharp committed 2020-11-29 16:45:10 +11:00
1 parent f1d27732c7
commit f82b47dd46
6 files changed
+1283 -95

No files matched your search

@@ -0,0 +1,90 @@
using Disco.Models.ClientServices.EnrolmentInformation;
namespace Disco.Services
{
public static class MeasurementUnitExtensions
{
private const ulong kilobyte = 1024ul;
private const ulong megabyte = kilobyte * 1024ul;
private const ulong gigabyte = megabyte * 1024ul;
private const ulong terabyte = gigabyte * 1024ul;
private const ulong maxbit = 9223372036854775807ul;
private const ulong kilobit = 1000ul;
private const ulong megabit = kilobit * 1000ul;
private const ulong gigabit = megabit * 1000ul;
private const uint gigahertz = 1000u;
public static string ByteSizeToFriendly(ulong bytes)
{
if (bytes >= terabyte)
{
return $"{(double)bytes / terabyte:N2} TB";
}
if (bytes >= gigabyte)
{
return $"{(double)bytes / gigabyte:N2} GB";
}
if (bytes >= megabyte)
{
return $"{(double)bytes / megabyte:N2} MB";
}
if (bytes >= kilobyte)
{
return $"{(double)bytes / kilobyte:N2} KB";
}
return $"{bytes:N0} B";
}
public static string SpeedPacketBitsToFriendly(ulong speed)
{
if (speed == maxbit || speed == 0)
return "Unknown";
if (speed >= gigabit)
{
if (speed % gigabit == 0)
return $"{(double)speed / gigabit:N0} Gbps";
else
return $"{(double)speed / gigabit:N2} Gbps";
}
if (speed >= megabit)
{
if (speed % megabit == 0)
return $"{(double)speed / megabit:N0} Mbps";
else
return $"{(double)speed / megabit:N2} Mbps";
}
if (speed >= kilobit)
{
if (speed % kilobit == 0)
return $"{(double)speed / kilobit:N0} Kbps";
else
return $"{(double)speed / kilobit:N2} Kbps";
}
return $"{speed:N0} Bps";
}
public static string SpeedMegahertzToFriendly(uint speed)
{
if (speed >= gigahertz)
{
if (speed % gigahertz == 0)
return $"{(double)speed / gigahertz:N0} GHz";
else
return $"{(double)speed / gigahertz:N2} GHz";
}
return $"{speed:N0} MHz";
}
public static string SizeFriendly(this DiskDrive diskDrive) => ByteSizeToFriendly(diskDrive.Size);
public static string SizeFriendly(this DiskDrivePartition partition) => ByteSizeToFriendly(partition.Size);
public static string SizeFriendly(this DiskLogical disk) => ByteSizeToFriendly(disk.Size);
public static string FreeSpaceFriendly(this DiskLogical disk) => ByteSizeToFriendly(disk.FreeSpace);
public static string SpeedFriendly(this NetworkAdapter networkAdapter) => SpeedPacketBitsToFriendly(networkAdapter.Speed);
public static string CapacityFriendly(this PhysicalMemory physicalMemory) => ByteSizeToFriendly(physicalMemory.Capacity);
public static string MaxClockSpeedFriendly(this Processor processor) => SpeedMegahertzToFriendly(processor.MaxClockSpeed);
}
}
+41 -12
View File
@@ -7,7 +7,7 @@
background-color: #fff;
}
.tableData > tbody > tr:nth-child(odd) > td {
background-color: #fbfbfb;
background-color: hsl(0, 0%, 98.5%);
}
.tableData > thead > tr > th,
.tableData > tbody > tr > th {
@@ -15,7 +15,7 @@
border: solid 1px #f4f4f4;
}
.tableData > tbody > tr:hover > td {
background-color: #f9f9f9;
background-color: hsl(0, 0%, 97.5%);
}
.tableData > tfoot > tr > th,
.tableData > tfoot > tr > td {
@@ -201,7 +201,7 @@
}
#Device_Show_Policies_Profile_Actions_Update_Dialog ul li:nth-child(odd),
#Device_Show_Policies_Batch_Actions_Update_Dialog ul li:nth-child(odd) {
background-color: #fbfbfb;
background-color: hsl(0, 0%, 98.5%);
}
#Device_Show_Policies_Profile_Actions_Update_Dialog ul li.selected,
#Device_Show_Policies_Batch_Actions_Update_Dialog ul li.selected {
@@ -235,7 +235,7 @@
background-color: #fff;
}
#DeviceDetailTab-DetailsContainer > table > tbody > tr:nth-child(odd) > td {
background-color: #fbfbfb;
background-color: hsl(0, 0%, 98.5%);
}
#DeviceDetailTab-DetailsContainer > table > thead > tr > th,
#DeviceDetailTab-DetailsContainer > table > tbody > tr > th {
@@ -243,7 +243,7 @@
border: solid 1px #f4f4f4;
}
#DeviceDetailTab-DetailsContainer > table > tbody > tr:hover > td {
background-color: #f9f9f9;
background-color: hsl(0, 0%, 97.5%);
}
#DeviceDetailTab-DetailsContainer > table > tfoot > tr > th,
#DeviceDetailTab-DetailsContainer > table > tfoot > tr > td {
@@ -253,9 +253,38 @@
width: 150px;
}
#DeviceDetailTab-DetailsContainer > table > tbody > tr > th,
#DeviceDetailTab-DetailsContainer > table > tbody > tr > td {
#DeviceDetailTab-DetailsContainer > table > tbody > tr > td.pad {
padding: 10px 6px;
}
#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition {
position: relative;
height: 40px;
}
#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition > span {
position: absolute;
display: block;
height: 40px;
box-sizing: border-box;
overflow-x: hidden;
overflow-y: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #f4f4f4;
padding: 2px;
line-height: 18px;
border: 1px solid #cacaca;
}
#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition > span .details {
position: relative;
}
#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition > span .freespace {
position: absolute;
top: 0;
height: 40px;
display: block;
background-color: #fff;
background: repeating-linear-gradient(45deg, #f4f4f4, #f4f4f4 10px, #fff 10px, #fff 20px);
}
#deviceShowResources #AttachmentsContainer {
padding: 0;
}
@@ -319,7 +348,7 @@
border: 1px solid #ccc;
}
#deviceShowResources #Attachments div.attachmentOutput > a:hover span.remove {
opacity: .5;
opacity: 0.5;
}
#deviceShowResources #Attachments div.attachmentOutput > a span.remove {
font-size: 1.4em;
@@ -345,7 +374,7 @@
cursor: pointer;
float: right;
border: 1px solid #fff;
padding: .5em;
padding: 0.5em;
}
#deviceShowResources #Attachments div.attachmentInput span.action:hover {
color: #335A87;
@@ -366,14 +395,14 @@
display: none;
}
#Devices_Export #Devices_Export_Fields #Devices_Export_Fields_Defaults {
font-size: .75em;
font-size: 0.75em;
}
#Devices_Export #Devices_Export_Fields th {
font-size: 1.05em;
}
#Devices_Export #Devices_Export_Fields th span {
margin-top: 4px;
font-size: .8em;
font-size: 0.8em;
}
#Devices_Export_Download_Dialog {
padding-top: 20px;
@@ -489,7 +518,7 @@
background-color: #e7f9d5;
}
#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionUnchanged {
background-color: #fbfbfb;
background-color: hsl(0, 0%, 98.5%);
}
#Devices_Import_Review #Devices_Import_Review_TableContainer {
margin: 18px 0;
@@ -518,7 +547,7 @@
content: "\f068";
}
#Devices_Import_Review #Devices_Import_Review_TableContainer table > tbody tr.actionUnchanged td {
background-color: #fbfbfb;
background-color: hsl(0, 0%, 98.5%);
}
#Devices_Import_Review #Devices_Import_Review_TableContainer table > tbody tr.actionUnchanged td:nth-child(n+3) {
color: #ccc;
+34 -1
View File
@@ -215,11 +215,44 @@
width: 150px;
}
& > th, & > td {
& > th, & > td.pad {
padding: 10px 6px;
}
}
}
.device_detail_disk_drives .partition {
position: relative;
height: 40px;
& > span {
position: absolute;
display: block;
height: 40px;
box-sizing: border-box;
overflow-x: hidden;
overflow-y: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #f4f4f4;
padding: 2px;
line-height: 18px;
border: 1px solid #cacaca;
.details {
position: relative;
}
.freespace {
position: absolute;
top: 0;
height: 40px;
display: block;
background-color: #fff;
background: repeating-linear-gradient(45deg, #f4f4f4, #f4f4f4 10px, #fff 10px, #fff 20px);
}
}
}
}
+1 -1
View File
@@ -1 +1 @@
.tableData{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableData>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}.tableData>tbody>tr:nth-child(odd)>td{background-color:#fbfbfb;}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}.tableData>tbody>tr:hover>td{background-color:#f9f9f9;}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#f4f4f4;}.tableDataDark{border:solid 1px #d8d8d8;border-collapse:collapse;}.tableDataDark td{border:solid 1px #d8d8d8;background-color:#fff;}.tableDataDark th{background-color:#eee;border:solid 1px #d8d8d8;}.tableDataContainer{background-color:#fff;}.tableDataVertical{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#f4f4f4;margin:0;padding:0;}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right;}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa;}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right;}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right;}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer;}.subtleUntilHover{-moz-opacity:.3;opacity:.3;}.subtleUntilHover:hover{-moz-opacity:1;opacity:1;}#layout_PageHeading #Device_Show_Status{margin-left:20px;display:inline-block;height:50px;font-family:"Segoe UI",Arial,Verdana,Tahoma,sans-serif;font-weight:lighter;font-stretch:condensed;font-size:.7em;text-transform:uppercase;}#layout_PageHeading #Device_Show_Status span.icon{margin-right:6px;}#Device_Show #Device_Show_Subjects{table-layout:fixed;}#Device_Show #Device_Show_Subjects>tbody>tr>td{padding-top:0;height:100%;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div{position:relative;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div div.status{margin-top:2px;padding-top:2px;border-top:1px dashed #ddd;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div input.discreet{margin-left:-2px;}#Device_Show #Device_Show_Subjects>tbody>tr>td:not(:last-child){border-right:1px dashed #aaa;}#Device_Show #Device_Show_Subjects #Device_Show_Details table.verticalHeadings>tbody>tr>td:first-child{width:104px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Name{font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Enrolled_Trusted{display:inline-block;height:16px;padding-left:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==);background-repeat:no-repeat;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags{font-size:16px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i{cursor:default;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i>.details{display:none;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container{padding-top:4px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container #Device_Show_GenerateDocument{padding:0;}#Device_Show #Device_Show_Subjects #Device_Show_Policies table.verticalHeadings>tbody>tr>td:first-child{width:120px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Aspects #Device_Show_Aspects_Model_Image{display:block;width:256px;height:256px;margin:0 auto;}#Device_Show #Device_Show_Subjects #Device_Show_Subjects_Actions>td{padding-top:4px;}#DeviceDetailTabs{margin-top:10px;border-radius:0;background-image:none;background-color:#fff;border:none;padding:0;}#DeviceDetailTabs #DeviceDetailTabItems{border-radius:0;border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;border-bottom:none;padding:2px 0 0 4px;background-image:none;background-color:#eee;display:table;}#DeviceDetailTabs #DeviceDetailTabItems>li{top:0;border-radius:0;margin:0 5px 0 0;padding:0;line-height:normal;margin-right:4px;}#DeviceDetailTabs #DeviceDetailTabItems>li>a{padding:5px 8pxLine truncated
.tableData{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableData>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}.tableData>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}.tableData>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#f4f4f4;}.tableDataDark{border:solid 1px #d8d8d8;border-collapse:collapse;}.tableDataDark td{border:solid 1px #d8d8d8;background-color:#fff;}.tableDataDark th{background-color:#eee;border:solid 1px #d8d8d8;}.tableDataContainer{background-color:#fff;}.tableDataVertical{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#f4f4f4;margin:0;padding:0;}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right;}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa;}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right;}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right;}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer;}.subtleUntilHover{-moz-opacity:.3;opacity:.3;}.subtleUntilHover:hover{-moz-opacity:1;opacity:1;}#layout_PageHeading #Device_Show_Status{margin-left:20px;display:inline-block;height:50px;font-family:"Segoe UI",Arial,Verdana,Tahoma,sans-serif;font-weight:lighter;font-stretch:condensed;font-size:.7em;text-transform:uppercase;}#layout_PageHeading #Device_Show_Status span.icon{margin-right:6px;}#Device_Show #Device_Show_Subjects{table-layout:fixed;}#Device_Show #Device_Show_Subjects>tbody>tr>td{padding-top:0;height:100%;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div{position:relative;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div div.status{margin-top:2px;padding-top:2px;border-top:1px dashed #ddd;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div input.discreet{margin-left:-2px;}#Device_Show #Device_Show_Subjects>tbody>tr>td:not(:last-child){border-right:1px dashed #aaa;}#Device_Show #Device_Show_Subjects #Device_Show_Details table.verticalHeadings>tbody>tr>td:first-child{width:104px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Name{font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Enrolled_Trusted{display:inline-block;height:16px;padding-left:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==);background-repeat:no-repeat;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags{font-size:16px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i{cursor:default;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i>.details{display:none;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container{padding-top:4px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container #Device_Show_GenerateDocument{padding:0;}#Device_Show #Device_Show_Subjects #Device_Show_Policies table.verticalHeadings>tbody>tr>td:first-child{width:120px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Aspects #Device_Show_Aspects_Model_Image{display:block;width:256px;height:256px;margin:0 auto;}#Device_Show #Device_Show_Subjects #Device_Show_Subjects_Actions>td{padding-top:4px;}#DeviceDetailTabs{margin-top:10px;border-radius:0;background-image:none;background-color:#fff;border:none;padding:0;}#DeviceDetailTabs #DeviceDetailTabItems{border-radius:0;border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;border-bottom:none;padding:2px 0 0 4px;background-image:none;background-color:#eee;display:table;}#DeviceDetailTabs #DeviceDetailTabItems>li{top:0;border-radius:0;margin:0 5px 0 0;padding:0;line-height:normal;margin-right:4px;}#DeviceDetailTabs #DeviceDetailTabItems>li>aLine truncated
@@ -8,22 +8,235 @@
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
var processors = Model.Device.DeviceDetails.Processors();
var physicalMemory = Model.Device.DeviceDetails.PhysicalMemory();
var diskDrives = Model.Device.DeviceDetails.DiskDrives();
var networkAdapters = Model.Device.DeviceDetails.NetworkAdapters();
var lanMacAddress = Model.Device.DeviceDetails.LanMacAddress();
var wlanMacAddress = Model.Device.DeviceDetails.WLanMacAddress();
}
<div id="DeviceDetailTab-Details" class="DevicePart">
<div id="DeviceDetailTab-DetailsContainer">
<table class="tableData">
<tbody>
@if (processors != null)
{
<tr>
<th>Processors</th>
<td class="device_detail_processors">
<table class="tableData">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Architecture</th>
<th>Max Clock Speed</th>
<th>Cores</th>
<th>Logical Processors</th>
</tr>
</thead>
<tbody>
@foreach (var processor in processors)
{
<tr>
<td>@processor.Name</td>
<td>@processor.Description</td>
<td>@processor.Architecture</td>
<td>@processor.MaxClockSpeedFriendly()</td>
<td>@processor.NumberOfCores.ToString("N0")</td>
<td>@processor.NumberOfLogicalProcessors.ToString("N0")</td>
</tr>
}
</tbody>
</table>
</td>
</tr>
}
@if (physicalMemory != null)
{
<tr class="device_detail_memory">
<th>Memory</th>
<td>
<table class="tableData">
<thead>
<tr>
<th>Location</th>
<th>Manufacturer</th>
<th>Part Number</th>
<th>Serial Number</th>
<th>Capacity</th>
<th>Clock Speed</th>
</tr>
</thead>
<tbody>
@foreach (var memory in physicalMemory)
{
<tr>
<td>@memory.DeviceLocator</td>
<td>@memory.Manufacturer</td>
<td>@memory.PartNumber</td>
<td>@memory.SerialNumber</td>
<td>@memory.CapacityFriendly()</td>
<td>@memory.ConfiguredClockSpeed</td>
</tr>
}
</tbody>
</table>
</td>
</tr>
}
@if (networkAdapters != null)
{
<tr class="device_detail_network_adapters">
<th>Network Adapters</th>
<td>
<table class="tableData">
<thead>
<tr>
<th>Connection</th>
<th>Manufacturer</th>
<th>Product</th>
<th>Speed</th>
<th>MAC Address</th>
</tr>
</thead>
<tbody>
@foreach (var adapter in networkAdapters)
{
<tr>
<td>
@(adapter.NetConnectionID ?? "N/A") @if (adapter.IsWlanAdapter)
{<i class="fa fa-wifi"></i>}
</td>
<td>@adapter.Manufacturer</td>
<td>@adapter.ProductName</td>
<td>@adapter.SpeedFriendly()</td>
<td>@adapter.MACAddress</td>
</tr>
}
</tbody>
</table>
</td>
</tr>
}
else
{
if (lanMacAddress != null)
{
<tr>
<th>LAN MAC Address</th>
<td class="code">@(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown")</td>
<td class="pad code">@(lanMacAddress)</td>
</tr>
}
if (wlanMacAddress != null)
{
<tr>
<th>WLAN MAC Address</th>
<td class="code">@(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown")</td>
<td class="pad code">@(wlanMacAddress)</td>
</tr>
}
}
@if (diskDrives != null)
{
<tr class="device_detail_disk_drives">
<th>Disk Drives</th>
<td>
<table class="tableData">
<thead>
<tr>
<th>Manufacturer</th>
<th>Model</th>
<th>Serial Number</th>
<th>Firmware</th>
<th>Type</th>
<th>Interface</th>
<th>Size</th>
</tr>
</thead>
<tbody>
@foreach (var disk in diskDrives)
{
<tr>
<td>@disk.Manufacturer</td>
<td>@disk.Model</td>
<td>@disk.SerialNumber</td>
<td>@disk.FirmwareRevision</td>
<td>@disk.MediaType</td>
<td>@disk.InterfaceType</td>
<td>@disk.SizeFriendly()</td>
</tr>
if (disk.Partitions != null)
{
// calculate stretched offsets
var minPartitionSize = (double)disk.Size * 0.1;
var diskSizeAdjusted = disk.Partitions.Sum(p => Math.Max(minPartitionSize, p.Size));
var diskAdjustedOffet = (double)0;
<tr>
<td colspan="7">
<div class="partition">
@foreach (var partition in disk.Partitions)
{
var logicalDisk = partition.LogicalDisk;
var offsetPercentage = Math.Round(((partition.StartingOffset + diskAdjustedOffet) / diskSizeAdjusted) * 100, 3);
var widthPercentage = Math.Round((Math.Max(minPartitionSize, partition.Size) / diskSizeAdjusted) * 100, 3);
var freeSpacePercentage = 0d;
if (partition.Size < minPartitionSize)
{
diskAdjustedOffet += minPartitionSize - partition.Size;
}
var partitionTitle = partition.Type;
var tags = new List<string>();
if (partition.BootPartition)
{
tags.Add("Boot");
}
if (partition.PrimaryParition)
{
tags.Add("Primary");
}
if (logicalDisk != null)
{
partitionTitle = string.Format("{0} {1}", logicalDisk.DeviceID, logicalDisk.VolumeName);
tags.Add(logicalDisk.SizeFriendly());
tags.Add(logicalDisk.FreeSpaceFriendly() + " Free");
tags.Add(logicalDisk.FileSystem);
tags.Add(logicalDisk.DriveType);
freeSpacePercentage = Math.Round(((double)logicalDisk.FreeSpace / logicalDisk.Size) * 100, 3);
}
else
{
tags.Add(partition.SizeFriendly());
}
var tag = string.Join(" | ", tags);
<span title="@(partitionTitle) &#xA@(tag)" style="left: @(offsetPercentage)%; width: @(widthPercentage)%">
@if (freeSpacePercentage > 0.5)
{
<span class="freespace" style="left: @(100 - freeSpacePercentage)%; width: @(freeSpacePercentage)%"></span>
}
<span class="details">
<strong>@partitionTitle</strong>
<br />
@tag
</span>
</span>
}
</div>
</td>
</tr>
}
}
</tbody>
</table>
</td>
</tr>
}
<tr>
<th>AC Adapter</th>
<td>@if (canConfig)
<td class="pad">
@if (canConfig)
{
@Html.TextBox("DeviceDetail_ACAdapter", Model.Device.DeviceDetails.ACAdapter()) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
<script>
@@ -40,7 +253,8 @@
</tr>
<tr>
<th>Battery</th>
<td>@if (canConfig)
<td class="pad">
@if (canConfig)
{
@Html.TextBox("DeviceDetail_Battery", Model.Device.DeviceDetails.Battery()) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
<script>
@@ -57,7 +271,8 @@
</tr>
<tr>
<th>Keyboard</th>
<td>@if (canConfig)
<td class="pad">
@if (canConfig)
{
@Html.TextBox("DeviceDetail_Keyboard", Model.Device.DeviceDetails.Keyboard()) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
<script>
@@ -72,6 +287,12 @@
}
</td>
</tr>
@if (Model.Device.LastEnrolDate.HasValue)
{
<tr>
<td colspan="2"><em>Details collected @CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate) at time of last enrolment</em></td>
</tr>
}
</tbody>
</table>
</div>
File diff suppressed because it is too large. Load diff