<commit_before>.grid
  .grid-cell.flat-panel
    p.page-title
      i.xo-icon-vm(class="xo-color-{{VM.power_state | lowercase}}")
      |  {{VM.name_label}}
.grid
  .grid-cell.flat-panel
    p.flat-panel-title
      i.fa.fa-cogs(style="color: #e25440;")
      |  General
      span.quick-edit(tooltip="Edit General settings", ng-click="vmSettings.$show()")
        i.fa.fa-edit.fa-fw
    .general-properties
      form(editable-form="", name="vmSettings", onbeforesave="saveVM($data)")
        dl.dl-horizontal
          dt Name
          dd
            span(editable-text="VM.name_label", e-name="name_label", e-form="vmSettings")
              | {{VM.name_label}}
          dt Description
          dd
            span(editable-text="VM.name_description", e-name="name_description", e-form="vmSettings")
              | {{VM.name_description}}
          dt(ng-if="VM.power_state == ('Running' || 'Paused')") Running on:
          dt(ng-if="VM.power_state == ('Halted')") Resident on:
          dd(ng-repeat="container in [VM.$container] | resolve")
            span(ng-if = 'container.type === "host"')
              a(xo-sref="hosts_view({id: container.UUID})")
                | {{container.name_label}}
              small
                span(ng-if="(container.poolRef | resolve).name_label")
                  | (
                  a(ui-sref="pools_view({id: (container.poolRef | resolve).UUID})") {{(container.poolRef | resolve).name_label}}
                  | )
            a(
              ng-if = 'container.type === "pool"'
              xo-sref="pools_view({id: container.UUID})"
            )
              | {{container.name_label}}
          dt(ng-if="VM.addresses") Address
          dd(ng-repeat="IP in VM.addresses") {{IP}}
          span(ng-if="(VM.poolRef | resolve).HA_enabled")
            dt HA
            dd
              span(editable-checkbox="VM.high_availability", e-name="high_availability", e-form="vmSettings")
                | {{VM.high_availability}}
          dt Tags
          dd
          dt vCPUs
          dd
            span(editable-text="VM.CPUs.number", e-name="CPUs", e-form="vmSettings")
              | {{VM.CPUs.number}}
          dt RAM
          dd
            span(editable-text="memorySize", e-name="memory", e-form="vmSettings")
              | {{memorySize}}
          dt UUID
          dd {{VM.UUID}}
        .btn-form(ng-show="vmSettings.$visible")
          p.center
            button.btn.btn-default(type="button", ng-disabled="vmSettings.$waiting", ng-click="vmSettings.$cancel()")
              i.fa.fa-times
              |  Cancel
            | &nbsp;
            button.btn.btn-primary(type="submit", ng-disabled="vmSettings.$waiting")
              i.fa.fa-save
              |  Save
  .grid-cell.flat-panel
    p.flat-panel-title
      i.fa.fa-bar-chart-o(style="color: #e25440;")
      |  Stats
    .grid
      .grid-cell
        p.stat-name vCPUs
        p.center.big {{VM.CPUs.number}}
      .grid-cell
        p.stat-name RAM
        p.center.big {{VM.memory.size | bytesToSize}}
      .grid-cell
        p.stat-name Disks
        p.center.big {{VM.$VBDs.length || 0}}
    br
    .grid
      .grid-cell(ng-if="VM.os_version.distro")
        p.stat-name OS:
        p.center.big
          i(class="xo-icon-{{osType(VM.os_version.distro)}}",tooltip="{{VM.os_version.name}}", style="color: black;")
      .grid-cell
        p.stat-name Xen tools:
        p.center
          span(ng-if="VM.PV_drivers", style="color:green;") Installed
          span(ng-if="!VM.PV_drivers") NOT installed
