Revision 6dd908ba

View differences:

src/sunstone/public/app/tabs/hosts-tab/panels/pci.js
52 52
   */
53 53

  
54 54
  function _html() {
55
    var pcis = [];
56

  
55 57
    if(this.element.HOST_SHARE &&
56 58
       this.element.HOST_SHARE.PCI_DEVICES &&
57 59
       this.element.HOST_SHARE.PCI_DEVICES.PCI){
58 60

  
59
      $.each(this.element.HOST_SHARE.PCI_DEVICES.PCI, function(){
61
      pcis = this.element.HOST_SHARE.PCI_DEVICES.PCI;
62

  
63
      if (!$.isArray(pcis)){ // If only 1 convert to array
64
        pcis = [pcis];
65
      }
66

  
67
      $.each(pcis, function(){
60 68
        if(this.VMID == "-1"){
61 69
          this.VMID = "";
62 70
        }
......
64 72
    }
65 73

  
66 74
    return TemplateHTML({
67
      'element': this.element,
75
      'pcis': pcis,
68 76
      'panelId': this.panelId
69 77
    });
70 78
  }
src/sunstone/public/app/tabs/hosts-tab/panels/pci/html.hbs
6 6
          <th>{{tr "VM"}}</th>
7 7
          <th>{{tr "PCI Address"}}</th>
8 8
          <th>{{tr "Type"}}</th>
9
          <th>{{tr "Class"}}</th>
10 9
          <th>{{tr "Name"}}</th>
11
          <th>{{tr "Vendor"}}</th>
12 10
        </tr>
13 11
      </thead>
14 12
      <tbody>
15
        {{#each element.HOST_SHARE.PCI_DEVICES.PCI}}
13
        {{#each pcis}}
16 14
          <tr>
17 15
            <td>{{VMID}}</td>
18 16
            <td>{{SHORT_ADDRESS}}</td>
19 17
            <td>{{TYPE}}</td>
20
            <td>{{CLASS_NAME}}</td>
21 18
            <td>{{DEVICE_NAME}}</td>
22
            <td>{{VENDOR_NAME}}</td>
23 19
          </tr>
24 20
        {{/each}}
25 21
      </tbody>

Also available in: Unified diff