Files
fnx_web/res/template/admin.html

72 lines
2.2 KiB
HTML
Raw Normal View History

2019-04-10 20:33:14 +02:00
{{define "admin_panel"}}
<!DOCTYPE html>
2020-01-17 20:32:21 +01:00
<html lang="en">
<head>
{{template "meta_tags" "Administrator panel"}}
{{template "user_style" .}}
</head>
<body>
2019-07-07 10:11:18 +02:00
{{$isAdmin := .PixelAPI.UserIsAdmin}}
2019-09-17 23:38:40 +02:00
{{template "page_top" .}}
<div class="page_content">
2019-07-07 10:11:18 +02:00
{{if $isAdmin.IsAdmin}}
2019-09-17 23:38:40 +02:00
<h3>Bandwidth and views</h3>
<div class="highlight_dark">
2020-05-21 21:42:50 +02:00
<button onclick="setData(7, 60);">Week</button>
<button onclick="setData(14, 60);">Two Weeks</button>
<button onclick="setData(21, 60);">Three Weeks</button>
<button onclick="setData(30, 1440);">Month</button>
<button onclick="setData(60, 1440);">Two Months</button>
<button onclick="setData(91, 1440);">Quarter</button>
<button onclick="setData(182, 1440);">Half-year</button>
<button onclick="setData(356, 1440);">Year</button>
2019-09-17 23:38:40 +02:00
</div>
2020-05-21 21:42:50 +02:00
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: 400px;">
2019-09-17 23:38:40 +02:00
<canvas id="bandwidth_chart"></canvas>
</div>
2019-12-17 19:28:30 +01:00
<hr/>
<div class="limit_width">
<a href="/admin/globals">Update global settings</a>
2020-06-01 14:39:22 +02:00
<h3>Database connection statistics</h3>
<table>
<thead>
<tr>
<td>Name</td>
<td>Max</td>
<td>Open</td>
<td>In use</td>
<td>Idle</td>
</tr>
</thead>
<tbody id="tconnstat_body"></tbody>
</table>
2020-05-25 15:30:23 +02:00
<h3>Query statistics</h3>
<table>
<thead>
<tr>
2020-05-25 22:31:40 +02:00
<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>
2020-05-25 15:30:23 +02:00
<td>Callers</td>
</tr>
</thead>
2020-05-25 18:09:29 +02:00
<tbody id="tstat_body"></tbody>
2020-05-25 15:30:23 +02:00
</table>
2019-12-17 19:28:30 +01:00
</div>
2020-05-25 22:31:40 +02:00
<script src="/res/script/Chart.min.js"></script>
<script>
var apiEndpoint = '{{.APIEndpoint}}';
{{template `util.js`}}
{{template `admin.js`}}
</script>
2019-09-17 23:38:40 +02:00
{{else}}
2020-05-25 22:31:40 +02:00
<h1 style="text-align: center;">;-)</h1>
2019-09-17 23:38:40 +02:00
{{end}}
</div>
{{template "page_bottom" .}}
</div>
</body>
</html>
{{end}}