Merge branch 'testing' into new-trublo

This commit is contained in:
Cayo Puigdefabregas 2023-03-15 17:57:16 +01:00
commit 7dc7ca2026
3 changed files with 22 additions and 10 deletions

View File

@ -1303,16 +1303,18 @@ class Computer(Device):
@property
def ram_size(self) -> int:
"""The total of RAM memory the computer has."""
return sum(
ram.size or 0 for ram in self.components if isinstance(ram, RamModule)
)
components = self.components
if self.placeholder and self.placeholder.binding:
components = self.placeholder.binding.components
return sum(ram.size or 0 for ram in components if isinstance(ram, RamModule))
@property
def data_storage_size(self) -> int:
"""The total of data storage the computer has."""
return sum(
ds.size or 0 for ds in self.components if isinstance(ds, DataStorage)
)
components = self.components
if self.placeholder and self.placeholder.binding:
components = self.placeholder.binding.components
return sum(ds.size or 0 for ds in components if isinstance(ds, DataStorage))
@property
def processor_model(self) -> str:

View File

@ -23,6 +23,16 @@
padding-top: 0px;
padding-bottom: 5px;
}
#ApplyDeviceLots {
color: #993365;
font-weight: bold;
}
#ApplyDeviceLots.disabled {
color: #adb5bd;
font-weight: normal;
pointer-events: none;
background-color: #fff;
}
.help {
color: #993365;
}

View File

@ -288,10 +288,10 @@
{% for erasure in erasures %}
<tr style="border-bottom: 1px dashed #000;">
<td>
{{ erasure.device.serial_number.upper() }}
{{ erasure.device.serial_number and erasure.device.serial_number.upper() or '' }}
</td>
<td>
{{ erasure.parent.serial_number.upper() }}
{{ erasure.parent.serial_number and erasure.parent.serial_number.upper() or '' }}
</td>
<td>
{{ erasure.get_public_name() }}
@ -320,14 +320,14 @@
<dt>Computer where was erase:</dt>
<dd>Title: {{ erasure.parent.__format__('ts') }}</dd>
<dd>DevicehubID: {{ erasure.parent.dhid }}</dd>
<dd>Hid: {{ erasure.parent.hid }}</dd>
<dd>Hid: {{ erasure.parent.chid }}</dd>
<dd>Tags: {{ erasure.parent.tags }}</dd>
{% if erasure.device.parent %}
<dt>Computer where it resides:</dt>
<dd>Title: {{ erasure.device.parent.__format__('ts') }}</dd>
<dd>DevicehubID: {{ erasure.device.parent.dhid }}</dd>
<dd>Hid: {{ erasure.device.parent.hid }}</dd>
<dd>Hid: {{ erasure.device.parent.chid }}</dd>
<dd>Tags: {{ erasure.device.parent.tags }}</dd>
{% endif %}
{% endif %}