<div ng-if="submenuNavItem == 'preview'">
	<md-content flex class="agentsPreview" ng-controller="agentsPreviewController" layout="column" style="height: 100%;" class="md-padding" layout-align="start space-around">
			<div infinite-scroll-module='agents.nextPage()' infinite-scroll-disabled='agents.busy' infinite-scroll-distance='0' style="padding: 0">
				<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
					<div flex layout="column" layout-align="space-between stretch">
						<div layout="row" layout-align="space-between stretch">
							<md-card flex class="cardHover" layout="column" style="margin-left: 0px;" ng-click="applyAgent(lastAgent)">
								<md-card-content style="text-align: center;">
									<div class="metric-value ng-binding" style="font-size: 16pt;">{{lastAgent.name}}</div>
									<div class="ng-binding">Last registered agent</div>
								</md-card-content>
							</md-card>
							
							<md-card flex layout="column" class="cardHover">
								<md-card-content style="text-align: center;" ng-click="applyAgent(mostActiveAgent)">
									<div class="metric-value ng-binding" style="font-size: 16pt;">{{mostActiveAgent.name}}</div>
									<div class="ng-binding">Higher activity</div>
								</md-card-content>
							</md-card>
							
							<md-card flex="10" layout="column">
								<md-card-content style="text-align: center;">
									<div class="metric-value ng-binding" style="font-size: 16pt;">{{agentsCountActive}}</div>
									<div class="ng-binding">Active</div>
								</md-card-content>
							</md-card>
							
							<md-card flex="10" layout="column">
								<md-card-content style="text-align: center;">
									<div class="metric-value ng-binding" style="font-size: 16pt;">{{agentsCountDisconnected}}</div>
									<div class="ng-binding">Disconnected</div>
								</md-card-content>
							</md-card>
							
							<md-card flex="10" layout="column">
								<md-card-content style="text-align: center;">
									<div class="metric-value ng-binding" style="font-size: 16pt;">{{agentsCountNeverConnected}}</div>
									<div class="ng-binding">Never connected</div>
								</md-card-content>
							</md-card>
							
							<md-card flex="10" layout="column"  style="margin-right: 0px;">
								<md-card-content style="text-align: center;">
									<div class="metric-value ng-binding" style="font-size: 16pt;">{{(agentsCoverity | number:2)}}%</div>
									<div class="ng-binding">Agents coverage</div>
								</md-card-content>
							</md-card>
							 
						</div>
						<div layout="row" layout-align="start stretch">

							<div layout="row" class="sideNavBox" flex="80">

								<input placeholder="Filter" type="text" id="searchBox" ng-model="$parent._agentSearch" ng-change="agentSearchFilter($parent._agentSearch)" class="input-filter-box"
									flex>
							</div>
							<div layout="row" class="sideNavBox" flex="20">
								<md-input-container flex class="md-whiteframe-z1">
									<md-select id="eventBox" ng-model="$parent._status" ng-change="agentStatusFilter($parent._status)" aria-label="Filter by status">
										<md-option value="all">All</md-option>
										<md-option value="active">Active</md-option>
										<md-option value="disconnected">Disconnected</md-option>
										<md-option value="Never Connected">Never connected</md-option>
									</md-select>
								</md-input-container>
							</div>
						</div>
						<div>
							<md-toolbar layout="row">
								<div class="md-toolbar-tools">
									<span flex="10" ng-click="setSort('id')">ID
										<i class="fa" ng-class="_sort === 'id' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span>
									<span flex="30" ng-click="setSort('name')">Name
										<i class="fa" ng-class="_sort === 'name' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span>
									<span flex="30" ng-click="setSort('ip')">IP
										<i class="fa" ng-class="_sort === 'ip' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span>
									<span flex="30" ng-click="setSort('status')">Status
										<i class="fa" ng-class="_sort === 'status' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span>
								</div>
							</md-toolbar>
						</div>
					</div>
					<md-list ng-repeat='agent in agents.items' class="agents-preview-table" ng-click="applyAgent(agent)">
						<md-list-item>
							<span flex="10">{{agent.id}}</span>
							<span flex="30">{{agent.name}}</span>
							<span flex="30">{{agent.ip}}</span>
							<span flex="20">{{agent.status}}</span>
							<span flex="10"> <span ng-class="getAgentStatusClass(agent.status)" class="round status"></span></span>
						</md-list-item>
					</md-list>
					<md-divider></md-divider>
			</div>
			<md-content><md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="agents.busy"></md-progress-linear></md-content>
	</md-content>
</div>