Add UI for viewing storage space limit

This commit is contained in:
2021-09-07 17:09:52 +02:00
parent ebc7bc34e4
commit f4a9d0595a
6 changed files with 112 additions and 23 deletions

View File

@@ -58,7 +58,12 @@ function loadDirectBW() {
return resp.json();
}).then(resp => {
let total = resp.amounts.reduce((accum, val) => accum += val, 0);
document.getElementById("direct_bandwidth_month").innerText = formatDataVolume(total, 4)
document.getElementById("direct_bandwidth_progress").style.width = (total / window.user.subscription.direct_linking_bandwidth) * 100 + "%"
document.getElementById("direct_bandwidth_text").innerText = formatDataVolume(total, 3) + " out of " + formatDataVolume(window.user.subscription.direct_linking_bandwidth, 3)
document.getElementById("storage_progress").style.width = (window.user.storage_space_used / window.user.subscription.storage_space) * 100 + "%"
document.getElementById("storage_text").innerText = formatDataVolume(window.user.storage_space_used, 3) + " out of " + formatDataVolume(window.user.subscription.storage_space, 3)
}).catch(e => {
console.error("Error requesting time series: " + e);
})