Dev patch 2 (#107)

* [vmess] add client traffic reset

* [vless] add client traffic reset
This commit is contained in:
Hossin Asaadi
2022-11-22 11:24:30 +03:30
committed by GitHub
parent 5bd865a2be
commit 4421fec506
5 changed files with 149 additions and 78 deletions

View File

@@ -112,6 +112,24 @@
}
event.target.value = ""
},
async resetClientTraffic(client,event) {
const msg = await HttpUtil.post('/xui/inbound/resetClientTraffic/'+ client.email);
if (!msg.success) {
return;
}
clientStats = this.inbound.clientStats
if(clientStats.length > 0)
{
for (const key in clientStats) {
if (Object.hasOwnProperty.call(clientStats, key)) {
if(clientStats[key]['email'] == client.email){
clientStats[key]['up'] = 0
clientStats[key]['down'] = 0
}
}
}
}
},
isExpiry(index) {
return this.inbound.isExpiry(index)
},