1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #3028: Fix pci table for 1 element, remove table columns

This commit is contained in:
Carlos Martín 2015-08-27 16:55:35 +02:00
parent 5c7e6291aa
commit 6dd908baf4
2 changed files with 11 additions and 7 deletions

View File

@ -52,11 +52,19 @@ define(function(require) {
*/
function _html() {
var pcis = [];
if(this.element.HOST_SHARE &&
this.element.HOST_SHARE.PCI_DEVICES &&
this.element.HOST_SHARE.PCI_DEVICES.PCI){
$.each(this.element.HOST_SHARE.PCI_DEVICES.PCI, function(){
pcis = this.element.HOST_SHARE.PCI_DEVICES.PCI;
if (!$.isArray(pcis)){ // If only 1 convert to array
pcis = [pcis];
}
$.each(pcis, function(){
if(this.VMID == "-1"){
this.VMID = "";
}
@ -64,7 +72,7 @@ define(function(require) {
}
return TemplateHTML({
'element': this.element,
'pcis': pcis,
'panelId': this.panelId
});
}

View File

@ -6,20 +6,16 @@
<th>{{tr "VM"}}</th>
<th>{{tr "PCI Address"}}</th>
<th>{{tr "Type"}}</th>
<th>{{tr "Class"}}</th>
<th>{{tr "Name"}}</th>
<th>{{tr "Vendor"}}</th>
</tr>
</thead>
<tbody>
{{#each element.HOST_SHARE.PCI_DEVICES.PCI}}
{{#each pcis}}
<tr>
<td>{{VMID}}</td>
<td>{{SHORT_ADDRESS}}</td>
<td>{{TYPE}}</td>
<td>{{CLASS_NAME}}</td>
<td>{{DEVICE_NAME}}</td>
<td>{{VENDOR_NAME}}</td>
</tr>
{{/each}}
</tbody>