Add kickback fees
This commit is contained in:
@@ -25,10 +25,12 @@ let load_graphs = async (minutes, interval) => {
|
||||
let downloads = get_graph_data("downloads", start, end, interval);
|
||||
let bandwidth = get_graph_data("bandwidth", start, end, interval);
|
||||
let transfer_paid = get_graph_data("transfer_paid", start, end, interval);
|
||||
let transfer_kickback = get_graph_data("transfer_kickback", start, end, interval);
|
||||
views = await views
|
||||
downloads = await downloads
|
||||
bandwidth = await bandwidth
|
||||
transfer_paid = await transfer_paid
|
||||
transfer_kickback = await transfer_kickback
|
||||
|
||||
graph_views_downloads.data().labels = views.timestamps;
|
||||
graph_views_downloads.data().datasets[0].data = views.amounts
|
||||
@@ -36,6 +38,7 @@ let load_graphs = async (minutes, interval) => {
|
||||
graph_bandwidth.data().labels = bandwidth.timestamps;
|
||||
graph_bandwidth.data().datasets[0].data = bandwidth.amounts
|
||||
graph_bandwidth.data().datasets[1].data = transfer_paid.amounts
|
||||
graph_bandwidth.data().datasets[2].data = transfer_kickback.amounts
|
||||
|
||||
graph_views_downloads.update()
|
||||
graph_bandwidth.update()
|
||||
@@ -150,18 +153,25 @@ onMount(() => {
|
||||
];
|
||||
graph_bandwidth.data().datasets = [
|
||||
{
|
||||
label: "Bandwidth (total)",
|
||||
label: "Total bandwidth",
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: "#"+window.style.highlightColor,
|
||||
backgroundColor: "#"+window.style.highlightColor,
|
||||
borderColor: "#"+window.style.chart1Color,
|
||||
backgroundColor: "#"+window.style.chart1Color,
|
||||
},
|
||||
{
|
||||
label: "Bandwidth (premium)",
|
||||
label: "Premium bandwidth",
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: "#"+window.style.dangerColor,
|
||||
backgroundColor: "#"+window.style.dangerColor,
|
||||
borderColor: "#"+window.style.chart2Color,
|
||||
backgroundColor: "#"+window.style.chart2Color,
|
||||
},
|
||||
{
|
||||
label: "Kickback bandwidth",
|
||||
borderWidth: 2,
|
||||
pointRadius: 0,
|
||||
borderColor: "#"+window.style.chart3Color,
|
||||
backgroundColor: "#"+window.style.chart3Color,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -287,15 +297,22 @@ onDestroy(() => {
|
||||
<section>
|
||||
<h3>Premium transfers and total bandwidth usage</h3>
|
||||
<p>
|
||||
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
|
||||
Total bandwidth usage is the combined bandwidth usage of all the files
|
||||
on your account. This includes paid transfers.
|
||||
</p>
|
||||
<p>
|
||||
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
|
||||
<a href="/user/subscription">the subscription page</a>.
|
||||
</p>
|
||||
<p>
|
||||
Total bandwidth usage is the combined bandwidth usage of all the
|
||||
files on your account. This includes paid transfers.
|
||||
Kickback bandwidth is counted when a paying pixeldrain user downloads
|
||||
one of your files using their data cap. If you are on a prepaid plan
|
||||
this usage will be compensated at a rate of €1 per TB. When this happens
|
||||
a positive transaction will be logged on the
|
||||
<a href="/user/transactions">transactions page</a>.
|
||||
</p>
|
||||
</section>
|
||||
<Chart bind:this={graph_bandwidth} data_type="bytes"/>
|
||||
|
@@ -33,6 +33,7 @@ const load_transactions = async () => {
|
||||
total_subscription_charge: 0,
|
||||
total_storage_charge: 0,
|
||||
total_bandwidth_charge: 0,
|
||||
total_kickback_fee: 0,
|
||||
total_deposited: 0,
|
||||
total_deducted: 0,
|
||||
}
|
||||
@@ -47,6 +48,7 @@ const load_transactions = async () => {
|
||||
month.total_subscription_charge += row.subscription_charge
|
||||
month.total_storage_charge += row.storage_charge
|
||||
month.total_bandwidth_charge += row.bandwidth_charge
|
||||
month.total_kickback_fee += row.kickback_fee
|
||||
month.total_deducted += row.subscription_charge + row.storage_charge + row.bandwidth_charge
|
||||
})
|
||||
months.push(month)
|
||||
@@ -227,6 +229,7 @@ onMount(() => {
|
||||
<li>Storage charge: <Euro amount={month.total_storage_charge}></Euro></li>
|
||||
<li>Bandwidth charge: <Euro amount={month.total_bandwidth_charge}></Euro></li>
|
||||
<li>Total charge: <Euro amount={month.total_deducted}></Euro></li>
|
||||
<li>Earned: <Euro amount={month.total_kickback_fee}></Euro></li>
|
||||
<li>Deposited: <Euro amount={month.total_deposited}></Euro></li>
|
||||
</ul>
|
||||
|
||||
@@ -239,16 +242,19 @@ onMount(() => {
|
||||
<td>Subscription</td>
|
||||
<td colspan="2">Storage</td>
|
||||
<td colspan="2">Bandwidth</td>
|
||||
<td>Deposited</td>
|
||||
<td colspan="2">Kickback</td>
|
||||
<td>Deposit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Charged</td>
|
||||
<td>Charged</td>
|
||||
<td>Used</td>
|
||||
<td>Charged</td>
|
||||
<td>Used</td>
|
||||
<td>Charge</td>
|
||||
<td>Charge</td>
|
||||
<td>Usage</td>
|
||||
<td>Charge</td>
|
||||
<td>Usage</td>
|
||||
<td>Fee</td>
|
||||
<td>Amount</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -262,6 +268,8 @@ onMount(() => {
|
||||
<td>{formatDataVolume(row.storage_used, 3)}</td>
|
||||
<td><Euro amount={row.bandwidth_charge} precision="4"></Euro></td>
|
||||
<td>{formatDataVolume(row.bandwidth_used, 3)}</td>
|
||||
<td><Euro amount={row.kickback_fee} precision="4"></Euro></td>
|
||||
<td>{formatDataVolume(row.kickback_amount, 3)}</td>
|
||||
<td><Euro amount={row.deposit_amount}></Euro></td>
|
||||
</tr>
|
||||
{/each}
|
||||
|
Reference in New Issue
Block a user