fix(node_info): hide GPU Details and GPU Fans when no GPU is present (#311)

Empty graphics payloads currently leave the labelled rows visible with
no content. Hide those widgets unless they can render at least one GPU.
This commit is contained in:
Evan 2026-08-22 23:49:56 +08:00 committed by GitHub
parent f754331c3a
commit 8a9b7568a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -391,6 +391,7 @@ Ext.define('PVE.node.StatusView', {
this.hide();
return '';
} else if (!gpuStats || !gpuStats.Graphics) {
this.hide();
return '';
}
@ -508,9 +509,12 @@ Ext.define('PVE.node.StatusView', {
}
html += '</table>';
return html.indexOf('<tr>') > 0
? '<div style="padding-left: 20px; box-sizing: border-box;">' + html + '</div>'
: '';
if (html.indexOf('<tr>') <= 0) {
this.hide();
return '';
}
this.show();
return '<div style="padding-left: 20px; box-sizing: border-box;">' + html + '</div>';
},
},
{
@ -865,6 +869,7 @@ Ext.define('PVE.node.StatusView', {
this.hide();
return '';
} else if (!gpuStats || !gpuStats.Graphics || !gpuStats.Graphics.NVIDIA) {
this.hide();
return '';
}
@ -892,8 +897,10 @@ Ext.define('PVE.node.StatusView', {
});
if (rows.length === 0) {
this.hide();
return '';
}
this.show();
return '<div style="padding-left: 20px; box-sizing: border-box;"><table style="width: 100%; border-collapse: collapse; table-layout: fixed;">' + rows.join('') + '</table></div>';
},