@Init{
	$this->RegisterJSFile("services/statusService.js");
	$this->RegisterJSFile("controllers/status.js");
	$this->RegisterJSFile("directives/googleChart.js");
}@
@Title{Server Status}@
@CSS{
	button{
		padding:3px;
		font-weight:bold;
		font-size:1.5em;
	}

	.refreshControl{
		margin:5px;
	}
}@
@Body{
<div ng-controller="status">
	<div ng-if="haveUptime">
		<h3>Uptime</h3>
		{{uptime.days}} days, {{uptime.hours}} hours and {{uptime.minutes}} minutes
	</div>
	<div ng-if="haveSystemInfo">
		<h3>Load</h3>
		<div class="refreshControl">
			<button ng-click="changeSystemInfoRefreshInterval(-1)" equal-width>-</button>
			<input type="number" ng-model="systemInfoRefreshInterval" min="1" />
			<button ng-click="changeSystemInfoRefreshInterval(1)" equal-width>+</button>
		</div>
		<table class="alternatingRows">
			<tr><td>1 min avg</td><td>{{load[0] * 100| number: 0}}% ({{(load[0] / 4)*100 | number: 0}}% core avg)<div class="percentageBar"><div style="width:{{(load[0] / 4) * 100}}%"></div></div></td></tr>
			<tr><td>5 min avg</td><td>{{load[1] * 100| number: 0}}% ({{(load[1] / 4)*100 | number: 0}}% core avg)<div class="percentageBar"><div style="width:{{(load[1] / 4) * 100}}%"></div></div></td></tr>
			<tr><td>15 min avg</td><td>{{load[2] * 100| number: 0}}% ({{(load[2] / 4)*100 | number: 0}}% core avg)<div class="percentageBar"><div style="width:{{(load[2] / 4) * 100}}%"></div></div></td></tr>
			<tr><td>CPU Temp</td><td>{{cpuTemp| number: 0}}&deg;C<div class="percentageBar"><div style="width:{{(cpuTemp / 90) * 100}}%"></div></td></tr>
			<tr><td>RAM</td><td>{{memory.free / 1024| number: 2}}MB free of {{memory.total / 1024| number: 2}}MB ({{memory.used| number: 0}}% used)<div class="percentageBar"><div style="width:{{memory.used}}%"></div></td></tr>
		</table>
		<google-chart data="chartData" curveType="function" legend-position="top"></google-chart>
	</div>
	<h3>Disc Space</h3>
	<table class="alternatingRows">
		<?php foreach ($disks as $disk) {?>
			<tr><td><?=$disk->Disk?></td><td><?=$disk->FreeSpace?> of <?=$disk->TotalSpace?> remaining (<?=$disk->PercentageUsed?>% used)<div class="percentageBar"><div style="width:<?=$disk->PercentageUsed?>%"></div></td></tr>
		<?php }?>
	</table>
	<div ng-if="haveProcesses">
		<h3>Process List</h3>
		<div class="refreshControl">
			<button ng-click="changeProcesRefreshInterval(-1)" equal-width>-</button>
			<input type="number" ng-model="processRefreshInterval" min="1" />
			<button ng-click="changeProcesRefreshInterval(1)" equal-width>+</button>
		</div>
		<table id="processTable" class="alternatingRows">
			<tr>
				<th ng-repeat="header in processes.headers">{{header}}</th>
			</tr>
			<tr ng-repeat="data in processes.data"><td ng-repeat="col in data">{{col}}</td></tr>
		</table>
	</div>
</div>
}@