vless: reset stats user

This commit is contained in:
mercury
2025-01-29 11:04:06 +04:00
parent 34eb950852
commit 7bcd8de007
2 changed files with 24 additions and 0 deletions
+22
View File
@@ -378,6 +378,9 @@ class Bot
case preg_match('~^/renameXrUser (\d+)$~', $this->input['callback'], $m):
$this->renameXrUser($m[1]);
break;
case preg_match('~^/resetXrUser (\d+)$~', $this->input['callback'], $m):
$this->resetXrUser($m[1]);
break;
case preg_match('~^/v2ray$~', $this->input['callback'], $m):
$this->v2ray();
break;
@@ -5312,6 +5315,17 @@ DNS-over-HTTPS with IP:
$this->userXr($i);
}
public function resetXrUser($i)
{
$c = $this->getXray();
$c['inbounds'][0]['settings']['clients'][$i]['global'] = [
'download' => 0,
'upload' => 0,
];
$this->restartXray($c);
$this->userXr($i);
}
public function listXr($i)
{
$c = $this->getPacConf();
@@ -6030,6 +6044,14 @@ DNS-over-HTTPS with IP:
'callback_data' => "/qrXray {$i}_2",
],
];
$download = $this->getBytes($c['global']['download'] + $c['session']['download']);
$upload = $this->getBytes($c['global']['upload'] + $c['session']['upload']);
$data[] = [
[
'text' => $this->i18n('reset stats') . ": ↓$download$upload",
'callback_data' => "/resetXrUser $i",
],
];
$data[] = [
[
'text' => $this->i18n('rename'),
+2
View File
@@ -1,3 +1,5 @@
29.01.2025 v2.7
- vless: сброс статистики юзера
24.01.2025 v2.6
- правки меню
- vless:добавлена возможность маршрутизировать список ip-сетей