From 71dedf2641b0a06fe7338e229f213ca3a5d8804c Mon Sep 17 00:00:00 2001 From: alirezax5 Date: Mon, 24 Apr 2023 21:18:52 +0330 Subject: [PATCH] update MhSanaei --- src/Panel/Base.php | 6 +++++- src/Panel/MHSanaei.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Panel/Base.php b/src/Panel/Base.php index 076277c..6bb388c 100644 --- a/src/Panel/Base.php +++ b/src/Panel/Base.php @@ -29,6 +29,10 @@ class Base 'updateClient' => '/xui/inbound/updateClient/{id}', 'clientIps' => '/xui/inbound/clientIps/{id}', 'clearClientIps' => '/xui/clearClientIps/{id}', + 'apiMHSanaei_list'=>'/xui/API/inbounds/list/', + 'apiMHSanaei_get'=>'/xui/API/inbounds/get/{id}', + 'apiMHSanaei_get'=>'/xui/API/inbounds/get/{id}', + 'apiMHSanaei_resetAllClientTraffics'=>'/xui/API/inbounds/resetAllClientTraffics/{id}', ]; protected $defaults = [ 'sniffing' => [ @@ -102,7 +106,7 @@ protected function getUrl($path): string if (isset($this->path[$path])) { $urlPath = $this->path[$path]; - $arrPath = ['delInbound', 'inbound', 'updateInbound', 'installXray','delClient','clientIps','clearClientIps']; + $arrPath = ['delInbound', 'inbound', 'updateInbound', 'installXray','delClient','clientIps','clearClientIps','apiMHSanaei_get','apiMHSanaei_resetAllClientTraffics']; $arrPathWithClient = ['resetClientTraffic']; if (in_array($path, $arrPath)) { $urlPath = strtr($this->path[$path], ['{id}' => $this->getId()]); diff --git a/src/Panel/MHSanaei.php b/src/Panel/MHSanaei.php index de9c1db..10a4e9d 100644 --- a/src/Panel/MHSanaei.php +++ b/src/Panel/MHSanaei.php @@ -253,4 +253,20 @@ public function logs() return $this->curl('logs'); } + public function getListsApi() + { + return $this->curl('apiMHSanaei_list', [], false); + } + + public function getApi($id) + { + $this->setId($id); + return $this->curl('apiMHSanaei_get', [], false); + } + + public function resetAllClientTrafficsApi($id) + { + $this->setId($id); + return $this->curl('apiMHSanaei_resetAllClientTraffics', []); + } } \ No newline at end of file