attempt to save page when changing domain list

This commit is contained in:
mercury
2025-12-10 00:01:02 +04:00
parent c140f292e8
commit e07d1505e4
+17 -17
View File
@@ -561,8 +561,8 @@ class Bot
case preg_match('~^/addNipdomain$~', $this->input['callback'], $m): case preg_match('~^/addNipdomain$~', $this->input['callback'], $m):
$this->addNipdomain(); $this->addNipdomain();
break; break;
case preg_match('~^/(?P<action>change|delete)(?P<typelist>\w+) (?P<arg>\d+)$~', $this->input['callback'], $m): case preg_match('~^/(?P<action>change|delete)(?P<typelist>\w+) (?P<arg>\d+)(?: (?P<page>\d+))?$~', $this->input['callback'], $m):
$this->listPacChange($m['typelist'], $m['action'], $m['arg']); $this->listPacChange($m['typelist'], $m['action'], $m['arg'], $m['page'] ?: 0);
break; break;
case preg_match('~^/paczapret$~', $this->input['callback'], $m): case preg_match('~^/paczapret$~', $this->input['callback'], $m):
$this->pacZapret(); $this->pacZapret();
@@ -2972,42 +2972,42 @@ DNS-over-HTTPS with IP:
$page = (int) floor(array_search($v, array_keys($conf[$type])) / $this->limit); $page = (int) floor(array_search($v, array_keys($conf[$type])) / $this->limit);
} }
$page = $page ?: -2; $page = $page ?: -2;
$this->backXtlsList($type); $this->backXtlsList($type, $page);
} }
public function backXtlsList($type) public function backXtlsList($type, $page = 0)
{ {
switch ($type) { switch ($type) {
case 'includelist': case 'includelist':
$this->pacUpdate($_SESSION['proxylistentry']); $this->pacUpdate($_SESSION['proxylistentry']);
if (!empty($_SESSION['proxylistentry'])) { if (!empty($_SESSION['proxylistentry'])) {
$this->xtlsproxy(); $this->xtlsproxy($page);
} }
break; break;
case 'blocklist': case 'blocklist':
$this->xrayUpdateRules(); $this->xrayUpdateRules();
$this->xtlsblock(); $this->xtlsblock($page);
break; break;
case 'warplist': case 'warplist':
$this->xrayUpdateRules(); $this->xrayUpdateRules();
$this->xtlswarp(); $this->xtlswarp($page);
break; break;
case 'processlist': case 'processlist':
$this->xtlsprocess(); $this->xtlsprocess($page);
break; break;
case 'packagelist': case 'packagelist':
$this->xtlsapp(); $this->xtlsapp($page);
break; break;
case 'subnetlist': case 'subnetlist':
$this->xtlssubnet(); $this->xtlssubnet($page);
break; break;
case 'rulessetlist': case 'rulessetlist':
$this->xtlsrulesset(); $this->xtlsrulesset($page);
break; break;
case 'white': case 'white':
case 'deny': case 'deny':
$this->syncDeny(); $this->syncDeny();
$this->denyList(0, $type == 'white' ? 1 : 0); $this->denyList($page, $type == 'white' ? 1 : 0);
break; break;
} }
} }
@@ -4425,11 +4425,11 @@ DNS-over-HTTPS with IP:
$data[] = [ $data[] = [
[ [
'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . (in_array($type, ['rulessetlist', 'packagelist', 'processlist', 'subnetlist']) ? $k : idn_to_utf8($k)), 'text' => $this->i18n($v ? 'on' : 'off') . ' ' . ($basename ? basename($k) . ' ' : '') . (in_array($type, ['rulessetlist', 'packagelist', 'processlist', 'subnetlist']) ? $k : idn_to_utf8($k)),
'callback_data' => "/change$type " . ($i + $page * $this->limit), 'callback_data' => "/change$type " . ($i + $page * $this->limit) . " $page",
], ],
[ [
'text' => 'delete', 'text' => 'delete',
'callback_data' => "/delete$type " . ($i + $page * $this->limit), 'callback_data' => "/delete$type " . ($i + $page * $this->limit) . " $page",
], ],
]; ];
$i++; $i++;
@@ -4475,7 +4475,7 @@ DNS-over-HTTPS with IP:
return [$data, $text]; return [$data, $text];
} }
public function listPacChange($type, $action, $key) public function listPacChange($type, $action, $key, $page = 0)
{ {
$conf = $this->getPacConf(); $conf = $this->getPacConf();
$i = 0; $i = 0;
@@ -4494,7 +4494,7 @@ DNS-over-HTTPS with IP:
$i++; $i++;
} }
$this->setPacConf($conf); $this->setPacConf($conf);
$this->backXtlsList($type); $this->backXtlsList($type, $page);
} }
public function pacZapret() public function pacZapret()
@@ -4921,7 +4921,7 @@ DNS-over-HTTPS with IP:
'wg' => $type == 'wg' ? $this->statusWg($arg) : false, 'wg' => $type == 'wg' ? $this->statusWg($arg) : false,
'client' => $type == 'client' ? $this->getClient(...explode('_', $arg)) : false, 'client' => $type == 'client' ? $this->getClient(...explode('_', $arg)) : false,
'addpeer' => $type == 'addpeer' ? $this->addWg(...explode('_', $arg)) : false, 'addpeer' => $type == 'addpeer' ? $this->addWg(...explode('_', $arg)) : false,
'pac' => $type == 'pac' ? $this->pacMenu($arg) : false, 'pac' => $type == 'pac' ? $this->pacMenu((int) $arg) : false,
'adguard' => $type == 'adguard' ? $this->adguardMenu() : false, 'adguard' => $type == 'adguard' ? $this->adguardMenu() : false,
'config' => $type == 'config' ? $this->configMenu() : false, 'config' => $type == 'config' ? $this->configMenu() : false,
'ss' => $type == 'ss' ? $this->menuSS() : false, 'ss' => $type == 'ss' ? $this->menuSS() : false,