From d2edc57cda4da452013631beeb10c758df12ee9c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Oct 2021 16:09:03 +0200 Subject: [statistica] Query support etc. --- modules-available/passthrough/page.inc.php | 10 ++-- .../passthrough/templates/hardware-list.html | 22 +------- .../serversetup-bwlp-ipxe/inc/localboot.inc.php | 24 +++++--- .../statistics/inc/hardwareinfo.inc.php | 6 +- .../statistics/inc/hardwareparserlegacy.inc.php | 43 +------------- modules-available/statistics/inc/pciid.inc.php | 36 +++++++----- .../statistics/lang/de/template-tags.json | 1 + .../statistics/lang/en/template-tags.json | 1 + modules-available/statistics/pages/machine.inc.php | 65 +++++++++++++++++----- .../templates/hints-ram-underclocked.html | 2 +- .../statistics/templates/js-pciquery.html | 24 ++++++++ .../statistics/templates/machine-main.html | 30 +++++----- 12 files changed, 142 insertions(+), 122 deletions(-) create mode 100644 modules-available/statistics/templates/js-pciquery.html diff --git a/modules-available/passthrough/page.inc.php b/modules-available/passthrough/page.inc.php index 3ab0696e..7dcc8215 100644 --- a/modules-available/passthrough/page.inc.php +++ b/modules-available/passthrough/page.inc.php @@ -68,6 +68,7 @@ class Page_Passthrough extends Page $q = new HardwareQuery(HardwareInfo::PCI_DEVICE, null, false); $q->addGlobalColumn('vendor'); $q->addGlobalColumn('device'); + $q->addGlobalColumn('rev'); $q->addGlobalColumn('class'); $q->addGlobalColumn('@PASSTHROUGH'); $rows = []; @@ -110,10 +111,11 @@ class Page_Passthrough extends Page $missing[$row['vendor'] . ':' . $row['device']] = true; } } - Render::addTemplate('hardware-list', [ - 'list' => $finalRows, - 'missing_ids' => json_encode(array_keys($missing)), - ]); + Render::addTemplate('hardware-list', ['list' => $finalRows]); + if (!empty($missing)) { + Render::addTemplate('js-pciquery', + ['missing_ids' => json_encode(array_keys($missing))], 'statistics'); + } } /* diff --git a/modules-available/passthrough/templates/hardware-list.html b/modules-available/passthrough/templates/hardware-list.html index d331acb5..4bff0a39 100644 --- a/modules-available/passthrough/templates/hardware-list.html +++ b/modules-available/passthrough/templates/hardware-list.html @@ -18,7 +18,7 @@ {{/class_name}} {{^class_name}} - {{vendor}}:{{device}} + {{vendor}}:{{device}} [{{rev}}] @@ -101,25 +101,5 @@ $(this).append($(' - + diff --git a/modules-available/statistics/templates/js-pciquery.html b/modules-available/statistics/templates/js-pciquery.html new file mode 100644 index 00000000..5d4df867 --- /dev/null +++ b/modules-available/statistics/templates/js-pciquery.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/modules-available/statistics/templates/machine-main.html b/modules-available/statistics/templates/machine-main.html index 0509a646..71df723d 100644 --- a/modules-available/statistics/templates/machine-main.html +++ b/modules-available/statistics/templates/machine-main.html @@ -297,7 +297,7 @@ - + @@ -392,16 +392,26 @@
{lang_speedCurrent}} {{lang_speedDesign}} {{lang_manufacturer}}{{lang_serialNumber}}{{lang_serialNo}}
{{lang_slot}} {{lang_speed}}{{lang_vendor}}{{lang_manufacturer}} {{lang_serialNo}}

{{lang_devices}}

{{#lspci1}} -
{{class}}
+
{{class_s}}
{{#entries}} -
 └ {{ven}} {{dev}}
+
+  └ + {{vendor_s}} + {{device_s}} + [{{vendor}}:{{device}}] +
{{/entries}} {{/lspci1}}
{{#lspci2}} -
{{class}}
+
{{class_s}}
{{#entries}} -
 └ {{ven}} {{dev}}
+
+  └ + {{vendor_s}} + {{device_s}} + [{{vendor}}:{{device}}] +
{{/entries}} {{/lspci2}}
@@ -410,13 +420,3 @@ - -- cgit v1.2.3-55-g7522