diff --git a/app/bot.php b/app/bot.php index 256dd78..7c3b045 100644 --- a/app/bot.php +++ b/app/bot.php @@ -3639,7 +3639,7 @@ DNS-over-HTTPS with IP: ]; $data[] = [ [ - 'text' => "default: " . $this->i18n('show'), + 'text' => "origin", 'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te"], ], [ @@ -3650,7 +3650,7 @@ DNS-over-HTTPS with IP: foreach ($templates as $k => $v) { $data[] = [ [ - 'text' => "$k: " . $this->i18n('show'), + 'text' => "$k", 'web_app' => ['url' => "https://$domain/pac?h=$hash&t=te&te=" . urlencode($k)], ], [ @@ -3798,6 +3798,12 @@ DNS-over-HTTPS with IP: 'callback_data' => "/choiceTemplate $i", ], ]; + $data[] = [ + [ + 'text' => 'origin', + 'callback_data' => "/choiceTemplate {$i}_" . base64_encode('origin'), + ], + ]; foreach ($templates as $k => $v) { $data[] = [ [ @@ -3945,7 +3951,7 @@ DNS-over-HTTPS with IP: if (empty($v['off'])) { $flag = false; } - $template = $v['template']; + $template = base64_decode($v['template']); break; } } @@ -3953,14 +3959,18 @@ DNS-over-HTTPS with IP: return false; } - if (!empty($template) && !empty($pac['singtemplates'][base64_decode($template)])) { - $c = $pac['singtemplates'][base64_decode($template)]; - } else { - if (!empty($pac['defaulttemplate'])) { - $c = $pac['singtemplates'][base64_decode($pac['defaulttemplate'])]; - } else { + switch (true) { + case !empty($template) && $template == 'origin': + case empty($template) && empty($pac['defaulttemplate']): $c = json_decode(file_get_contents('/config/sing.json'), true); - } + break; + case !empty($template): + $c = $pac['singtemplates'][$template]; + break; + + default: + $c = $pac['singtemplates'][base64_decode($pac['defaulttemplate'])]; + break; } if ($c['dns']['servers'][0]['address'] == '~dns~') { @@ -4161,12 +4171,6 @@ DNS-over-HTTPS with IP: ], ], ]; - $data[] = [ - [ - 'text' => $this->i18n('reset settings'), - 'callback_data' => "/adguardreset", - ], - ]; $data[] = [ [ 'text' => $this->i18n('add upstream'), diff --git a/version b/version index a8cf7fc..30eacbc 100644 --- a/version +++ b/version @@ -1,3 +1,5 @@ +11.04.2024 v1.22 +- улучшение гибкости выбора шаблона sing-box 11.04.2024 v1.21 - фикс доступности адгвард панели при первом запуске 10.04.2024 v1.20