<!--
  This file is part of IVRE.
  Copyright 2011 - 2015 Pierre LALET <pierre.lalet@cea.fr>

  IVRE is free software: you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  IVRE is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
  License for more details.

  You should have received a copy of the GNU General Public License
  along with IVRE. If not, see <http://www.gnu.org/licenses/>.
-->

<table>
  <tr ng-repeat="summary in ::host.port_summary | orderBy: 'status'">
    <td>
      <span>
	{{::summary.count}} port{{::summary.count > 1 && "s" || ""}}
      </span>
    </td>
    <td>
      <span class="label label-status"
	    ng-class="class_from_port_status(summary.status)">
	{{::short_port_status(summary.status) | uppercase}}
      </span>
    </td>
    <td>
      <span ng-if="::summary.type == 'extra'"
	    ng-repeat="(reason, count) in ::summary.reasons">
	{{::count}} {{::reason}}<span ng-if="!$last">, </span></span>
      <span ng-if="::summary.type == 'ports'"
	    ng-repeat="port in ::summary.ports | orderBy: ['protocol','port']"
	    ><!--
     --><a ng-click="setparam(port.protocol + '/' + port.port)"
	   ng-class="{highlight: wanted_port(summary.status, port.protocol, port.port)}"
	   class="clickable">
	  {{::port.protocol}}/{{::port.port}}</a><span ng-if="!$last">, </span>
      </span>
    </td>
  </tr>
</table>