//- Action panel
.grid
  .grid-cell.flat-panel
    p.flat-panel-title
      i.fa.fa-flash(style="color: #e25440;")
      |  Actions
    .grid-cell.text-center
      .grid
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Stop VM", type="button", style="width: 90%", xo-click="stopVM(VM.UUID)")
            i.fa.fa-stop.fa-2x.fa-fw
        .grid-cell.btn-group(ng-if="VM.power_state == ('Halted')")
          button.btn(tooltip="Start VM", type="button", style="width: 90%", xo-click="startVM(VM.UUID)")
            i.fa.fa-play.fa-2x.fa-fw
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Reboot VM", type="button", style="width: 90%", xo-click="rebootVM(VM.UUID)")
            i.fa.fa-refresh.fa-2x.fa-fw
        .grid-cell.btn-group.dropdown(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn.dropdown-toggle(tooltip="Migrate VM", type="button", style="width: 90%", data-toggle="dropdown")
            i.fa.fa-share.fa-2x.fa-fw
            <span class="caret"></span>
          ul.dropdown-menu.left(role="menu")
            li(ng-repeat="host in hosts | orderBy:natural('name_label') track by host.UUID")
              a(ng-click="migrateVM(VM.UUID, host.UUID)")
                i.xo-icon-host.fa-fw
                | To {{host.name_label}}
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Force Reboot", type="button", style="width: 90%", xo-click="force_rebootVM(VM.UUID)")
            i.fa.fa-flash.fa-2x.fa-fw
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Force Shutdown", type="button", style="width: 90%", xo-click="force_stopVM(VM.UUID)")
            i.fa.fa-power-off.fa-2x.fa-fw
        .grid-cell.btn-group
          button.btn(tooltip="Delete VM", type="button", style="width: 90%", xo-click="destroyVM(VM.UUID)")
            i.fa.fa-trash-o.fa-2x.fa-fw
        .grid-cell.btn-group.dropdown
          button.btn.dropdown-toggle(tooltip="Create a clone", style="width: 90%", type="button", data-toggle="dropdown")
            i.fa.fa-files-o.fa-2x.fa-fw
            <span class="caret"></span>
          ul.dropdown-menu.left(role="menu")
            li
              a(ng-click="cloneVM(VM.UUID,VM.name_label,false)")
                i.fa.fa-code-fork.fa-fw
                | Fast clone<commit_msg>only display clone button if the VM is halted<commit_after>.grid
  .grid-cell.flat-panel
    p.page-title
      i.xo-icon-vm(class="xo-color-{{VM.power_state | lowercase}}")
      |  {{VM.name_label}}
.grid
  .grid-cell.flat-panel
    p.flat-panel-title
      i.fa.fa-cogs(style="color: #e25440;")
      |  General
      span.quick-edit(tooltip="Edit General settings", ng-click="vmSettings.$show()")
        i.fa.fa-edit.fa-fw
    .general-properties
      form(editable-form="", name="vmSettings", onbeforesave="saveVM($data)")
        dl.dl-horizontal
          dt Name
          dd
            span(editable-text="VM.name_label", e-name="name_label", e-form="vmSettings")
              | {{VM.name_label}}
          dt Description
          dd
            span(editable-text="VM.name_description", e-name="name_description", e-form="vmSettings")
              | {{VM.name_description}}
          dt(ng-if="VM.power_state == ('Running' || 'Paused')") Running on:
          dt(ng-if="VM.power_state == ('Halted')") Resident on:
          dd(ng-repeat="container in [VM.$container] | resolve")
            span(ng-if = 'container.type === "host"')
              a(xo-sref="hosts_view({id: container.UUID})")
                | {{container.name_label}}
              small
                span(ng-if="(container.poolRef | resolve).name_label")
                  | (
                  a(ui-sref="pools_view({id: (container.poolRef | resolve).UUID})") {{(container.poolRef | resolve).name_label}}
                  | )
            a(
              ng-if = 'container.type === "pool"'
              xo-sref="pools_view({id: container.UUID})"
            )
              | {{container.name_label}}
          dt(ng-if="VM.addresses") Address
          dd(ng-repeat="IP in VM.addresses") {{IP}}
          span(ng-if="(VM.poolRef | resolve).HA_enabled")
            dt HA
            dd
              span(editable-checkbox="VM.high_availability", e-name="high_availability", e-form="vmSettings")
                | {{VM.high_availability}}
          dt Tags
          dd
          dt vCPUs
          dd
            span(editable-text="VM.CPUs.number", e-name="CPUs", e-form="vmSettings")
              | {{VM.CPUs.number}}
          dt RAM
          dd
            span(editable-text="memorySize", e-name="memory", e-form="vmSettings")
              | {{memorySize}}
          dt UUID
          dd {{VM.UUID}}
        .btn-form(ng-show="vmSettings.$visible")
          p.center
            button.btn.btn-default(type="button", ng-disabled="vmSettings.$waiting", ng-click="vmSettings.$cancel()")
              i.fa.fa-times
              |  Cancel
            | &nbsp;
            button.btn.btn-primary(type="submit", ng-disabled="vmSettings.$waiting")
              i.fa.fa-save
              |  Save
  .grid-cell.flat-panel
    p.flat-panel-title
      i.fa.fa-bar-chart-o(style="color: #e25440;")
      |  Stats
    .grid
      .grid-cell
        p.stat-name vCPUs
        p.center.big {{VM.CPUs.number}}
      .grid-cell
        p.stat-name RAM
        p.center.big {{VM.memory.size | bytesToSize}}
      .grid-cell
        p.stat-name Disks
        p.center.big {{VM.$VBDs.length || 0}}
    br
    .grid
      .grid-cell(ng-if="VM.os_version.distro")
        p.stat-name OS:
        p.center.big
          i(class="xo-icon-{{osType(VM.os_version.distro)}}",tooltip="{{VM.os_version.name}}", style="color: black;")
      .grid-cell
        p.stat-name Xen tools:
        p.center
          span(ng-if="VM.PV_drivers", style="color:green;") Installed
          span(ng-if="!VM.PV_drivers") NOT installed
//- Action panel
.grid
  .grid-cell.flat-panel
    p.flat-panel-title
      i.fa.fa-flash(style="color: #e25440;")
      |  Actions
    .grid-cell.text-center
      .grid
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Stop VM", type="button", style="width: 90%", xo-click="stopVM(VM.UUID)")
            i.fa.fa-stop.fa-2x.fa-fw
        .grid-cell.btn-group(ng-if="VM.power_state == ('Halted')")
          button.btn(tooltip="Start VM", type="button", style="width: 90%", xo-click="startVM(VM.UUID)")
            i.fa.fa-play.fa-2x.fa-fw
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Reboot VM", type="button", style="width: 90%", xo-click="rebootVM(VM.UUID)")
            i.fa.fa-refresh.fa-2x.fa-fw
        .grid-cell.btn-group.dropdown(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn.dropdown-toggle(tooltip="Migrate VM", type="button", style="width: 90%", data-toggle="dropdown")
            i.fa.fa-share.fa-2x.fa-fw
            <span class="caret"></span>
          ul.dropdown-menu.left(role="menu")
            li(ng-repeat="host in hosts | orderBy:natural('name_label') track by host.UUID")
              a(ng-click="migrateVM(VM.UUID, host.UUID)")
                i.xo-icon-host.fa-fw
                | To {{host.name_label}}
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Force Reboot", type="button", style="width: 90%", xo-click="force_rebootVM(VM.UUID)")
            i.fa.fa-flash.fa-2x.fa-fw
        .grid-cell.btn-group(ng-if="VM.power_state == ('Running' || 'Paused')")
          button.btn(tooltip="Force Shutdown", type="button", style="width: 90%", xo-click="force_stopVM(VM.UUID)")
            i.fa.fa-power-off.fa-2x.fa-fw
        .grid-cell.btn-group
          button.btn(tooltip="Delete VM", type="button", style="width: 90%", xo-click="destroyVM(VM.UUID)")
            i.fa.fa-trash-o.fa-2x.fa-fw
        .grid-cell.btn-group.dropdown(ng-if="VM.power_state == ('Halted')")
          button.btn.dropdown-toggle(tooltip="Create a clone", style="width: 90%", type="button", data-toggle="dropdown")
            i.fa.fa-files-o.fa-2x.fa-fw
            <span class="caret"></span>
          ul.dropdown-menu.left(role="menu")
            li
              a(ng-click="cloneVM(VM.UUID,VM.name_label,false)")
                i.fa.fa-code-fork.fa-fw
                | Fast clone
{'fraction_non_alphanumeric': 0.17830670400263549, 'fraction_numerical': 0.006588700378850272, 'mean_word_length': 2.042595840641443, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4642081', 'n_tokens_mistral': 4189, 'n_tokens_neox': 4082, 'n_words': 548}