<commit_before>//- @todo Remove code duplication for the VMs listing by using a macro.
.sub-bar
  .grid
    .grid-cell.overview
      //- Stats
      i(tooltip="{{xo.pools.length}} pools")
        i.small {{xo.pools.length}}x
        | &nbsp;
        i.xo-icon-pool
      | &nbsp;
      | &nbsp;
      i(tooltip="{{hosts.length}} hosts")
        i.small {{hosts.length}}x
        | &nbsp;
        i.xo-icon-host
      | &nbsp;
      | &nbsp;
      i(tooltip="{{xo.$running_VMs.length}} of {{VMs.length}} VMs running")
        i.small {{xo.$running_VMs.length}}x
        | &nbsp;
        i.xo-icon-vm
      | &nbsp;
      | &nbsp;
      i(tooltip="{{xo.$vCPUs}} vCPUs used of {{xo.$CPUs}} CPUs")
        i.small {{xo.$vCPUs}}x
        | &nbsp;
        i.xo-icon-cpu
      | &nbsp;
      | &nbsp;
      i(tooltip="{{xo.$memory.usage | bytesToSize}} RAM allocated of {{xo.$memory.size | bytesToSize}}")
        i.small {{xo.$memory.usage | bytesToSize}}
        | &nbsp;
        i.xo-icon-memory
    .grid-cell
      .btn-group.before-action-bar.dropdown
        a.btn.navbar-btn.btn-default.dropdown-toggle.inversed
          input.inverse(type="checkbox", ng-model="master_selection", ng-change="selectVMs(master_selection)", ui-indeterminate="!(all || none)", stop-event="click")
          | &nbsp;
          i.fa.fa-caret-down
        ul.dropdown-menu.inverse(role="menu")
          li(ng-repeat="power_state in ['Halted', 'Running']")
            a(ng-click="selectVMs({power_state: power_state})")
              i.fa-fw(class="xo-icon-{{power_state | lowercase}}")
              |  {{power_state}}
          li.divider
          li(ng-repeat="host in hosts | orderBy:natural('name_label') track by host.UUID", ng-if="host.VMs.length")
            a(ng-click="selectVMs({$container: host.ref})")
              i.xo-icon-host.fa-fw
              |  On {{host.name_label}}
      .action-bar(ng-if="!none")
        | &nbsp;
        .btn-group
          button.btn.navbar-btn.btn-default.inversed(tooltip="Stop VM", type="button", ng-click="bulkAction('stopVM')")
            i.fa.fa-stop
          button.btn.navbar-btn.btn-default.inversed(tooltip="Start VM", type="button", ng-click="bulkAction('startVM')")
            i.fa.fa-play
          button.btn.navbar-btn.btn-default.inversed(tooltip="Reboot VM", type="button", ng-click="bulkAction('rebootVM')")
            i.fa.fa-refresh
        | &nbsp;
        .btn-group.dropdown
          button.btn.navbar-btn.btn-default.dropdown-toggle.inversed(tooltip="Migrate VM", type="button")
            i.fa.fa-share
              | &nbsp;
            i.fa.fa-caret-down
          ul.dropdown-menu.inverse(role="menu")
            li(ng-repeat="host in hosts | orderBy:natural('name_label') track by host.UUID")
              a(ng-click="bulkAction('migrateVM',host.UUID)")
                i.xo-icon-host.fa-fw
                |  To {{host.name_label}}
        | &nbsp;
        .btn-group.dropdown
          button.btn.navbar-btn.btn-default.dropdown-toggle.inversed(type="button")
            | More
            | &nbsp;
            i.fa.fa-caret-down
          ul.dropdown-menu.inverse(role="menu")
            li
              a(ng-click="bulkAction('force_rebootVM')")
                i.fa.fa-bolt.fa-fw
                |  Force reboot
            li
              a(ng-click="bulkAction('force_stopVM')")
                i.fa.fa-power-off.fa-fw
                |  Force shutdown
            li.divider
            li
              a(ng-click="bulkAction('snapshotVM')")
                i.xo-icon-snapshot.fa-fw
                |  Take a snapshot
            li
              a(ng-click="deleteVMs()")
                i.fa.fa-trash-o.fa-fw
                |  Delete

