176 lines
5.8 KiB
HTML
176 lines
5.8 KiB
HTML
{{define "user_home"}}<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
{{template "meta_tags" .User.Username}}
|
|
{{template "user_style" .}}
|
|
<script>
|
|
var apiEndpoint = '{{.APIEndpoint}}';
|
|
window.user = {{.User}};
|
|
</script>
|
|
|
|
<style>
|
|
.progress_bar_outer {
|
|
background-color: var(--layer_1_color);
|
|
width: 100%;
|
|
height: 3px;
|
|
}
|
|
.progress_bar_inner {
|
|
background-color: var(--highlight_color);
|
|
height: 100%;
|
|
width: 0;
|
|
transition: width 1s;
|
|
}
|
|
</style>
|
|
</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>
|
|
Supporter level: {{.User.Subscription.Name}}
|
|
{{if eq .User.Subscription.Type "patreon"}}
|
|
(<a href="https://www.patreon.com/join/pixeldrain/checkout?edit=1">Manage subscription</a>)
|
|
{{end}}
|
|
<ul>
|
|
<li>Advertisements when viewing files: {{if .User.Subscription.DisableAdDisplay}}No{{else}}Yes{{end}}</li>
|
|
<li>Advertisements on your 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}}
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Limits</h3>
|
|
Storage: <span id="storage_text"></span><br/>
|
|
<div class="progress_bar_outer">
|
|
<div id="storage_progress" class="progress_bar_inner" style="width: 0%;"></div>
|
|
</div>
|
|
<br/>
|
|
Direct link bandwidth: <span id="direct_bandwidth_text"></span>
|
|
(<a href="/#direct_linking">More information about direct linking</a>)
|
|
<div class="progress_bar_outer">
|
|
<div id="direct_bandwidth_progress" class="progress_bar_inner" style="width: 0%;"></div>
|
|
</div>
|
|
<br/>
|
|
|
|
<h3>Settings</h3>
|
|
<div style="text-align: center;">
|
|
<a href="/user/settings" class="button button_highlight">
|
|
<i class="icon">edit</i>
|
|
Change account settings
|
|
</a>
|
|
<a href="/user/export/files" class="button">
|
|
<i class="icon">list</i>
|
|
Export uploaded files to CSV
|
|
</a>
|
|
<a href="/user/export/lists" class="button">
|
|
<i class="icon">list</i>
|
|
Export created lists to CSV
|
|
</a>
|
|
</div>
|
|
|
|
<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 'Day'
|
|
the statistics will be updated periodically. No need to
|
|
refresh the page.
|
|
</p>
|
|
</div>
|
|
<div class="highlight_dark">
|
|
<button onclick="updateGraphs(1440, 1, 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>
|
|
<div class="limit_width">
|
|
<h3>Views</h3>
|
|
<p>
|
|
A view is counted when someone visits the download page of one
|
|
of your files. Views are unique per user per file.
|
|
</p>
|
|
</div>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<canvas id="views_chart"></canvas>
|
|
</div>
|
|
<div class="limit_width">
|
|
<h3>Downloads</h3>
|
|
<p>
|
|
Downloads are counted when a user clicks the download button
|
|
on one of your files. It does not matter whether the
|
|
download is completed or not, only the start of the download
|
|
is counted.
|
|
</p>
|
|
</div>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<canvas id="downloads_chart"></canvas>
|
|
</div>
|
|
<div class="limit_width">
|
|
<h3>Bandwidth</h3>
|
|
<p>
|
|
This is how much bandwidth your files are using in total.
|
|
Bandwidth is used when a file is tranferred from a
|
|
pixeldrain server to a user who is downloading the file.
|
|
When a 5 MB file is downloaded 8 times it has used 40 MB of
|
|
bandwidth.
|
|
</p>
|
|
</div>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<canvas id="bandwidth_chart"></canvas>
|
|
</div>
|
|
<div class="limit_width">
|
|
<h3>Direct link bandwidth</h3>
|
|
<p>
|
|
When a file is downloaded without going through pixeldrain's
|
|
download page it counts as a direct download. Because direct
|
|
downloads cost us bandwidth and don't generate any ad
|
|
revenue we have to limit them. When your direct link
|
|
bandwidth runs out people will be asked to do a test before
|
|
they can download your files. See our
|
|
<a href="/#pro">subscription options</a> to get more direct
|
|
linking bandwidth.
|
|
</p>
|
|
</div>
|
|
<div class="chart-container" style="position: relative; width: 100%; height: 140px;">
|
|
<canvas id="direct_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,
|
|
<span id="total_bandwidth"></span> bandwidth and
|
|
<span id="total_direct_bandwidth"></span> direct link 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}}
|