From f1f72232ce10c035a990687ec5161e4727a49804 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 13 Apr 2021 13:35:33 +0000 Subject: [server/registration] parse lspci to get gpu info, add additional values in lspci --- server/lib/external-backends/backends/idoit-backend.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'server/lib') diff --git a/server/lib/external-backends/backends/idoit-backend.js b/server/lib/external-backends/backends/idoit-backend.js index ddbab3e..1711c9c 100644 --- a/server/lib/external-backends/backends/idoit-backend.js +++ b/server/lib/external-backends/backends/idoit-backend.js @@ -590,9 +590,8 @@ class IdoitBackend extends ExternalBackends { if (client.cpus) { let counter = 1 for (let cpu of client.cpus) { - // Add KB and TB - if (cpu.unit === 'MB') cpu.unit = 2 - else if (cpu.unit === 'GB') cpu.unit = 3 + if (cpu.unit === 'MHz') cpu.unit = 2 + else if (cpu.unit === 'GHz') cpu.unit = 3 let params = { 'object': client.id, @@ -603,7 +602,7 @@ class IdoitBackend extends ExternalBackends { 'title': cpu.model, 'type': cpu.type, 'frequency': parseFloat(cpu.frequency), - 'frequency_unit': 3, + 'frequency_unit': cpu.unit, 'cores': parseInt(cpu.cores) }, 'apikey': c.apikey @@ -649,11 +648,12 @@ class IdoitBackend extends ExternalBackends { 'objID': client.id, 'category': 'C__CATG__MEMORY', 'data': { - 'title': module.type, + 'title': module.model, 'manufacturer': module.manufacturer, 'type': module.type, 'capacity': parseFloat(module.capacity), - 'unit': module.unit + 'unit': module.unit, + 'description': `Serialnumber: ${module.serialnumber}\nFormfactor: ${module.formfactor}\nSpeed: ${module.speed}` }, 'apikey': c.apikey } @@ -687,6 +687,7 @@ class IdoitBackend extends ExternalBackends { 'category_id': counter, 'title': drive.model, 'type': drive.type, + 'firmware': drive.firmware, // 'manufacturer': , // 'model': , 'capacity': parseFloat(drive.capacity), -- cgit v1.2.3-55-g7522