159 lines
5.0 KiB
HTML
159 lines
5.0 KiB
HTML
{{define "admin_panel"}}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
{{template "meta_tags" "Administrator panel"}}
|
|
{{template "user_style" .}}
|
|
</head>
|
|
<body>
|
|
{{template "page_top" .}}
|
|
<div class="page_content">
|
|
{{if and .Authenticated .User.IsAdmin}}
|
|
<div class="limit_width">
|
|
<a class="button" href="/admin/globals">Update global settings</a>
|
|
<a class="button" href="/admin/abuse">Block files</a>
|
|
<h3>Bandwidth and views</h3>
|
|
</div>
|
|
<div class="highlight_dark">
|
|
<button onclick="loadGraph(720, 1, true);">Live</button>
|
|
<button onclick="loadGraph(1440, 10, true);">Day</button>
|
|
<button onclick="loadGraph(10080, 60, false);">Week</button>
|
|
<button onclick="loadGraph(20160, 60, false);">Two Weeks</button>
|
|
<button onclick="loadGraph(43200, 1440, false);">Month</button>
|
|
<button onclick="loadGraph(131400, 1440, false);">Quarter</button>
|
|
<button onclick="loadGraph(262800, 1440, false);">Half-year</button>
|
|
<button onclick="loadGraph(525600, 1440, false);">Year</button>
|
|
<button onclick="loadGraph(1051200, 1440, false);">Two Years</button>
|
|
<!--<br/>
|
|
<button onclick="navigateTimespan(false);">🠈</button>
|
|
<button onclick="loadTimespan('day', new Date());">Day</button>
|
|
<button onclick="loadTimespan('week', new Date());">Week</button>
|
|
<button onclick="loadTimespan('month', new Date());">Month</button>
|
|
<button onclick="loadTimespan('quarter', new Date());">Quarter</button>
|
|
<button onclick="loadTimespan('year', new Date());">Year</button>
|
|
<button onclick="navigateTimespan(true);">🠊</button>-->
|
|
</div>
|
|
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 200px; padding-top: 6px;">
|
|
<canvas id="bandwidth_chart"></canvas>
|
|
</div>
|
|
<hr>
|
|
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 200px;">
|
|
<canvas id="views_chart"></canvas>
|
|
</div>
|
|
<div class="highlight_dark">
|
|
Total usage from <span id="time_start"></span> to <span id="time_end"></span><br/>
|
|
<span id="total_bandwidth"></span> bandwidth and <span id="total_views"></span> views
|
|
</div>
|
|
|
|
<br/>
|
|
<a class="button" href="/api/admin/call_stack">Call stack</a>
|
|
<a class="button" href="/api/admin/heap_profile">Heap profile</a>
|
|
<a class="button" href="/api/admin/cpu_profile">CPU profile (wait 1 min)</a>
|
|
<br/>
|
|
|
|
<div class="limit_width">
|
|
<h3>Database connection statistics</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Available</td>
|
|
<td>Max</td>
|
|
<td>Open</td>
|
|
<td>In use</td>
|
|
<td>Idle</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tconnstat_body"></tbody>
|
|
</table>
|
|
<h3>Pixelstore peers</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>Address</td>
|
|
<td>Pos.</td>
|
|
<td>Reachable</td>
|
|
<td>Err count</td>
|
|
<td>Latency</td>
|
|
<td>Free space</td>
|
|
<td>Min free space</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tbody_peers"></tbody>
|
|
</table>
|
|
<h3>Pixelstore stats</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>Local reads</td>
|
|
<td>Local read size</td>
|
|
<td>Remote reads</td>
|
|
<td>Remote read size</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td id="local_reads"></td>
|
|
<td id="local_read_size"></td>
|
|
<td id="remote_reads"></td>
|
|
<td id="remote_read_size"></td>
|
|
</tr>
|
|
<tr>
|
|
<td id="local_reads_rate"></td>
|
|
<td id="local_read_size_rate"></td>
|
|
<td id="remote_reads_rate"></td>
|
|
<td id="remote_read_size_rate"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3>Websocket statistics</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>Watcher</td>
|
|
<td>Threads</td>
|
|
<td>Listeners</td>
|
|
<td>Avg</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>File statistics</td>
|
|
<td id="file_stats_watchers"></td>
|
|
<td id="file_stats_listeners"></td>
|
|
<td id="file_stats_avg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3>Query statistics</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td style="cursor: pointer;" onclick="getStats('query_name')">Query</td>
|
|
<td style="cursor: pointer;" onclick="getStats('calls')">Calls</td>
|
|
<td style="cursor: pointer;" onclick="getStats('average_duration')">Average Duration</td>
|
|
<td style="cursor: pointer;" onclick="getStats('total_duration')">Total Duration</td>
|
|
<td>Callers</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tstat_body"></tbody>
|
|
</table>
|
|
</div>
|
|
<script src="/res/script/Chart.min.js"></script>
|
|
<script>
|
|
var apiEndpoint = '{{.APIEndpoint}}';
|
|
var highlightColor = '#{{.Style.HighlightColor.RGB}}';
|
|
{{template `util.js`}}
|
|
{{template `drawGraph.js`}}
|
|
{{template `admin.js`}}
|
|
</script>
|
|
{{else}}
|
|
<h1 style="text-align: center;">;-)</h1>
|
|
{{end}}
|
|
</div>
|
|
{{template "page_bottom" .}}
|
|
</div>
|
|
</body>
|
|
</html>
|
|
{{end}}
|