improve timer wg

This commit is contained in:
mercury
2023-06-07 00:39:11 +04:00
parent 02d385a555
commit e8be47a1e1
2 changed files with 8 additions and 2 deletions
+6 -2
View File
@@ -513,6 +513,10 @@ class Bot
public function timerClient(string $time, int $client)
{
$clients = $this->readClients();
if ($clients[$client]['# off']) {
$this->switchClient($client);
$clients = $this->readClients();
}
$server = $this->readConfig();
switch (true) {
case preg_match('~^0$~', $time):
@@ -571,7 +575,7 @@ class Bot
public function getTime(int $seconds)
{
$seconds = $seconds - time();
$seconds = ($seconds - time()) > 0 ? $seconds - time() : 0;
$items = [
'Y' => [
'diff' => 1970,
@@ -786,7 +790,7 @@ class Bot
public function switchClient($client)
{
$clients = $this->readClients();
$server = $this->readConfig();
$server = $this->readConfig();
if ($clients[$client]['# off']) {
unset($clients[$client]['# off']);
} else {
+2
View File
@@ -1,3 +1,5 @@
07.06.2023 установка таймера включает пир, если он был выключен
<code>git pull</code>
07.06.2023 адаптация конфига wg под текущий домен/айпи/порт
<code>git pull</code>
06.06.2023 отображение времени жизни пира в виде счетчика