diff --git a/res/include/style/layout.css b/res/include/style/layout.css index 3f247f8..1d80d84 100644 --- a/res/include/style/layout.css +++ b/res/include/style/layout.css @@ -221,7 +221,8 @@ section { } .highlight_shaded { - background: var(--shaded_background); + background: var(--background_color); + color: var(--background_text_color); } .highlight_green { diff --git a/svelte/src/admin_panel/Home.svelte b/svelte/src/admin_panel/Home.svelte index a254d67..c314dc7 100644 --- a/svelte/src/admin_panel/Home.svelte +++ b/svelte/src/admin_panel/Home.svelte @@ -144,11 +144,11 @@ onMount(() => { }, ]; - loadGraph(10080, 10, false); + loadGraph(43200, 60, true); getStats("calls") statsInterval = setInterval(() => { getStats(lastOrder) - }, 10000) + }, 20000) }) onDestroy(() => { if (graphTimeout !== null) { @@ -164,14 +164,14 @@ onDestroy(() => {

Bandwidth usage and file views

- - - - - - - - + + + + + + + +
diff --git a/svelte/src/file_viewer/FileViewer.svelte b/svelte/src/file_viewer/FileViewer.svelte index b7ebde9..930890e 100644 --- a/svelte/src/file_viewer/FileViewer.svelte +++ b/svelte/src/file_viewer/FileViewer.svelte @@ -609,9 +609,10 @@ const keyboard_event = evt => { - {#if ads_enabled} + + diff --git a/svelte/src/user_home/ActivityLog.svelte b/svelte/src/user_home/ActivityLog.svelte index 85889eb..3ab4d57 100644 --- a/svelte/src/user_home/ActivityLog.svelte +++ b/svelte/src/user_home/ActivityLog.svelte @@ -85,44 +85,38 @@ onMount(() => { -
- - +
+ + + + + + + + + {#each data as row} - - - - + + + - - - {#each data as row} - - - - - - - {/each} - -
TimeFile nameEvent
TimeEventFile nameFile removal reason + {formatDate(row.time, true, true, false)} + + {#if row.event === "file_instance_blocked"} + {row.file_name} + {:else} + {row.file_name} + {/if} + + {#if row.event === "file_instance_blocked"} + Blocked for abuse + {:else if row.event === "file_instance_expired"} + Expired + {/if} +
- {formatDate(row.time, true, true, false)} - - {#if row.event === "file_instance_blocked"} - File blocked for abuse - {:else if row.event === "file_instance_expired"} - File expired - {/if} - - {#if row.event === "file_instance_blocked"} - {row.file_name} - {:else} - {row.file_name} - {/if} - - {row.file_removal_reason} -
-
+ {/each} + + {#if data.length > 100}
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 +
+
diff --git a/webcontroller/style.go b/webcontroller/style.go index fdd921f..2872923 100644 --- a/webcontroller/style.go +++ b/webcontroller/style.go @@ -249,7 +249,7 @@ var defaultPixeldrainStyle = styleSheet{ ScrollbarForeground: hsl{266, .85, .40}, ScrollbarHover: hsl{266, .85, .50}, - BackgroundColor: hsl{275, .8, .10}, + BackgroundColor: hsl{273, .93, .12}, Background: NewGradient(120, hsl{250, .9, .14}, hsl{300, .9, .10}), BackgroundPattern: NoColor, ParallaxSlider: hsl{275, .8, .1}, @@ -383,7 +383,7 @@ var nordLightStyle = styleSheet{ InputText: hsl{222, .16, .28}, // nord1 hsl(222, 16%, 28%) InputDisabledText: hsl{219, .28, .88}, // nord4 hsl(219, 28%, 88%) Highlight: hsl{92, .28, .65}, // nord14 hsl(92, 28%, 65%) - HighlightText: hsl{220, .16, .22}, // nord0 + HighlightText: hsl{222, .16, .28}, // nord3 hsl(220, 16%, 36%) Danger: hsl{354, .42, .56}, // nord11 hsl(354, 42%, 56%) ScrollbarForeground: hsl{179, .25, .65}, // nord7 hsl(179, 25%, 65%) ScrollbarHover: hsl{193, .43, .67}, // nord8 hsl(193, 43%, 67%) @@ -460,7 +460,7 @@ var solarizedDarkStyle = styleSheet{ InputText: hsl{180, .07, .80}, // hsl(44, 87%, 94%) InputDisabledText: hsl{194, .14, .30}, // hsl(194, 14%, 40%) Highlight: hsl{68, 1, .30}, // hsl(68, 100%, 30%) - HighlightText: hsl{192, 1, .11}, // hsl(192, 100%, 11%) + HighlightText: hsl{192, .81, .14}, // hsl(192, 100%, 11%) Danger: hsl{1, .71, .52}, // hsl(1, 71%, 52%) BackgroundColor: hsl{192, 1, .11}, //hsl(192, 100%, 11%) @@ -477,8 +477,8 @@ var solarizedLightStyle = styleSheet{ InputHover: hsl{46, .42, .88}, InputText: hsl{194, .14, .20}, // hsl(192, 81%, 14%) InputDisabledText: hsl{194, .14, .80}, - Highlight: hsl{68, 1, .30}, // hsl(68, 100%, 30%) - HighlightText: hsl{192, 1, .11}, // hsl(192, 100%, 11%) + Highlight: hsl{68, 1, .30}, // hsl(68, 100%, 30%) + HighlightText: hsl{44, .87, .94}, Danger: hsl{1, .71, .52}, // hsl(1, 71%, 52%) BackgroundColor: hsl{46, .42, .88}, // hsl(46, 42%, 88%)