{{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>
						Gitote - <a href="https://gitote.in/gitote/gitote/commits/master">{{AppVer}}</a>
						<br/>
						API - <a href="{{AppURL}}api/{{APIVer}}/users/gitote">{{APIVer}}</a>
						<br/>
						Git - <a href="https://git-scm.com">{{.GitVersion}}</a>
						<br/>
						GoLang - <a href="https://golang.org">{{GoVer}}</a>
					</h3>
				</div>
				<h4 class="ui top attached header">
					Statistics 📈
				</h4>

				<div class="ui unstackable attached table segment center">
                    <div style="padding:1em" class="ui center large labels grey">
                        <div class="ui label">
							👥 Users <div class="detail">{{.Stats.Counter.User}}</div>
						</div>
						<div class="ui label">
							🏢 Organizations <div class="detail">{{.Stats.Counter.Org}}</div>
						</div>
						<div class="ui label">
							🔑 Public keys <div class="detail">{{.Stats.Counter.PublicKey}}</div>
						</div>
						<div class="ui label">
							📁 Repositories <div class="detail">{{.Stats.Counter.Repo}}</div>
						</div>
						<div class="ui label">
							👀 Watches <div class="detail">{{.Stats.Counter.Watch}}</div>
						</div>
						<div class="ui label">
							🌟 Stars <div class="detail">{{.Stats.Counter.Star}}</div>
						</div>
						<div class="ui label">
							🎬 Actions <div class="detail">{{.Stats.Counter.Action}}</div>
						</div>
						<div class="ui label">
							✋ Accesses <div class="detail">{{.Stats.Counter.Access}}</div>
						</div>
						<div class="ui label">
							📜 Issues <div class="detail">{{.Stats.Counter.Issue}}</div>
						</div>
						<div class="ui label">
							💬 Comments <div class="detail">{{.Stats.Counter.Comment}}</div>
						</div>
						<div class="ui label">
							🔗 Social accounts <div class="detail">{{.Stats.Counter.Oauth}}</div>
						</div>
						<div class="ui label">
							👣 Follows <div class="detail">{{.Stats.Counter.Follow}}</div>
						</div>
						<div class="ui label">
							🤳 Mirrors <div class="detail">{{.Stats.Counter.Mirror}}</div>
						</div>
						<div class="ui label">
							📦 Releases <div class="detail">{{.Stats.Counter.Release}}</div>
						</div>
						<div class="ui label">
							💠 Login sources <div class="detail">{{.Stats.Counter.LoginSource}}</div>
						</div>
						<div class="ui label">
							🎣 Webhooks <div class="detail">{{.Stats.Counter.Webhook}}</div>
						</div>
						<div class="ui label">
							🚧 Milestones <div class="detail">{{.Stats.Counter.Milestone}}</div>
						</div>
						<div class="ui label">
							🏷 Labels <div class="detail">{{.Stats.Counter.Label}}</div>
						</div>
						<div class="ui label">
							🤹 Hook tasks <div class="detail">{{.Stats.Counter.HookTask}}</div>
						</div>
						<div class="ui label">
							😎 Teams <div class="detail">{{.Stats.Counter.Team}}</div>
						</div>
						<div class="ui label">
							🆕 Update tasks <div class="detail">{{.Stats.Counter.UpdateTask}}</div>
						</div>
						<div class="ui label">
							📎 Attachments <div class="detail">{{.Stats.Counter.Attachment}}</div>
						</div>
                    </div>
				</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 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-Gitote 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" .}}
