Skip to content

Commit

Permalink
update MhSanaei
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezax5 committed Apr 24, 2023
1 parent d5dc794 commit 71dedf2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Panel/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -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()]);
Expand Down
16 changes: 16 additions & 0 deletions src/Panel/MHSanaei.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', []);
}
}

0 comments on commit 71dedf2

Please sign in to comment.