From f5792c9d824219bc8df3c5ed49f1c66a56ca1823 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sat, 15 Jun 2024 12:43:31 +0200 Subject: [PATCH] show/reset client traffics #129 --- frontend/src/layouts/modals/Client.vue | 35 +++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/frontend/src/layouts/modals/Client.vue b/frontend/src/layouts/modals/Client.vue index ba98039..975743f 100644 --- a/frontend/src/layouts/modals/Client.vue +++ b/frontend/src/layouts/modals/Client.vue @@ -38,6 +38,33 @@ + + +
+
+ {{ $t('stats.usage') }}: {{ total }}({{ percent }}%) +
+ + + {{ $t('reset') }} + + + +
+ + +
+ + {{ up }} + / + {{ down }} + +
0 ? v*(1024 ** 3) : 0 } - } + }, + up() :string { return HumanReadable.sizeFormat(this.client.up) }, + down() :string { return HumanReadable.sizeFormat(this.client.down) }, + total() :string { return HumanReadable.sizeFormat(this.client.down + this.client.up) }, + percent() :number { return this.client.volume>0 ? Math.round((this.client.up + this.client.down) *100 / this.client.volume) : 0 }, + percentColor() :string { return (this.client.up+this.client.down) >= this.client.volume ? 'error' : this.percent>90 ? 'warning' : 'success' }, }, watch: { visible(newValue) {