fix(node_info): hide GPU Details and GPU Fans when no GPU is present
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:
parent
f754331c3a
commit
bbfeb24983
@ -391,6 +391,7 @@ Ext.define('PVE.node.StatusView', {
|
|||||||
this.hide();
|
this.hide();
|
||||||
return '';
|
return '';
|
||||||
} else if (!gpuStats || !gpuStats.Graphics) {
|
} else if (!gpuStats || !gpuStats.Graphics) {
|
||||||
|
this.hide();
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,9 +509,12 @@ Ext.define('PVE.node.StatusView', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
html += '</table>';
|
html += '</table>';
|
||||||
return html.indexOf('<tr>') > 0
|
if (html.indexOf('<tr>') <= 0) {
|
||||||
? '<div style="padding-left: 20px; box-sizing: border-box;">' + html + '</div>'
|
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();
|
this.hide();
|
||||||
return '';
|
return '';
|
||||||
} else if (!gpuStats || !gpuStats.Graphics || !gpuStats.Graphics.NVIDIA) {
|
} else if (!gpuStats || !gpuStats.Graphics || !gpuStats.Graphics.NVIDIA) {
|
||||||
|
this.hide();
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -892,8 +897,10 @@ Ext.define('PVE.node.StatusView', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (rows.length === 0) {
|
if (rows.length === 0) {
|
||||||
|
this.hide();
|
||||||
return '';
|
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>';
|
return '<div style="padding-left: 20px; box-sizing: border-box;"><table style="width: 100%; border-collapse: collapse; table-layout: fixed;">' + rows.join('') + '</table></div>';
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user