//- FIXME: Ugly trick to force the pools to be under the sub bar.
//- Add +7px to the 50px for having some space before the first pool.
div(style="margin-top: 57px; visibility: hidden; height: 0") .

//- If we haven't any data
div(ng-if="!pools.length")
  .grid
    .grid-cell.flat-panel.text-center
      h1 Welcome on Xen Orchestra!
      h3 It seems you aren't connected to any Xen host.
      p You can add any XAPI capable server by clicking on the menu icon "
          i.fa.fa-th
          | " and choose "
          i.fa.fa-cog
          |  Settings"

      p Enjoy Xen Orchestra!
      p
        a.btn.btn-primary.big(ui-sref="about")
          i.fa.fa-info-circle
          |  About us
//- If we have data
div(ng-if="pools.length")
  //- Contains a pool and all its children (hosts).
  .grid.pool-block(ng-repeat="pool in pools | orderBy:natural('name_label') track by pool.UUID")
    //- Pseudo pool if it is not a named pool.
    //- .grid-cell.grid--gutters.pool-cell(ng-if="!pool.name_label")
    //-   p.center(style="margin-top: 2em;") No pool connected
    //- Contains information about the pool if it is a named pool.
    .grid-cell.grid--gutters.pool-cell
      //- Header (name + dropdown menu).
      .dropdown.dropdown-pool
        a.pool-name(ui-sref="pools_view({id: pool.UUID})")
          span(ng-if="pool.name_label")
            | {{pool.name_label}}
          span.text-muted(ng-if="!pool.name_label")
            | {{(pool.master | resolve).name_label}}
        a.dropdown-toggle
          | &nbsp;
          i.fa.fa-caret-down.big-caret
        ul.dropdown-menu.left(role="menu")
          li
            a(xo-click="new_sr()")
              i.xo-icon-sr.fa-fw
              |  Add SR
          li
            a(xo-sref="VMs_new({container: pool.UUID})")
              i.xo-icon-vm.fa-fw
              |  Create VM
          //- TODO: solve the "a" problem for ng-file-select
          li(ng-file-select="patchPool($files, pool.UUID)")
            a
              i.fa.fa-file-code-o.fa-fw
              |  Patch
          li.divider
          li
            a.disabled(xo-click="pool_disconnect(pool.UUID)")
              i.fa.fa-unlink.fa-fw
              |  Disconnect
      //- /Header.
      //- Stats & SRs list.
      div
        //- Stats.
        ul.list-unstyled.stats
          li
            i(tooltip="{{pool.hosts.length}} hosts connected")
              i.small {{pool.hosts.length}}x
              | &nbsp;
              i.xo-icon-host
              | &nbsp;
              | &nbsp;
            i(tooltip="{{pool.$running_VMs.length}} of {{pool.$VMs.length}} VMs running")
              i.small {{pool.$running_VMs.length}}x
              | &nbsp;
              i.xo-icon-vm
          li(ng-if="pool.master", ng-init="master = (pool.master | resolve)")
            | Master:
            | &nbsp;
            a(ui-sref="hosts_view({id: master.UUID})") {{master.name_label}}
          li(ng-if="!pool.master") No master
        //- /Stats.
        //- SRs.
        div(ng-if="pool.SRs.length")
          p.center.small-caps SRs:
          table.table.table-hover.table-condensed
            tr(ng-repeat="SR in pool.SRs | resolve | orderBy:natural('name_label') track by SR.UUID", xo-sref="SRs_view({id: SR.UUID})")
              td.col-md-6.sr-name.no-border(ng-class="{'default-sr': SR.ref === pool.default_SR}", title="{{SR.name_label}}")
                i.xo-icon-sr
                |  {{SR.name_label}}
              td.col-md-6.right.no-border<commit_msg>remove ng init when possible<commit_after>//- @todo Remove code duplication for the VMs listing by using a macro.
