diff --git a/svelte/src/user_home/Home.svelte b/svelte/src/user_home/Home.svelte
index 36f15a0..9d215de 100644
--- a/svelte/src/user_home/Home.svelte
+++ b/svelte/src/user_home/Home.svelte
@@ -11,10 +11,6 @@ let graph_views_downloads = null
let graph_bandwidth = null
let time_start = ""
let time_end = ""
-let total_views = 0
-let total_downloads = 0
-let total_bandwidth = 0
-let total_transfer_paid = 0
let load_graphs = async (minutes, interval) => {
let end = new Date()
@@ -52,6 +48,12 @@ let load_graphs = async (minutes, interval) => {
}
}
+let total_views = 0
+let total_downloads = 0
+let total_bandwidth = 0
+let total_transfer_paid = 0
+let total_transfer_kickback = 0
+
let get_graph_data = async (stat, start, end, interval) => {
let resp = await fetch(
window.api_endpoint + "/user/time_series/" + stat +
@@ -64,7 +66,8 @@ let get_graph_data = async (stat, start, end, interval) => {
// Convert the timestamps to a human-friendly format
resp.timestamps.forEach((val, idx) => {
let date = new Date(val);
- let str = ("00" + (date.getMonth() + 1)).slice(-2);
+ let str = date.getFullYear();
+ str += "-" + ("00" + (date.getMonth() + 1)).slice(-2);
str += "-" + ("00" + date.getDate()).slice(-2);
str += " " + ("00" + date.getHours()).slice(-2);
str += ":" + ("00" + date.getMinutes()).slice(-2);
@@ -83,6 +86,8 @@ let get_graph_data = async (stat, start, end, interval) => {
total_bandwidth = total;
} else if (stat == "transfer_paid") {
total_transfer_paid = total;
+ } else if (stat == "transfer_kickback") {
+ total_transfer_kickback = total;
}
return resp
@@ -176,7 +181,7 @@ onMount(() => {
},
];
- update_graphs(1440, 1, true);
+ update_graphs(10080, 60, true);
})
onDestroy(() => {
if (graph_timeout !== null) {
@@ -244,58 +249,49 @@ onDestroy(() => {
Statistics
- 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.
+ Here you can see how often your files are viewed, downloaded and how
+ much bandwidth they consume. The buttons below can be pressed to adjust
+ the timeframe.
-
-
-
-
-
-
-
-
-
-
- Total usage from {time_start} to {time_end}
- {formatThousands(total_views)} views,
- {formatThousands(total_downloads)} downloads,
- {formatDataVolume(total_bandwidth, 3)} bandwidth and
- {formatDataVolume(total_transfer_paid, 3)} paid transfers
-
-
+
+
+
+
+
+
+
+
+
+
Premium transfers and total bandwidth usage
Total bandwidth usage is the combined bandwidth usage of all the files
@@ -316,9 +312,17 @@ onDestroy(() => {
transactions page.
+
+
+ Total usage from {time_start} to {time_end}
+ {formatDataVolume(total_bandwidth, 3)} bandwidth,
+ {formatDataVolume(total_transfer_paid, 3)} paid transfers
+ {formatDataVolume(total_transfer_kickback, 3)} kickback transfers
+
+
Views and downloads
A view is counted when someone visits the download page of one of
@@ -330,4 +334,13 @@ onDestroy(() => {
or not, only the start of the download is counted.
+
+
+
+
+ Total usage from {time_start} to {time_end}
+ {formatThousands(total_views)} views and
+ {formatThousands(total_downloads)} downloads
+