Remove kickback fees

This commit is contained in:
2022-09-27 10:31:59 +02:00
parent a4de24ed0c
commit afbb86b8c2
6 changed files with 9 additions and 38 deletions

View File

@@ -203,7 +203,7 @@ onDestroy(() => {
<thead>
<tr>
<td>Address</td>
<td>Pos</td>
<td>Role</td>
<td>Alive</td>
<td>Err</td>
<td>1m</td>
@@ -222,7 +222,7 @@ onDestroy(() => {
class:highlight_green={peer.reachable}
>
<td>{peer.address}</td>
<td>{peer.position}</td>
<td>{peer.role}</td>
<td>{peer.reachable}</td>
<td>{peer.unreachable_count}</td>
<td>{peer.load_1_min.toFixed(1)}</td>

View File

@@ -107,6 +107,8 @@ onMount(() => {
Blocked for abuse
{:else if row.event === "file_instance_expired"}
Expired
{:else if row.event === "file_instance_lost"}
File has been lost
{/if}
</td>
</tr>

View File

@@ -22,12 +22,10 @@ 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
@@ -35,7 +33,6 @@ 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()
@@ -52,7 +49,6 @@ 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(
@@ -86,8 +82,6 @@ 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
@@ -169,23 +163,16 @@ onMount(() => {
label: "Total bandwidth",
borderWidth: 2,
pointRadius: 0,
borderColor: color_by_name("chart_1_color"),
backgroundColor: color_by_name("chart_1_color"),
borderColor: color_by_name("highlight_color"),
backgroundColor: color_by_name("highlight_color"),
},
{
label: "Premium bandwidth",
borderWidth: 2,
pointRadius: 0,
borderColor: color_by_name("chart_2_color"),
backgroundColor: color_by_name("chart_2_color"),
},
{
label: "Kickback bandwidth",
borderWidth: 2,
pointRadius: 0,
borderColor: color_by_name("chart_3_color"),
backgroundColor: color_by_name("chart_3_color"),
},
borderColor: color_by_name("danger_color"),
backgroundColor: color_by_name("danger_color"),
}
];
update_graphs(10080, 60, true);
@@ -343,13 +330,6 @@ onDestroy(() => {
sharing enabled. Bandwidth sharing can be changed on
<a href="/user/subscription">the subscription page</a>.
</p>
<p>
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"/>
@@ -359,7 +339,6 @@ onDestroy(() => {
Total usage from {time_start} to {time_end}<br/>
{formatDataVolume(total_bandwidth, 3)} bandwidth,
{formatDataVolume(total_transfer_paid, 3)} paid transfers
{formatDataVolume(total_transfer_kickback, 3)} kickback transfers
</div>
<h3>Views and downloads</h3>

View File

@@ -33,7 +33,6 @@ 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,
}
@@ -44,7 +43,6 @@ 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
})
transactions = month
@@ -248,7 +246,6 @@ onMount(() => {
<li>Storage charge: <Euro amount={transactions.total_storage_charge}></Euro></li>
<li>Bandwidth charge: <Euro amount={transactions.total_bandwidth_charge}></Euro></li>
<li>Total charge: <Euro amount={transactions.total_deducted}></Euro></li>
<li>Earned: <Euro amount={transactions.total_kickback_fee}></Euro></li>
<li>Deposited: <Euro amount={transactions.total_deposited}></Euro></li>
</ul>
@@ -261,7 +258,6 @@ onMount(() => {
<td>Subscription</td>
<td colspan="2">Storage</td>
<td colspan="2">Bandwidth</td>
<td colspan="2">Kickback</td>
<td>Deposit</td>
</tr>
<tr>
@@ -272,8 +268,6 @@ onMount(() => {
<td>Usage</td>
<td>Charge</td>
<td>Usage</td>
<td>Fee</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
@@ -287,8 +281,6 @@ 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}