diff options
| -rw-r--r-- | web/html/xui/client_modal.html | 18 | ||||
| -rw-r--r-- | web/html/xui/form/client.html | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index d90e6156..c01bd10c 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -144,6 +144,24 @@ } document.getElementById("clientIPs").value = "" }, + resetClientTraffic(email,dbInboundId,iconElement) { + this.$confirm({ + title: '{{ i18n "pages.inbounds.resetTraffic"}}', + content: '{{ i18n "pages.inbounds.resetTrafficContent"}}', + class: siderDrawer.isDarkTheme ? darkClass : '', + okText: '{{ i18n "reset"}}', + cancelText: '{{ i18n "cancel"}}', + onOk: async () => { + iconElement.disabled = true; + const msg = await HttpUtil.postWithModal('/xui/inbound/' + dbInboundId + '/resetClientTraffic/'+ email); + if (msg.success) { + this.clientModal.clientStats.up = 0; + this.clientModal.clientStats.down = 0; + } + iconElement.disabled = false; + }, + }) + }, }, }); </script> diff --git a/web/html/xui/form/client.html b/web/html/xui/form/client.html index 2d8c5d2b..330a20c1 100644 --- a/web/html/xui/form/client.html +++ b/web/html/xui/form/client.html @@ -98,6 +98,10 @@ [[ sizeFormat(clientStats.down) ]] ([[ sizeFormat(clientStats.up + clientStats.down) ]]) </a-tag> + <a-tooltip> + <template slot="title">{{ i18n "pages.inbounds.resetTraffic" }}</template> + <a-icon type="retweet" @click="resetClientTraffic(client.email,clientStats.inboundId,$event.target)" v-if="client.email.length > 0"></a-icon> + </a-tooltip> </template> </a-form-item> <a-form-item label='{{ i18n "pages.client.delayedStart" }}'> |
