From: vados-dev <192440777+vados-dev@users.noreply.github.com> Date: Mon, 4 May 2026 14:35:04 +0000 (+0300) Subject: Autocommit in repo: ros.vados.ru, generated by owner: root, in 17:35:03 04.05.2026. X-Git-Url: https://git.vados.ru/gitweb.cgi?a=commitdiff_plain;h=c7ab46acecbe86e0772fe7d71045cd53a7ef6503;p=Mikrotiks%2Fros.vados.ru.git Autocommit in repo: ros.vados.ru, generated by owner: root, in 17:35:03 04.05.2026. --- diff --git a/html/AM-GlobalFunc.rsc b/html/AM-GlobalFunc.rsc index 64cb7f131..e92f73555 100644 --- a/html/AM-GlobalFunc.rsc +++ b/html/AM-GlobalFunc.rsc @@ -17,9 +17,9 @@ :global GlobalFuncReady false; # Git commit id & info, expected configuration version -:global CommitId "main/576/0cc4cd57"; +:global CommitId "main/577/ab2aad07"; :global CommitTAG "unknown"; -:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 16:45:02 04.05.2026."; +:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 17:35:03 04.05.2026."; # The variables are received right here. :global GlobalConfVersion 140; @@ -740,16 +740,36 @@ } } +:set CleanFilePath do={ + :local Path [ :tostr $1 ]; + :global CharacterReplace; + :while ($Path ~ "//") do={ + :set $Path [ $CharacterReplace $Path "//" "/" ]; + } + :if ([ :pick $Path 0 ] = "/") do={ + :set Path [ :pick $Path 1 [ :len $Path ] ]; + } + :if ([ :pick $Path ([ :len $Path ] - 1) ] = "/") do={ + :set Path [ :pick $Path 0 ([ :len $Path ] - 1) ]; + } + :return $Path; +} + :set CleanName do={ :local Input [ :tostr $1 ]; :local Return ""; :for I from=0 to=([ :len $Input ] - 1) do={ :local Char [ :pick $Input $I ]; :if ([ :typeof [ find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={ - :do {:if ([ :len $Return ] = 0) do={:error true}; - :if ([ :pick $Return ([ :len $Return ] - 1) ] = "-") do={:error true}; :set Char "-"} on-error={:set Char ""}; - }; - :set Return ($Return . $Char)}; + :do { :if ([ :len $Return ] = 0) do={ :error true; } } + :if ([ :pick $Return ([ :len $Return ] - 1) ] = "-") do={ :error true; } + :set Char "-"; + } on-error={ + :set Char ""; + } + } + :set Return ($Return . $Char); + } :return $Return; } @@ -985,12 +1005,31 @@ :set CleanFilePath do={ :local Path [ :tostr $1 ]; :global CharacterReplace; - :while ($Path ~ "//") do={:set $Path [ $CharacterReplace $Path "//" "/" ]}; - :if ([ :pick $Path 0 ] = "/") do={:set Path [ :pick $Path 1 [ :len $Path ] ]}; - :if ([ :pick $Path ([ :len $Path ] - 1) ] = "/") do={:set Path [ :pick $Path 0 ([ :len $Path ] - 1) ]}; + :while ($Path ~ "//") do={ :set $Path [ $CharacterReplace $Path "//" "/" ]; } + :if ([ :pick $Path 0 ] = "/") do={ :set Path [ :pick $Path 1 [ :len $Path ] ]; } + :if ([ :pick $Path ([ :len $Path ] - 1) ] = "/") do={ :set Path [ :pick $Path 0 ([ :len $Path ] - 1) ]; } :return $Path; } +:set CleanName do={ + :local Input [ :tostr $1 ]; + :local Return ""; + :for I from=0 to=([ :len $Input ] - 1) do={ + :local Char [ :pick $Input $I ]; + :if ([ :typeof [ find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={ + :do { :if ([ :len $Return ] = 0) do={ :error true; } } + :if ([ :pick $Return ([ :len $Return ] - 1) ] = "-") do={ :error true; } + :set Char "-"; + } on-error={ + :set Char ""; + } + } + :set Return ($Return . $Char); + } + :return $Return; +} + + :set IfThenElse do={ :if ([ :tostr $1 ] = "true" || [ :tobool $1 ] = true) do={:return $2}; :return $3;