{{template "base/head" .}}
<div class="admin dashboard">
	<div class="ui container">
		<div class="ui grid">
			{{template "admin/navbar" .}}
			<div class="twelve wide column content">
				{{template "base/alert" .}}
				<h4 class="ui top attached header">
					Version 📦
				</h4>
				<div class="ui attached segment">
					<h3>
						{{AppName}}.com - <a href="https://gitlab.com/gitote/gitote/commits/master">v{{AppVer}}</a>
					</h3>
				</div>
				<h4 class="ui top attached header">
					Statistics 📈
				</h4>

				<div class="ui attached table segment">
					<dl class="dl-horizontal admin-dl-horizontal">
						<dt>Users</dt>
						<dd>{{.Stats.Counter.User}}</dd>
						<dt>Organisations</dt>
						<dd>{{.Stats.Counter.Org}}</dd>
						<dt>Public keys</dt>
						<dd>{{.Stats.Counter.PublicKey}}</dd>
						<dt>Repositories</dt>
						<dd>{{.Stats.Counter.Repo}}</dd>
						<dt>Watches</dt>
						<dd>{{.Stats.Counter.Watch}}</dd>
						<dt>Stars</dt>
						<dd>{{.Stats.Counter.Star}}</dd>
						<dt>Actions</dt>
						<dd>{{.Stats.Counter.Action}}</dd>
						<dt>Accesses</dt>
						<dd>{{.Stats.Counter.Access}}</dd>
						<dt>Issues</dt>
						<dd>{{.Stats.Counter.Issue}}</dd>
						<dt>Comments</dt>
						<dd>{{.Stats.Counter.Comment}}</dd>
						<dt>Social accounts</dt>
						<dd>{{.Stats.Counter.Oauth}}</dd>
						<dt>Follows</dt>
						<dd>{{.Stats.Counter.Follow}}</dd>
						<dt>Mirrors</dt>
						<dd>{{.Stats.Counter.Mirror}}</dd>
						<dt>Releases</dt>
						<dd>{{.Stats.Counter.Release}}</dd>
						<dt>Login sources</dt>
						<dd>{{.Stats.Counter.LoginSource}}</dd>
						<dt>Webhooks</dt>
						<dd>{{.Stats.Counter.Webhook}}</dd>
						<dt>Milestones</dt>
						<dd>{{.Stats.Counter.Milestone}}</dd>
						<dt>Labels</dt>
						<dd>{{.Stats.Counter.Label}}</dd>
						<dt>Hook tasks</dt>
						<dd>{{.Stats.Counter.HookTask}}</dd>
						<dt>Teams</dt>
						<dd>{{.Stats.Counter.Team}}</dd>
						<dt>Update tasks</dt>
						<dd>{{.Stats.Counter.UpdateTask}}</dd>
						<dt>Attachments</dt>
						<dd>{{.Stats.Counter.Attachment}}</dd>
					</dl>
				</div>

				<h4 class="ui top attached header">
					Operations 🔨
				</h4>
				<div class="ui unstackable attached table segment">
					<table class="ui unstackable very basic table">
						<tbody>
							<tr>
								<td>Delete all inactive accounts</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=1">Run</a></td>
							</tr>
							<tr>
								<td>Delete all repositories archives</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=2">Run</a></td>
							</tr>
							<tr>
								<td>Delete all repository records that lost Git files</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=3">Run</a></td>
							</tr>
							<tr>
								<td>Do garbage collection on repositories</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=4">Run</a></td>
							</tr>
							<tr>
								<td>Rewrite <b>'.ssh/authorized_keys'</b> file (caution: non-{{AppName}} keys will be lost)</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=5">Run</a></td>
							</tr>
							<tr>
								<td>Resync pre-receive, update and post-receive hooks of all repositories</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=6">Run</a></td>
							</tr>
							<tr>
								<td>Reinitialize all repository records that lost Git files</td>
								<td>👉 <a href="{{AppSubURL}}/admin?op=7">Run</a></td>
							</tr>
						</tbody>
					</table>
				</div>

				<h4 class="ui top attached header">
					System Monitor Status 📺
				</h4>
				<div class="ui attached table segment">
					<dl class="dl-horizontal admin-dl-horizontal">
						<dt>Server Uptime</dt>
						<dd>{{.SysStatus.Uptime}}</dd>
						<dt>Current Goroutines</dt>
						<dd>{{.SysStatus.NumGoroutine}}</dd>
						<div class="ui divider"></div>
						<dt>Current Memory Usage</dt>
						<dd>{{.SysStatus.MemAllocated}}</dd>
						<dt>Total Memory Allocated</dt>
						<dd>{{.SysStatus.MemTotal}}</dd>
						<dt>Memory Obtained</dt>
						<dd>{{.SysStatus.MemSys}}</dd>
						<dt>Pointer Lookup Times</dt>
						<dd>{{.SysStatus.Lookups}}</dd>
						<dt>Memory Allocate Times</dt>
						<dd>{{.SysStatus.MemMallocs}}</dd>
						<dt>Memory Free Times</dt>
						<dd>{{.SysStatus.MemFrees}}</dd>
						<div class="ui divider"></div>
						<dt>Current Heap Usage</dt>
						<dd>{{.SysStatus.HeapAlloc}}</dd>
						<dt>Heap Memory Obtained</dt>
						<dd>{{.SysStatus.HeapSys}}</dd>
						<dt>Heap Memory Idle</dt>
						<dd>{{.SysStatus.HeapIdle}}</dd>
						<dt>Heap Memory In Use</dt>
						<dd>{{.SysStatus.HeapInuse}}</dd>
						<dt>Heap Memory Released</dt>
						<dd>{{.SysStatus.HeapReleased}}</dd>
						<dt>Heap Objects</dt>
						<dd>{{.SysStatus.HeapObjects}}</dd>
						<div class="ui divider"></div>
						<dt>Bootstrap Stack Usage</dt>
						<dd>{{.SysStatus.StackInuse}}</dd>
						<dt>Stack Memory Obtained</dt>
						<dd>{{.SysStatus.StackSys}}</dd>
						<dt>MSpan Structures Usage</dt>
						<dd>{{.SysStatus.MSpanInuse}}</dd>
						<dt>MSpan Structures Obtained</dt>
						<dd>{{.SysStatus.HeapSys}}</dd>
						<dt>MCache Structures Usage</dt>
						<dd>{{.SysStatus.MCacheInuse}}</dd>
						<dt>MCache Structures Obtained</dt>
						<dd>{{.SysStatus.MCacheSys}}</dd>
						<dt>Profiling Bucket Hash Table Obtained</dt>
						<dd>{{.SysStatus.BuckHashSys}}</dd>
						<dt>GC Metadata Obtained</dt>
						<dd>{{.SysStatus.GCSys}}</dd>
						<dt>Other System Allocation Obtained</dt>
						<dd>{{.SysStatus.OtherSys}}</dd>
						<div class="ui divider"></div>
						<dt>Next GC Recycle</dt>
						<dd>{{.SysStatus.NextGC}}</dd>
						<dt>Since Last GC Time</dt>
						<dd>{{.SysStatus.LastGC}}</dd>
						<dt>Total GC Pause</dt>
						<dd>{{.SysStatus.PauseTotalNs}}</dd>
						<dt>Last GC Pause</dt>
						<dd>{{.SysStatus.PauseNs}}</dd>
						<dt>GC Times</dt>
						<dd>{{.SysStatus.NumGC}}</dd>
					</dl>
				</div>
			</div>
		</div>
	</div>
</div>
{{template "base/footer" .}}