.sub-bar
  .grid
    .grid-cell.overview
      //- Stats
      i(tooltip="{{xo.pools.length}} pools")
        i.small {{xo.pools.length}}x
        | &nbsp;
        i.xo-icon-pool
      | &nbsp;
      | &nbsp;
      i(tooltip="{{hosts.length}} hosts")
        i.small {{hosts.length}}x
        | &nbsp;
        i.xo-icon-host
      | &nbsp;
      | &nbsp;
      i(tooltip="{{xo.$running_VMs.length}} of {{VMs.length}} VMs running")
        i.small {{xo.$running_VMs.length}}x
        | &nbsp;
        i.xo-icon-vm
      | &nbsp;
      | &nbsp;
      i(tooltip="{{xo.$vCPUs}} vCPUs used of {{xo.$CPUs}} CPUs")
        i.small {{xo.$vCPUs}}x
        | &nbsp;
        i.xo-icon-cpu
      | &nbsp;
      | &nbsp;
      i(tooltip="{{xo.$memory.usage | bytesToSize}} RAM allocated of {{xo.$memory.size | bytesToSize}}")
        i.small {{xo.$memory.usage | bytesToSize}}
        | &nbsp;
        i.xo-icon-memory
    .grid-cell
      .btn-group.before-action-bar.dropdown
        a.btn.navbar-btn.btn-default.dropdown-toggle.inversed
          input.inverse(type="checkbox", ng-model="master_selection", ng-change="selectVMs(master_selection)", ui-indeterminate="!(all || none)", stop-event="click")
          | &nbsp;
          i.fa.fa-caret-down
        ul.dropdown-menu.inverse(role="menu")
          li(ng-repeat="power_state in ['Halted', 'Running']")
            a(ng-click="selectVMs({power_state: power_state})")
              i.fa-fw(class="xo-icon-{{power_state | lowercase}}")
              |  {{power_state}}
          li.divider
          li(ng-repeat="host in hosts | orderBy:natural('name_label') track by host.UUID", ng-if="host.VMs.length")
            a(ng-click="selectVMs({$container: host.ref})")
              i.xo-icon-host.fa-fw
              |  On {{host.name_label}}
      .action-bar(ng-if="!none")
        | &nbsp;
        .btn-group
          button.btn.navbar-btn.btn-default.inversed(tooltip="Stop VM", type="button", ng-click="bulkAction('stopVM')")
            i.fa.fa-stop
          button.btn.navbar-btn.btn-default.inversed(tooltip="Start VM", type="button", ng-click="bulkAction('startVM')")
            i.fa.fa-play
          button.btn.navbar-btn.btn-default.inversed(tooltip="Reboot VM", type="button", ng-click="bulkAction('rebootVM')")
            i.fa.fa-refresh
        | &nbsp;
        .btn-group.dropdown
          button.btn.navbar-btn.btn-default.dropdown-toggle.inversed(tooltip="Migrate VM", type="button")
            i.fa.fa-share
              | &nbsp;
            i.fa.fa-caret-down
          ul.dropdown-menu.inverse(role="menu")
            li(ng-repeat="host in hosts | orderBy:natural('name_label') track by host.UUID")
              a(ng-click="bulkAction('migrateVM',host.UUID)")
                i.xo-icon-host.fa-fw
                |  To {{host.name_label}}
        | &nbsp;
        .btn-group.dropdown
          button.btn.navbar-btn.btn-default.dropdown-toggle.inversed(type="button")
            | More
            | &nbsp;
            i.fa.fa-caret-down
          ul.dropdown-menu.inverse(role="menu")
            li
              a(ng-click="bulkAction('force_rebootVM')")
                i.fa.fa-bolt.fa-fw
                |  Force reboot
            li
              a(ng-click="bulkAction('force_stopVM')")
                i.fa.fa-power-off.fa-fw
                |  Force shutdown
            li.divider
            li
              a(ng-click="bulkAction('snapshotVM')")
                i.xo-icon-snapshot.fa-fw
                |  Take a snapshot
            li
              a(ng-click="deleteVMs()")
                i.fa.fa-trash-o.fa-fw
                |  Delete

