<h1>Channel: <b><%= fmt_escape_html(channel.name) %></b></h1>

<div class="section">
<h2>Overview</h2>
<div class="hider">
<% if (statistics_level == 'fine') { %>
    <%= message_rates('msg-rates-ch', channel.message_stats) %>
<% } %>

<div class="updatable">
<h3>Details</h3>
<table class="facts">
  <tr>
    <th>Connection</th>
    <td><%= link_conn(channel.connection_details.name) %></td>
  </tr>
<% if (nodes_interesting) { %>
  <tr>
    <th>Node</th>
    <td><%= fmt_node(channel.node) %></td>
  </tr>
<% } %>
<% if (vhosts_interesting) { %>
  <tr>
    <th>Virtual host</th>
    <td><%= fmt_string(channel.vhost) %></td>
  </tr>
<% } %>
  <tr>
    <th>Username</th>
    <td><%= fmt_string(channel.user) %></td>
  </tr>
  <tr>
    <th>Mode <span class="help" id="channel-mode"></span></th>
    <td><%= fmt_channel_mode(channel) %></td>
  </tr>
</table>

<table class="facts">
  <tr>
    <th>Prefetch count</th>
    <td><%= channel.prefetch_count %></td>
  </tr>
  <tr>
    <th>Messages unacknowledged</th>
    <td><%= channel.messages_unacknowledged %></td>
  </tr>
  <tr>
    <th>Messages unconfirmed</th>
    <td><%= channel.messages_unconfirmed %></td>
  </tr>
  <tr>
    <th>Messages uncommitted</th>
    <td><%= channel.messages_uncommitted %></td>
  </tr>
  <tr>
    <th>Acks uncommitted</th>
    <td><%= channel.acks_uncommitted %></td>
  </tr>
</table>

<table class="facts">
  <tr>
    <th>Blocked by client</th>
    <td><%= fmt_boolean(channel.client_flow_blocked) %></td>
  </tr>
  <tr>
    <th>Status</th>
    <td><%= fmt_idle_long(channel) %></td>
  </tr>
</table>
</div>

</div>
</div>

<div class="section">
  <h2>Consumers</h2>
  <div class="hider updatable">
<%= format('consumers', {'mode': 'channel', 'consumers': channel.consumer_details}) %>
  </div>
</div>

<% if (statistics_level == 'fine') { %>
<div class="section">
<h2>Message rates breakdown</h2>
<div class="hider updatable">
<table class="two-col-layout">
  <tr>
    <td>
      <%= format('msg-detail-publishes',
                 {'mode':   'channel',
                  'object': channel.publishes,
                  'label':  'Publishes'}) %>
    </td>
    <td>
      <%= format('msg-detail-deliveries',
                 {'mode':   'channel',
                  'object': channel.deliveries}) %>
    </td>
  </tr>
</table>
</div>
</div>
<% } %>
