diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index a0ba0f20..05af6f9b 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -1262,16 +1262,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: diff --git a/ereuse_devicehub/static/css/devicehub.css b/ereuse_devicehub/static/css/devicehub.css index 46fae783..e82af14c 100644 --- a/ereuse_devicehub/static/css/devicehub.css +++ b/ereuse_devicehub/static/css/devicehub.css @@ -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; } diff --git a/ereuse_devicehub/templates/inventory/erasure.html b/ereuse_devicehub/templates/inventory/erasure.html index 06ad6943..681f31a6 100644 --- a/ereuse_devicehub/templates/inventory/erasure.html +++ b/ereuse_devicehub/templates/inventory/erasure.html @@ -288,10 +288,10 @@ {% for erasure in erasures %}