//- FIXME: Ugly trick to force the pools to be under the sub bar.
//- Add +7px to the 50px for having some space before the first pool.
div(style="margin-top: 57px; visibility: hidden; height: 0") .

//- If we haven't any data
div(ng-if="!pools.length")
  .grid
    .grid-cell.flat-panel.text-center
      h1 Welcome on Xen Orchestra!
      h3 It seems you aren't connected to any Xen host.
      p You can add any XAPI capable server by clicking on the menu icon "
          i.fa.fa-th
          | " and choose "
          i.fa.fa-cog
          |  Settings"

      p Enjoy Xen Orchestra!
      p
        a.btn.btn-primary.big(ui-sref="about")
          i.fa.fa-info-circle
          |  About us
//- If we have data
div(ng-if="pools.length")
  //- Contains a pool and all its children (hosts).
  .grid.pool-block(ng-repeat="pool in pools | orderBy:natural('name_label') track by pool.UUID")
    //- Pseudo pool if it is not a named pool.
    //- .grid-cell.grid--gutters.pool-cell(ng-if="!pool.name_label")
    //-   p.center(style="margin-top: 2em;") No pool connected
    //- Contains information about the pool if it is a named pool.
    .grid-cell.grid--gutters.pool-cell
      //- Header (name + dropdown menu).
      .dropdown.dropdown-pool
        a.pool-name(ui-sref="pools_view({id: pool.UUID})")
          span(ng-if="pool.name_label")
            | {{pool.name_label}}
          span.text-muted(ng-if="!pool.name_label")
            | {{(pool.master | resolve).name_label}}
        a.dropdown-toggle
          | &nbsp;
          i.fa.fa-caret-down.big-caret
        ul.dropdown-menu.left(role="menu")
          li
            a(xo-click="new_sr()")
              i.xo-icon-sr.fa-fw
              |  Add SR
          li
            a(xo-sref="VMs_new({container: pool.UUID})")
              i.xo-icon-vm.fa-fw
              |  Create VM
          //- TODO: solve the "a" problem for ng-file-select
          li(ng-file-select="patchPool($files, pool.UUID)")
            a
              i.fa.fa-file-code-o.fa-fw
              |  Patch
          li.divider
          li
            a.disabled(xo-click="pool_disconnect(pool.UUID)")
              i.fa.fa-unlink.fa-fw
              |  Disconnect
      //- /Header.
      //- Stats & SRs list.
      div
        //- Stats.
        ul.list-unstyled.stats
          li
            i(tooltip="{{pool.hosts.length}} hosts connected")
              i.small {{pool.hosts.length}}x
              | &nbsp;
              i.xo-icon-host
              | &nbsp;
              | &nbsp;
            i(tooltip="{{pool.$running_VMs.length}} of {{pool.$VMs.length}} VMs running")
              i.small {{pool.$running_VMs.length}}x
              | &nbsp;
              i.xo-icon-vm
          li(ng-if="pool.master")
            | Master:
            | &nbsp;
            a(ui-sref="hosts_view({id: (pool.master | resolve).UUID})") {{(pool.master | resolve).name_label}}
        //- /Stats.
        //- SRs.
        div(ng-if="pool.SRs.length")
          p.center.small-caps SRs:
          table.table.table-hover.table-condensed
            tr(ng-repeat="SR in pool.SRs | resolve | orderBy:natural('name_label') track by SR.UUID", xo-sref="SRs_view({id: SR.UUID})")
              td.col-md-6.sr-name.no-border(ng-class="{'default-sr': SR.ref === pool.default_SR}", title="{{SR.name_label}}")
                i.xo-icon-sr
                |  {{SR.name_label}}
              td.col-md-6.right.no-border
{'fraction_non_alphanumeric': 0.15715674024711926, 'fraction_numerical': 0.0015271414688324309, 'mean_word_length': 1.7045241223953445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6783756', 'n_tokens_mistral': 4854, 'n_tokens_neox': 4755, 'n_words': 807}