2018-11-19 02:18:22 +01:00
|
|
|
{{define "admin"}}
|
|
|
|
{{template "header" .}}
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
h2 {font-weight: normal;}
|
|
|
|
ul.pagenav {list-style: none;}
|
2018-11-19 03:58:50 +01:00
|
|
|
form {
|
|
|
|
margin: 0 0 2em;
|
|
|
|
}
|
2018-12-03 23:30:31 +01:00
|
|
|
form dt {
|
|
|
|
line-height: inherit;
|
|
|
|
}
|
2018-11-19 02:18:22 +01:00
|
|
|
.ui.divider:not(.vertical):not(.horizontal) {
|
|
|
|
border-top: 1px solid rgba(34,36,38,.15);
|
|
|
|
border-bottom: 1px solid rgba(255,255,255,.1);
|
|
|
|
}
|
|
|
|
.ui.divider {
|
|
|
|
margin: 1rem 0;
|
|
|
|
line-height: 1;
|
|
|
|
height: 0;
|
|
|
|
font-weight: 700;
|
|
|
|
text-transform: uppercase;
|
|
|
|
letter-spacing: .05em;
|
|
|
|
color: rgba(0,0,0,.85);
|
|
|
|
-webkit-user-select: none;
|
|
|
|
-moz-user-select: none;
|
|
|
|
-ms-user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
font-size: 1rem;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2018-11-19 03:58:50 +01:00
|
|
|
<script>
|
|
|
|
function savePage(el) {
|
|
|
|
var $btn = el.querySelector('input[type=submit]');
|
|
|
|
$btn.value = 'Saving...';
|
|
|
|
$btn.disabled = true;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="content-container snug">
|
|
|
|
<h1>Admin Dashboard</h1>
|
2018-11-19 02:18:22 +01:00
|
|
|
|
|
|
|
{{if .Message}}<p>{{.Message}}</p>{{end}}
|
|
|
|
|
|
|
|
<ul class="pagenav">
|
2018-11-19 03:58:50 +01:00
|
|
|
{{if not .SingleUser}}
|
|
|
|
<li><a href="#page-about">Edit About page</a></li>
|
|
|
|
<li><a href="#page-privacy">Edit Privacy page</a></li>
|
|
|
|
{{end}}
|
|
|
|
<li><a href="#reset-pass">Reset user password</a></li>
|
2018-12-03 23:30:31 +01:00
|
|
|
<li><a href="#config">Configuration</a></li>
|
2018-11-19 02:18:22 +01:00
|
|
|
<li><a href="#monitor">Application monitor</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2018-11-19 03:58:50 +01:00
|
|
|
{{if not .SingleUser}}
|
|
|
|
<h2>Site</h2>
|
|
|
|
|
|
|
|
<h3 id="page-about">About page</h3>
|
2018-11-21 17:12:44 +01:00
|
|
|
<p>Describe what your instance is <a href="/about">about</a>. <em>Accepts Markdown</em>.</p>
|
2018-11-19 03:58:50 +01:00
|
|
|
<form method="post" action="/admin/update/about" onsubmit="savePage(this)">
|
|
|
|
<textarea id="about-editor" class="section codable norm edit-page" name="content">{{.AboutPage}}</textarea>
|
|
|
|
<input type="submit" value="Save" />
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<h3 id="page-privacy">Privacy page</h3>
|
|
|
|
<p>Outline your <a href="/privacy">privacy policy</a>. <em>Accepts Markdown</em>.</p>
|
|
|
|
<form method="post" action="/admin/update/privacy" onsubmit="savePage(this)">
|
|
|
|
<textarea id="privacy-editor" class="section codable norm edit-page" name="content">{{.PrivacyPage}}</textarea>
|
|
|
|
<input type="submit" value="Save" />
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<h2>Users</h2>
|
|
|
|
|
|
|
|
<h3><a name="reset-pass"></a>reset password</h3>
|
|
|
|
<pre><code>writefreely --reset-pass <username></code></pre>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2018-12-03 23:30:31 +01:00
|
|
|
<h2><a name="config"></a>App Configuration</h2>
|
|
|
|
|
|
|
|
{{if .ConfigMessage}}<p class="success" style="text-align: center">{{.ConfigMessage}}</p>{{end}}
|
|
|
|
|
|
|
|
<form action="/admin/update/config" method="post">
|
|
|
|
<div class="ui attached table segment">
|
|
|
|
<dl class="dl-horizontal admin-dl-horizontal">
|
|
|
|
<dt>Site Name</dt>
|
|
|
|
<dd><input type="text" name="site_name" id="site_name" class="inline" value="{{.Config.SiteName}}" style="width: 14em;" /></dd>
|
|
|
|
<dt>Host</dt>
|
|
|
|
<dd>{{.Config.Host}}</dd>
|
|
|
|
<dt>User Mode</dt>
|
|
|
|
<dd>{{if .Config.SingleUser}}Single user{{else}}Multiple users{{end}}</dd>
|
|
|
|
<dt><label for="open_registration">Open Registrations</label></dt>
|
|
|
|
<dd><input type="checkbox" name="open_registration" id="open_registration" {{if .Config.OpenRegistration}}checked="checked"{{end}} /></dd>
|
|
|
|
<dt><label for="min_username_len">Minimum Username Length</label></dt>
|
|
|
|
<dd><input type="number" name="min_username_len" id="min_username_len" class="inline" min="1" max="100" value="{{.Config.MinUsernameLen}}" /></dd>
|
|
|
|
<dt><label for="max_blogs">Maximum Blogs per User</label></dt>
|
|
|
|
<dd><input type="number" name="max_blogs" id="max_blogs" class="inline" min="1" value="{{.Config.MaxBlogs}}" /></dd>
|
|
|
|
<dt><label for="federation">Federation</label></dt>
|
|
|
|
<dd><input type="checkbox" name="federation" id="federation" {{if .Config.Federation}}checked="checked"{{end}} /></dd>
|
|
|
|
<dt><label for="public_stats">Public Stats</label></dt>
|
|
|
|
<dd><input type="checkbox" name="public_stats" id="public_stats" {{if .Config.PublicStats}}checked="checked"{{end}} /></dd>
|
|
|
|
<dt><label for="private">Private Instance</label></dt>
|
|
|
|
<dd><input type="checkbox" name="private" id="private" {{if .Config.Private}}checked="checked"{{end}} /></dd>
|
|
|
|
</dl>
|
|
|
|
<input type="submit" value="Save Configuration" />
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2018-11-19 03:58:50 +01:00
|
|
|
<h2><a name="monitor"></a>Application</h2>
|
|
|
|
|
2018-11-19 02:18:22 +01:00
|
|
|
<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 mem 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 in use</dt>
|
|
|
|
<dd>{{.SysStatus.MSpanInuse}}</dd>
|
|
|
|
<dt>MSpan structures obtained</dt>
|
|
|
|
<dd>{{.SysStatus.HeapSys}}</dd>
|
|
|
|
<dt>MCache structures in use</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</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>
|
2018-11-19 03:58:50 +01:00
|
|
|
|
2018-11-19 02:18:22 +01:00
|
|
|
{{template "footer" .}}
|
2018-11-19 03:58:50 +01:00
|
|
|
|
2018-11-19 02:18:22 +01:00
|
|
|
{{template "body-end" .}}
|
|
|
|
{{end}}
|