<loader loading="loading"></loader>
<div class="inventory-overview">
  <div class="row column no-padding">
    <h1>Hardware status</h1>
    <div class="page-header">
      <h2 class="inline h4">All hardware in the system</h2>
      <a ng-href="data:text/json;charset=utf-8,{{originalData}}" class="inline btn-export float-right"  download="export_inventory.json" ng-show="hardwares.length">Export</a>

    </div>
  </div>
  <section class="row column">
    <!-- search -->
    <p class="content-label" aria-label="hardware filter">Filter hardware components</p>
    <div class="content__search">
      <label for="content__search-input">Search</label> <input id="content__search-input" type="text"
        ng-model="customSearch" ng-keydown="doSearchOnEnter($event)"/>
      <div class="search-submit__wrapper">
        <button class="clear-input" ng-click="clear()">&#10005;</button>
        <input id="content__search-submit" type="submit" class="btn btn-primary content__search-submit" value="Filter" ng-click="doSearchOnClick()"/>
      </div>

    </div>

  </section>
  <!-- end search -->
  <section id="inventory-categories" class="row column">
    <div class="row column header-row">
      <div class="column large-12 header__actions-bar">
        <div class="inline inventory__heading inventory__device-col">Hardware</div>
        <div class="inline inventory__heading inventory__function-col">&nbsp;</div>
        <div class="inline inventory__heading inventory__assoc-event"><!--Associated events--></div>
      </div>
    </div>
    <div ng-repeat="inventory in hardwares|filter:filterBySearchTerms" class="inventory__group"  ng-class="{'active': inventory.expanded}" ng-click="inventory.expanded = ! inventory.expanded">
      <p class="inline inventory__device-col">{{inventory.title}}</p>
      <p class="inline inventory__function-col"></p>
      <p class="inline inventory__assoc-event"><!--<a href="#/server-health/event-log">View 3 events</a>--></p>
      <button class="accord-trigger float-right" ng-class="{'active': inventory.expanded}"></button>
      <div class="row inventory__metadata" ng-class="{'active': inventory.expanded}" ng-click="$event.stopPropagation()">
        <div class="column large-9 no-padding">
          <div  ng-repeat="item in inventory.items" class="inline inventory__metadata-block">
            <p class="content-label">{{item.key}}</p>
            <p class="courier-bold">{{item.value}}</p>
          </div>
        </div>
        <div class="column large-3 no-padding" ng-show="inventory.sub_components.length">
          <div class="inventory__metadata-scroll show-scroll"> <!-- If content overflows; add 'show-scroll' class via JS to force visible scrollbar in webkit browsers-->
            <div class="content-label">Subcomponents</div>
            <div ng-repeat="sub_component in inventory.sub_components" class="inline inventory__metadata-block" ng-if="sub_component.Present">
              <p class="courier-bold">{{sub_component.title}}<span class="icon icon__warning" ng-if="!sub_component.Functional"></span></p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</div>