Files
fnx_web/res/template/admin.html

77 lines
2.5 KiB
HTML

{{define "admin_panel"}}
<!DOCTYPE html>
<html lang="en">
<head>
{{template "meta_tags" "Administrator panel"}}
{{template "user_style" .}}
</head>
<body>
{{$isAdmin := .PixelAPI.UserIsAdmin}}
{{template "page_top" .}}
<div class="page_content">
{{if $isAdmin}}
<h3>Bandwidth and views</h3>
<div class="highlight_dark">
<button onclick="loadGraph(360, 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>
</div>
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 300px;">
<canvas id="bandwidth_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>
<div class="limit_width">
<br/>
<a href="/admin/globals">Update global settings</a>
<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>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}}';
{{template `util.js`}}
{{template `admin.js`}}
</script>
{{else}}
<h1 style="text-align: center;">;-)</h1>
{{end}}
</div>
{{template "page_bottom" .}}
</div>
</body>
</html>
{{end}}