From 7a8cbe11a6e79faff46c0dd2825a000734fcbb91 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 1 Feb 2023 17:25:39 +0100 Subject: [PATCH 1/6] fix --- .../resources/device/templates/devices/layout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/device/templates/devices/layout.html b/ereuse_devicehub/resources/device/templates/devices/layout.html index a9509915..3a31902c 100644 --- a/ereuse_devicehub/resources/device/templates/devices/layout.html +++ b/ereuse_devicehub/resources/device/templates/devices/layout.html @@ -116,8 +116,8 @@ {{ component.created.strftime('%H:%M %d-%m-%Y') }}

- {{ component.manufacturer }}
- {{ component.model }}
+ {{ component.manufacturer or '- not detected -' }}
+ {{ component.model or '- not detected -' }}

{% if component.type in ['RamModule', 'HardDrive', 'SolidStateDrive'] %} From 184a9877bc4cebee02e0c34b10cd6e1f37f30da1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 2 Feb 2023 11:02:36 +0100 Subject: [PATCH 2/6] fix footer --- .../device/templates/devices/layout.html | 81 ++++++++++++++----- .../templates/ereuse_devicehub/base_site.html | 4 +- .../ereuse_devicehub/user_login.html | 4 +- 3 files changed, 64 insertions(+), 25 deletions(-) diff --git a/ereuse_devicehub/resources/device/templates/devices/layout.html b/ereuse_devicehub/resources/device/templates/devices/layout.html index 3a31902c..f71806c0 100644 --- a/ereuse_devicehub/resources/device/templates/devices/layout.html +++ b/ereuse_devicehub/resources/device/templates/devices/layout.html @@ -1,7 +1,44 @@ -{% extends "ereuse_devicehub/base.html" %} -{% block page_title %}Device {{ device.dhid }}{% endblock %} + + + + + + + + Device {{ device_real.dhid }} - Usody + + + + + + + + + + + + + + + + + + + + + + + + + + + -{% block body %}
@@ -159,23 +196,25 @@
-
-
-
-
- -
- Help | - Privacy | - Terms -
-
- DeviceHub -
-
+
+
+
+
+ +
+ Help | + Privacy | + Terms +
+
+ DeviceHub +
+
+
-
-{% endblock body%} + + + diff --git a/ereuse_devicehub/templates/ereuse_devicehub/base_site.html b/ereuse_devicehub/templates/ereuse_devicehub/base_site.html index f3865433..f6dfb1b3 100644 --- a/ereuse_devicehub/templates/ereuse_devicehub/base_site.html +++ b/ereuse_devicehub/templates/ereuse_devicehub/base_site.html @@ -309,8 +309,8 @@
Help | - Privacy | - Terms + Privacy | + Terms
DeviceHub {{ version }} diff --git a/ereuse_devicehub/templates/ereuse_devicehub/user_login.html b/ereuse_devicehub/templates/ereuse_devicehub/user_login.html index 78776b16..b8b6cbc0 100644 --- a/ereuse_devicehub/templates/ereuse_devicehub/user_login.html +++ b/ereuse_devicehub/templates/ereuse_devicehub/user_login.html @@ -71,8 +71,8 @@
Help | - Privacy | - Terms + Privacy | + Terms
From 5f9abe83d666cf87f371de4152abf118ad5cb3c5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 23 Feb 2023 17:13:16 +0100 Subject: [PATCH 3/6] change version of usody iso to 14.2.0 --- ereuse_devicehub/workbench/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/workbench/__init__.py b/ereuse_devicehub/workbench/__init__.py index 70ac8a85..ea44bae3 100644 --- a/ereuse_devicehub/workbench/__init__.py +++ b/ereuse_devicehub/workbench/__init__.py @@ -8,7 +8,7 @@ isos = { 'url': 'https://releases.usody.com/2022/', }, "erease": { - 'iso': "USODY_14.0.0.iso", + 'iso': "USODY_14.2.0.iso", 'url': 'https://releases.usody.com/v14/', }, } From c9d23d5e6adb00af418ba905cb629672903f904d Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 23 Feb 2023 17:14:21 +0100 Subject: [PATCH 4/6] benchamark to False in wbSettings template --- ereuse_devicehub/templates/workbench/wbSettings.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/templates/workbench/wbSettings.ini b/ereuse_devicehub/templates/workbench/wbSettings.ini index 213240c1..53bbc34d 100644 --- a/ereuse_devicehub/templates/workbench/wbSettings.ini +++ b/ereuse_devicehub/templates/workbench/wbSettings.ini @@ -7,7 +7,7 @@ DH_HOST = {{ api_host }} DH_DATABASE = {{ schema }} DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/ -WB_BENCHMARK = True +WB_BENCHMARK = False WB_STRESS_TEST = 0 WB_SMART_TEST = short @@ -21,7 +21,7 @@ DH_HOST = {{ api_host }} DH_DATABASE = {{ schema }} DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/ -WB_BENCHMARK = True +WB_BENCHMARK = False WB_STRESS_TEST = 0 WB_SMART_TEST = short From fb413671fcb04629ed8d498e4042d303ff5c66c8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Sat, 25 Feb 2023 11:29:41 +0100 Subject: [PATCH 5/6] fix size of ram and data storage --- ereuse_devicehub/resources/device/models.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 566d7d85..d406d808 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -1047,16 +1047,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: From ddcd1697e6adfa5d392dd70bbdf5a145f2ca032c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 14 Mar 2023 17:52:49 +0100 Subject: [PATCH 6/6] fix template --- ereuse_devicehub/templates/inventory/erasure.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/templates/inventory/erasure.html b/ereuse_devicehub/templates/inventory/erasure.html index 06ad6943..024e782e 100644 --- a/ereuse_devicehub/templates/inventory/erasure.html +++ b/ereuse_devicehub/templates/inventory/erasure.html @@ -288,10 +288,10 @@ {% for erasure in erasures %} - {{ erasure.device.serial_number.upper() }} + {{ erasure.device.serial_number and erasure.device.serial_number.upper() or '' }} - {{ erasure.parent.serial_number.upper() }} + {{ erasure.parent.serial_number and erasure.parent.serial_number.upper() or '' }} {{ erasure.get_public_name() }}