Compare commits

...

1 Commits

Author SHA1 Message Date
mercury 7bcd8de007 vless: reset stats user 2025-01-29 11:04:06 +04:00
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): case preg_match('~^/renameXrUser (\d+)$~', $this->input['callback'], $m):
$this->renameXrUser($m[1]); $this->renameXrUser($m[1]);
break; break;
case preg_match('~^/resetXrUser (\d+)$~', $this->input['callback'], $m):
$this->resetXrUser($m[1]);
break;
case preg_match('~^/v2ray$~', $this->input['callback'], $m): case preg_match('~^/v2ray$~', $this->input['callback'], $m):
$this->v2ray(); $this->v2ray();
break; break;
@@ -5312,6 +5315,17 @@ DNS-over-HTTPS with IP:
$this->userXr($i); $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) public function listXr($i)
{ {
$c = $this->getPacConf(); $c = $this->getPacConf();
@@ -6030,6 +6044,14 @@ DNS-over-HTTPS with IP:
'callback_data' => "/qrXray {$i}_2", '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[] = [ $data[] = [
[ [
'text' => $this->i18n('rename'), 'text' => $this->i18n('rename'),
+2
View File
@@ -1,3 +1,5 @@
29.01.2025 v2.7
- vless: сброс статистики юзера
24.01.2025 v2.6 24.01.2025 v2.6
- правки меню - правки меню
- vless:добавлена возможность маршрутизировать список ip-сетей - vless:добавлена возможность маршрутизировать список ip-сетей