diff --git a/res/include/script/user_home.js b/res/include/script/user_home.js index 5f91752..bc28dfe 100644 --- a/res/include/script/user_home.js +++ b/res/include/script/user_home.js @@ -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); }) diff --git a/res/template/account/user_home.html b/res/template/account/user_home.html index e03f653..f5d00f5 100644 --- a/res/template/account/user_home.html +++ b/res/template/account/user_home.html @@ -3,7 +3,24 @@
{{template "meta_tags" .User.Username}} {{template "user_style" .}} - + + + @@ -23,29 +40,45 @@ (Manage subscription) {{end}}diff --git a/res/template/home.html b/res/template/home.html index 63a496a..8ce1ecd 100644 --- a/res/template/home.html +++ b/res/template/home.html @@ -74,8 +74,8 @@ window.api_endpoint = '{{.APIEndpoint}}'; window.user_subscription = {{.User.Subscription}}; - - + +
{{template "page_top" .}} @@ -187,6 +187,17 @@ +