<loader loading="loading"></loader>
<div class="overview">
	<div class="row column">
		<h1 class="inline">{{dataService.hostname}}</h1>
		<button class="link" ng-click="edit_server_name = !edit_server_name">edit</button><!-- this is default name. Will show custom server name if set -->
	</div>
	<section class="row">
		<div class="column large-8">
			<!-- Server Metadata -->
			<div class="row overview__server-metadata">
				<div class="column large-4">
					<h3 class="bold h4">Server information</h3>
				</div>
				<div class="column large-8">
					<ul class="overview__metadata-wrapper">
						<li class="overview__metadata-block">
							<p class="content-label">Model</p>
							<p class="courier-bold">{{bmc_info.Model}}</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">Manufacturer</p>
							<p class="courier-bold">{{bmc_info.Manufacturer}}</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">Firmware version</p>
							<p class="courier-bold">{{server_firmware}}</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">Serial number</p>
							<p class="courier-bold">{{bmc_info.SerialNumber}}</p>
						</li>
					</ul>
				</div>
			</div>
			<!-- BMC Metadata -->
			<div class="row overview__server-metadata">
				<div class="column large-4">
					<h3 class="bold h4">BMC information</h3>
				</div>
				<div class="column large-8">
					<ul class="overview__metadata-wrapper">
						<li class="overview__metadata-block">
							<p class="content-label">Hostname</p>
							<p class="courier-bold overview__hostname">{{dataService.hostname}}</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">BMC IP address</p>
							<p class="courier-bold">{{dataService.server_id}}</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">Firmware Version</p>
							<p class="courier-bold">{{bmc_firmware}}</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">Mac address</p>
							<p class="courier-bold">{{dataService.mac_address}}</p>
						</li>
					</ul>
				</div>
			</div>
			<!-- Power metadata -->
			<div class="row overview__server-metadata">
				<div class="column large-4">
					<h3 class="bold h4">Power information</h3>
				</div>
				<div class="column large-8">
					<ul class="overview__metadata-wrapper">
						<li class="overview__metadata-block">
							<p class="content-label">Power Consumption</p>
							<p class="courier-bold">000 W</p>
						</li>
						<li class="overview__metadata-block">
							<p class="content-label">Power Cap</p>
							<p class="courier-bold">000 W</p>
						</li>
					</ul>
				</div>
			</div>
			<!-- Power metadata -->
		</div>
		<div class="column large-4 no-padding">
			<div class="quick-links">
				<a href="#/server-health/event-log/high" class="quick-links__item quick-links__events event-log__events" ng-show="logs.length">
					<p class="inline quick-links__event-copy">{{logs.length}} High priority events</p><!-- link to event log filtered to the high priority events -->
				</a>
				<div class="quick-links__item no-icon">
					<p class="inline quick-links__label">BMC time</p>
					<p class="inline courier-bold float-right">3:20:12 5/22/2017 UTC</p>
				</div>
				<div class="quick-links__item no-icon">
					<p class="inline quick-links__label">Turn <span ng-if="dataService.LED_state == 'off'">on</span><span ng-if="dataService.LED_state == 'on'">off</span> server indicator</p>
					<div class="toggle inline float-right">
						<input id="toggle__switch-round"
								class="toggle-switch toggle-switch__round-flat"
								type="checkbox"
								tabindex="0"
								ng-click="toggleLED()"
								ng-checked="dataService.LED_state == 'on'"
								ng-disabled="dataService.server_unreachable">
						<label for="toggle__switch-round" tabindex="0">Server LED is <span class="uid-switch__status">{{dataService.LED_state}}</span></label>
					</div>
				</div>
				<a href="#/server-control/remote-console" class="no-icon quick-links__item">
					<p class="inline quick-links__label">Serial Over Lan</p>
					<span class="btn-pop-out inline float-right"></span>
				</a>
				<a href="#/configuration/network" class="quick-links__item">
					<p class="inline quick-links__label">Edit network settings</p>
				</a>
			</div>
		</div>
	</section>
	<section class="row">
		<div class="column large-12 overview__event-log event-log__events" ng-show="logs.length">
			<div class="page-header">
				<h3 class="bold h4 inline">High priority events ({{logs.length}})</h3>
				<a href="#/server-health/event-log/" class="inline float-right">View all event logs</a>
			</div>

			<!-- single event -->
			<a href="#/server-health/event-log/high" ng-repeat="event in logs|orderBy:'+Id'">
				<div class="row column event-log__single-event">
					<div class="row">
						<div class="column small-1 large-1 event-log__col-check">
							<label class="control-check">
								<input type="checkbox" name="events__check" ng-click="event.selected= ! event.selected"
										ng-checked="event.selected"/>
								<span class="control__indicator"></span>
							</label>
						</div>
						<div class="column small-9 large-10 event-log__event-info" ng-click=""><!-- click will go to specific event in event log page-->
							<p class="inline event__id">#{{event.Id}}</p>
							<p class="inline event__priority high-priority">High</p>
							<p class="inline event__severity high-priority">{{event.severity_code}}</p>
							<p class="inline event__timestamp">{{event.Timestamp| date:'MM/dd/yyyy  HH:mm:ss '+tmz: tmz}}</p>
							<div>
								<p class="inline event__description">{{event.Severity}}</p>
							</div>
						</div>
						<div class="column small-1 large-1">
							<button class="accord-trigger" aria-hidden="true"></button>
						</div>
					</div>
				</div>
			</a>
		</div>

		<div class="row column overview__event-log event-log__events" ng-show="!logs.length">
			<div class="page-header">
				<h3 class="bold h4">High priority events (0)</h3>
			</div>
			<p>There are no high priority events to display at this time.</p>
		</div>
	</section>
</div>
<!-- edit server name modal -->
<section class="modal" aria-hidden="true" aria-labelledby="modalTitle" aria-describedby="modalDescription" role="dialog" ng-class="{'active': edit_server_name}">
	<div class="modal__upload" role="document">
		<div class="screen-reader-offscreen modal-description">Edit server name</div><!-- accessibility only; used for screen readers -->
		<div class="page-header ">
			<h1 class="modal-title h4"><span class="icon icon__info"><svg xmlns="http://www.w3.org/2000/svg"
					viewBox="0 0 32 32"><path
					d="M18 14h-6v2h1v6h-2v2h8v-2h-2z"/><circle cx="16" cy="10" r="2"/><path
					d="M16 2C8.269 2 2 8.269 2 16s6.269 14 14 14 14-6.269 14-14S23.731 2 16 2zm0 26C9.383 28 4 22.617 4 16S9.383 4 16 4s12 5.383 12 12-5.383 12-12 12z"/></svg></span>
				Edit server name
			</h1>
		</div>
		<div class="modal__content">
			<p>The server name is displayed in the header and can contain any characters up to a total of 64</p>
			<form>
				<label for="editServerName" class="hide"></label>
				<input id="editServerName" class="modal__edit-server-name" maxlength="64" type="text" ng-model="char_count" ng-trim="false">
				<p class="modal__char-count">{{64 - char_count.length}}/64</p>
			</form>
		</div>
		<div class="modal__button-wrapper">
			<button class="inline btn-secondary" ng-click="edit_server_name= false;">Cancel</button>
			<button class="inline btn-primary" ng-click="">Save</button>
		</div>
	</div>
</section>
<div class="modal-overlay" tabindex="-1" ng-class="{'active': edit_server_name}"></div>