95 lines
3.4 KiB
HTML
95 lines
3.4 KiB
HTML
{{define "user_home"}}<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
{{template "meta_tags" .User.Username}}
|
|
{{template "user_style" .}}
|
|
<script>var apiEndpoint = '{{.APIEndpoint}}';</script>
|
|
</head>
|
|
|
|
<body>
|
|
{{template "page_top" .}}
|
|
|
|
<h1>Welcome home, {{.User.Username}}!</h1>
|
|
|
|
<div class="page_content">
|
|
<div class="limit_width">
|
|
<h2>Account information</h2>
|
|
<ul>
|
|
<li>Username: {{.User.Username}}</li>
|
|
<li>E-mail address: {{.User.Email}}</li>
|
|
<li>
|
|
{{if eq .User.Subscription.Name ""}}
|
|
Supporter status: Not a pixeldrain supporter<br/>
|
|
<a href="https://www.patreon.com/pixeldrain">Learn how to support pixeldrain</a>.
|
|
{{else}}
|
|
Supporter level {{.User.Subscription.Name}}
|
|
<ul>
|
|
<li>Ads when viewing files: {{if .User.Subscription.DisableAdDisplay}}No{{else}}Yes{{end}}</li>
|
|
<li>Ads on uploaded files: {{if .User.Subscription.DisableAdsOnFiles}}No{{else}}Yes{{end}}</li>
|
|
{{if gt .User.Subscription.FileExpiryDays 0}}
|
|
<li>Files expire after {{.User.Subscription.FileExpiryDays}} days</li>
|
|
{{else}}
|
|
<li>Files never expire</li>
|
|
{{end}}
|
|
<li>Direct linking bandwidth: {{formatData .User.Subscription.DirectLinkingBandwidth}}</li>
|
|
</ul>
|
|
{{end}}
|
|
</li>
|
|
</ul>
|
|
<a href="/user/settings" class="button button_highlight">Change account settings</a>
|
|
|
|
<h2>Statistics</h2>
|
|
<p>
|
|
Here you can see how often your files are viewed, downloaded
|
|
and how much bandwidth they consume. The buttons at the top
|
|
can be pressed to adjust the timeframe. If you choose 'Live'
|
|
or 'Day' the statistics will be updated periodically. No
|
|
need to refresh the page.
|
|
</p>
|
|
</div>
|
|
<div class="highlight_dark">
|
|
<button onclick="updateGraphs(720, 1, true);">Live</button>
|
|
<button onclick="updateGraphs(1440, 10, true);">Day</button>
|
|
<button onclick="updateGraphs(10080, 60, false);">Week</button>
|
|
<button onclick="updateGraphs(20160, 60, false);">Two Weeks</button>
|
|
<button onclick="updateGraphs(43200, 1440, false);">Month</button>
|
|
<button onclick="updateGraphs(131400, 1440, false);">Quarter</button>
|
|
<button onclick="updateGraphs(262800, 1440, false);">Half-year</button>
|
|
<button onclick="updateGraphs(525600, 1440, false);">Year</button>
|
|
</div>
|
|
<h3>Views</h3>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<canvas id="views_chart"></canvas>
|
|
</div>
|
|
<h3>Downloads</h3>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<canvas id="downloads_chart"></canvas>
|
|
</div>
|
|
<h3>Bandwidth</h3>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<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_views"></span> views,
|
|
<span id="total_downloads"></span> downloads and
|
|
<span id="total_bandwidth"></span> bandwidth
|
|
</div>
|
|
</div>
|
|
|
|
{{template "page_bottom" .}}
|
|
|
|
{{template "analytics"}}
|
|
|
|
<script src="/res/script/Chart.min.js"></script>
|
|
<script>
|
|
var apiEndpoint = '{{.APIEndpoint}}';
|
|
var highlightColor = '#{{.Style.HighlightColor.RGB}}';
|
|
{{template `util.js`}}
|
|
{{template `drawGraph.js`}}
|
|
{{template `user_home.js`}}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
{{end}}
|