<h1>Dynamic Shovel: <b><%= fmt_string(shovel.name) %></b><%= fmt_maybe_vhost(shovel.vhost) %></h1>

<div class="section">
  <h2>Overview</h2>
  <div class="hider">
    <table class="facts">
      <tr>
        <th>Source</th>
        <td><%= fmt_string(fmt_uri_with_credentials(shovel.value['src-uri'])) %></td>
      </tr>
      <tr>
        <th> </th>
        <td><%= fmt_shovel_endpoint('src-', shovel.value) %></td>
      </tr>
      <tr>
        <th>Destination</th>
        <td><%= fmt_string(fmt_uri_with_credentials(shovel.value['dest-uri'])) %></td>
      </tr>
      <tr>
        <th> </th>
        <td><%= fmt_shovel_endpoint('dest-', shovel.value) %></td>
      </tr>
      <tr>
        <th>Prefetch count</th>
        <td><%= fmt_string(fallback_value(shovel, 'src-prefetch-count', 'prefetch-count')) %></td>
      </tr>
      <tr>
        <th>Reconnect delay</th>
        <td><%= fmt_time(shovel.value['reconnect-delay'], 's') %></td>
      </tr>
      <tr>
        <th>Add headers</th>
        <td><%= fmt_boolean(fallback_value(shovel, 'dest-add-forward-headers', 'add-forward-headers')) %></td>
      </tr>
      <tr>
        <th>Ack mode</th>
        <td><%= fmt_string(shovel.value['ack-mode']) %></td>
      </tr>
      <tr>
        <th>Auto-delete</th>
        <td><%= fmt_string(fallback_value(shovel, 'src-delete-after', 'delete-after')) %></td>
      </tr>
    </table>
  </div>
</div>


  <div class="section-hidden">
  <h2>Delete this shovel</h2>
  <div class="hider">
    <% if (!is_internal_shovel(shovel.value)) { %>
      <form action="#/shovel-parameters" method="delete" class="confirm">
        <input type="hidden" name="component" value="shovel"/>
        <input type="hidden" name="vhost" value="<%= fmt_string(shovel.vhost) %>"/>
        <input type="hidden" name="name" value="<%= fmt_string(shovel.name) %>"/>
        <input type="submit" value="Delete this shovel"/>
      </form>
    <% } else { %>
      <% if (shovel_has_internal_owner(shovel.value)) { %>
        <span>This shovel is internal and owned by <%= fmt_resource_link(shovel_internal_owner(shovel.value)) %>. Could be deleted only via CLI command with --force.</span>
      <% } else { %>
        <span>This shovel is internal. Could be deleted only via CLI command with '--force'.</span>
      <% } %>
    <% } %>
  </div>
  </div>
