diff --git a/svelte/src/home_page/UploadStats.svelte b/svelte/src/home_page/UploadStats.svelte index 47250eb..d95f865 100644 --- a/svelte/src/home_page/UploadStats.svelte +++ b/svelte/src/home_page/UploadStats.svelte @@ -78,41 +78,49 @@ const stats_update = () => {
- Size {formatDataVolume(total_size, 3)} +
+ Size {formatDataVolume(total_size, 3)} +
+
+ Progress {(total_progress*100).toPrecision(3)}% +
- Progress {(total_progress*100).toPrecision(3)}% + {#if finished} +
+ Time {formatDuration(elapsed_time, 0)} +
+
+ Rate {formatDataVolume(total_loaded / (elapsed_time/1000), 3)}/s +
+ {:else} +
+ ETA {formatDuration(remaining_time, 0)} +
+
+ Rate {formatDataVolume(total_rate, 3)}/s +
+ {/if}
- {#if finished} -
- Time {formatDuration(elapsed_time, 0)} -
-
- Rate {formatDataVolume(total_loaded / (elapsed_time/1000), 3)}/s -
- {:else} -
- ETA {formatDuration(remaining_time, 0)} -
-
- Rate {formatDataVolume(total_rate, 3)}/s -
- {/if}
diff --git a/svelte/src/layout/Button.svelte b/svelte/src/layout/Button.svelte index 0a5b4e1..ccb9b21 100644 --- a/svelte/src/layout/Button.svelte +++ b/svelte/src/layout/Button.svelte @@ -82,5 +82,6 @@ let click_int = e => { background: none; margin: 0; color: var(--body_text_color); + box-shadow: none; } diff --git a/svelte/src/login/Login.svelte b/svelte/src/login/Login.svelte index 64aff13..f9c0d50 100644 --- a/svelte/src/login/Login.svelte +++ b/svelte/src/login/Login.svelte @@ -22,7 +22,7 @@ let form = { const form = new FormData() form.append("username", fields.username) form.append("password", fields.password) - form.append("app_name", "website_login") + form.append("app_name", "website login") const resp = await fetch( window.api_endpoint+"/user/login", diff --git a/svelte/src/login/Register.svelte b/svelte/src/login/Register.svelte index 042c7b7..5c375f5 100644 --- a/svelte/src/login/Register.svelte +++ b/svelte/src/login/Register.svelte @@ -66,7 +66,7 @@ let form = { const login_form = new FormData() login_form.append("username", fields.username) login_form.append("password", fields.password) - login_form.append("app_name", "website_login") + login_form.append("app_name", "website login") const login_resp = await fetch( window.api_endpoint+"/user/login", diff --git a/svelte/src/user_home/Home.svelte b/svelte/src/user_home/Home.svelte deleted file mode 100644 index 0bfb307..0000000 --- a/svelte/src/user_home/Home.svelte +++ /dev/null @@ -1,341 +0,0 @@ - - -
-

Account information

- - - {#if window.user.subscription.storage_space === -1} - Storage space used: {formatDataVolume(storage_space_used, 3)}
- {:else} - - {/if} - - {#if transfer_cap === -1} - Premium transfer used in the last 30 days: {formatDataVolume(transfer_used, 3)} - (configure limit) - {:else} - Transfer cap: - {formatDataVolume(transfer_used, 3)} - out of - {formatDataVolume(transfer_cap, 3)} - (Set your transfer limit on the sharing page) - - {/if} - -

Exports

-
- - list - Export uploaded files to CSV - - - list - Export created lists to CSV - -
- -

Statistics

-

- 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. -

- -
- - - - - - - -
- -

Premium transfers and total bandwidth usage

-

- Total bandwidth usage is the combined bandwidth usage of all the files - on your account. This includes paid transfers. -

-

- A premium transfer is when a file is downloaded using the data cap on - your subscription plan. These can be files you downloaded from other - people, or other people downloading your files if you have bandwidth - sharing enabled. Bandwidth sharing can be changed on - the sharing page. -

-
- - - -
-
- Total usage from {time_start} to {time_end}
- {formatDataVolume(total_bandwidth, 3)} bandwidth, - {formatDataVolume(total_transfer_paid, 3)} paid transfers -
- -

Views and downloads

-

- A view is counted when someone visits the download page of one of - your files. Views are unique per user per file. -

-

- 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. -

-
- - - -
-
- Total usage from {time_start} to {time_end}
- {formatThousands(total_views)} views and - {formatThousands(total_downloads)} downloads -
-
diff --git a/svelte/src/user_home/HotlinkProgressBar.svelte b/svelte/src/user_home/HotlinkProgressBar.svelte index 43c2753..5dd2571 100644 --- a/svelte/src/user_home/HotlinkProgressBar.svelte +++ b/svelte/src/user_home/HotlinkProgressBar.svelte @@ -1,5 +1,6 @@ +
+
+ {formatDataVolume(used, 3)} +
+
+ {#if total <= 0} + No limit + {:else} + {formatDataVolume(total, 3)} + {/if} +
+
{#if frac > 1}
@@ -53,3 +66,13 @@ $: frac = used / total
{/if} + + diff --git a/svelte/src/user_home/Router.svelte b/svelte/src/user_home/Router.svelte index 090c709..34c9908 100644 --- a/svelte/src/user_home/Router.svelte +++ b/svelte/src/user_home/Router.svelte @@ -1,5 +1,4 @@ -Storage: -{formatDataVolume(used, 3)} -out of -{formatDataVolume(total, 3)} -
+
+
+ {formatDataVolume(used, 3)} +
+
+ {#if total <= 0} + No limit + {:else} + {formatDataVolume(total, 3)} + {/if} +
+
{#if frac > 2.0}
@@ -61,4 +68,13 @@ out of font-weight: bold; font-size: 1.5em; } + +.gauge_labels { + display: flex; + justify-content: space-between; + line-height: 1em; +} +.gauge_labels > div { + flex: 0 0 auto; +} diff --git a/svelte/src/user_home/dashboard/CardAccount.svelte b/svelte/src/user_home/dashboard/CardAccount.svelte new file mode 100644 index 0000000..79f6f25 --- /dev/null +++ b/svelte/src/user_home/dashboard/CardAccount.svelte @@ -0,0 +1,67 @@ +
    +
  • Username: {window.user.username}
  • +
  • + {#if window.user.email === ""} + No e-mail address configured. You will not be able to recover + your account if you lose your password. + {:else} + E-mail address: {window.user.email} + {/if} +
  • +
  • + settings + Account settings +
  • +
+ +

Quick navigation

+ + + +

Exports

+ + + + diff --git a/svelte/src/user_home/dashboard/CardActivity.svelte b/svelte/src/user_home/dashboard/CardActivity.svelte new file mode 100644 index 0000000..a16783b --- /dev/null +++ b/svelte/src/user_home/dashboard/CardActivity.svelte @@ -0,0 +1,138 @@ + + + + +
+
+ +{#if data.length === 0} +
+ Removed or expired files will show up here +
+{:else} +
+ + + + + + + + + + {#each data as row} + + + + + + {/each} + +
TimeFile nameEvent
+ {formatDate(row.time, true, true, false)} + + {#if row.event === "file_instance_blocked"} + {row.file_name} + {:else if row.event === "filesystem_node_blocked"} + {row.file_name} + {:else} + {row.file_name} + {/if} + + {#if row.event === "file_instance_blocked" || row.event === "filesystem_node_blocked"} + Blocked for abuse + {:else if row.event === "file_instance_expired"} + Expired + {:else if row.event === "file_instance_lost"} + File has been lost + {/if} +
+
+{/if} + + + diff --git a/svelte/src/user_home/dashboard/CardPrepaidTransactions.svelte b/svelte/src/user_home/dashboard/CardPrepaidTransactions.svelte new file mode 100644 index 0000000..48fad2d --- /dev/null +++ b/svelte/src/user_home/dashboard/CardPrepaidTransactions.svelte @@ -0,0 +1,142 @@ + + + + +
+
+ +
    +
  • + Total charge: +
  • +
  • + Subscription charge: +
  • +
  • + Storage charge: + (used {formatDataVolume(transactions.total_storage_used, 3)}) +
  • +
  • + Bandwidth charge: + (used {formatDataVolume(transactions.total_bandwidth_used, 3)}) +
  • +
  • + Deposited: +
  • +
+ + diff --git a/svelte/src/user_home/dashboard/CardStatistics.svelte b/svelte/src/user_home/dashboard/CardStatistics.svelte new file mode 100644 index 0000000..e217dcb --- /dev/null +++ b/svelte/src/user_home/dashboard/CardStatistics.svelte @@ -0,0 +1,180 @@ + + +
+ + + + + + + +
+ + +
+ {formatDataVolume(total_bandwidth, 3)} free downloads and + {formatDataVolume(total_transfer_paid, 3)} paid downloads +
+ + +
+ {formatThousands(total_views)} views and + {formatThousands(total_downloads)} downloads +
+ + diff --git a/svelte/src/user_home/dashboard/CardSubscription.svelte b/svelte/src/user_home/dashboard/CardSubscription.svelte new file mode 100644 index 0000000..4913461 --- /dev/null +++ b/svelte/src/user_home/dashboard/CardSubscription.svelte @@ -0,0 +1,64 @@ + + +
    +
  • + Supporter level: {window.user.subscription.name}
    + shopping_cart + Manage subscriptions
    + add_link + Link Patreon subscription +
  • + + {#if window.user.balance_micro_eur !== 0} +
  • + Current account balance:
    + + account_balance_wallet + Deposit credit
    + + receipt + Transaction log + + {#if window.user.balance_micro_eur > 0 && window.user.subscription.id === ""} +
    + You have account credit but no active subscription. Activate + a subscription on the subscriptions page + {/if} +
  • + {/if} + +
  • + Max file size: {formatDataVolume(window.user.subscription.file_size_limit, 3)} +
  • +
  • + {#if window.user.subscription.storage_space > 0} + Storage limit: {formatDataVolume(window.user.subscription.storage_space, 3)} + {:else} + No storage limit + {/if} +
  • +
  • + {#if window.user.subscription.monthly_transfer_cap > 0} + Data transfer limit: {formatDataVolume(window.user.subscription.monthly_transfer_cap, 3)} + {:else} + No data transfer limit + {/if} +
  • + +
  • + {#if window.user.subscription.file_expiry_days > 0} + Files expire after {window.user.subscription.file_expiry_days} days + {:else} + Files never expire + {/if} +
  • +
+ + diff --git a/svelte/src/user_home/dashboard/CardUpload.svelte b/svelte/src/user_home/dashboard/CardUpload.svelte new file mode 100644 index 0000000..bfaaaed --- /dev/null +++ b/svelte/src/user_home/dashboard/CardUpload.svelte @@ -0,0 +1,44 @@ + + +
+ + + text_fields + Upload Text + +
+ +
+ +
+ + diff --git a/svelte/src/user_home/dashboard/CardUsage.svelte b/svelte/src/user_home/dashboard/CardUsage.svelte new file mode 100644 index 0000000..a195884 --- /dev/null +++ b/svelte/src/user_home/dashboard/CardUsage.svelte @@ -0,0 +1,53 @@ + + +Storage space used: + + +
+ +Premium data transfer: +(set custom limit) + diff --git a/svelte/src/user_home/dashboard/Dashboard.svelte b/svelte/src/user_home/dashboard/Dashboard.svelte new file mode 100644 index 0000000..678edb7 --- /dev/null +++ b/svelte/src/user_home/dashboard/Dashboard.svelte @@ -0,0 +1,163 @@ + + +
+ {#each cards as card (card.id)}{#if !card.hidden} +
+
+

+ {card.title} +

+ + {#if card.link} +
+
+ +
+
+ {/if}{/each} +
+ + diff --git a/svelte/src/user_home/dashboard/UploadLib.svelte b/svelte/src/user_home/dashboard/UploadLib.svelte new file mode 100644 index 0000000..59cfcba --- /dev/null +++ b/svelte/src/user_home/dashboard/UploadLib.svelte @@ -0,0 +1,233 @@ + + + { dragging = true }} + on:dragenter|preventDefault|stopPropagation={() => { dragging = true }} + on:dragleave|preventDefault|stopPropagation={() => { dragging = false }} + on:drop={drop} + on:paste={paste} + on:keydown={keydown} + on:beforeunload={leave_confirmation} /> + + + + + +{#if upload_queue.length > 1} +
+ Create an album
+
+
Name:
+ + +
+
+{/if} + +
+ Drop your files to upload them +
+ +{#each upload_queue as file} + +{/each} + + diff --git a/svelte/src/util/Chart.svelte b/svelte/src/util/Chart.svelte index c84ff89..f7d0d95 100644 --- a/svelte/src/util/Chart.svelte +++ b/svelte/src/util/Chart.svelte @@ -29,6 +29,8 @@ let chart_object export let data_type = "" export let legend = true export let tooltips = true +export let ticks = true +export let height = "300px" export const chart = () => { return chart_object @@ -80,7 +82,7 @@ onMount(() => { layout: { padding: { left: 4, - right: 10, + right: 4, } }, scales: { @@ -106,6 +108,7 @@ onMount(() => { x: { display: true, ticks: { + display: ticks, sampleSize: 1, padding: 4, minRotation: 0, @@ -123,7 +126,7 @@ onMount(() => { }) -
+
@@ -131,6 +134,5 @@ onMount(() => { .chart-container { position: relative; width: 100%; - height: 300px; } diff --git a/svelte/src/util/TabMenu.svelte b/svelte/src/util/TabMenu.svelte index af990f0..3b6c067 100644 --- a/svelte/src/util/TabMenu.svelte +++ b/svelte/src/util/TabMenu.svelte @@ -72,8 +72,8 @@ onMount(() => get_page())
-
- {#if current_page} +{#if current_page} +
{#if current_page.subpages} +
+{/if}