<% if (!window.beaker_current_user) { %>
  <div class="alert alert-info">You are not logged in.</div>
<% } else if (!can_power) { %>
  <div class="alert alert-info">You do not have permission to control this system.</div>
<% } else if (!lab_controller_id) { %>
  <div class="alert alert-info">System is not attached to a lab controller.</div>
<% } else if (!has_power) { %>
  <div class="alert alert-info">System is not configured for power support.</div>
<% } %>
<div class="btn-toolbar">
  <div class="btn-group">
    <button class="btn" type="button"
        <% if (!lab_controller_id || !has_power || !can_power) { %>disabled<% } %>
        data-command="on"
        data-confirmation-text="power the system on">
      Power On
    </button>
    <button class="btn" type="button"
        <% if (!lab_controller_id || !has_power || !can_power) { %>disabled<% } %>
        data-command="off"
        data-confirmation-text="power the system off">
      Power Off
    </button>
    <button class="btn" type="button"
        <% if (!lab_controller_id || !has_power || !can_power) { %>disabled<% } %>
        data-command="reboot"
        data-confirmation-text="reboot the system">
      Reboot
    </button>
    <button class="btn" type="button"
        <% if (!lab_controller_id || !has_power || !can_power) { %>disabled<% } %>
        data-command="interrupt"
        data-confirmation-text="interrupt the system">
      Interrupt
    </button>
  </div>
  <div class="btn-group">
    <button class="btn" type="button"
        <% if (!lab_controller_id || !can_power) { %>disabled<% } %>
        data-command="clear_netboot"
        data-confirmation-text="clear the system's netboot configuration">
      Clear Netboot
    </button>
  </div>
  <span class="btn-group btn-group-text sync-status"></span>
</div>
