1
0

a lot of bugs corrected\nrdc_wc_eclairage

This commit is contained in:
2022-03-13 22:33:26 +01:00
parent 9dde1c2d53
commit c8772aeda0
24 changed files with 534 additions and 191 deletions

View File

@@ -28,7 +28,6 @@ function htmlSend($socket, $text, $meta="")
"Connection: close" . EOLR .
"Content-Type: text/html; charset=UTF-8" . EOLR . EOLR;
$response = $httpHeader . '<!doctype html>' . EOL . '<html lang="fr">' . EOL . '<head>' . EOL . $meta . EOL . '<meta charset="utf-8">' . EOL . '<title>Moha</title>' . EOL . '</head><body>' . EOL . $text . "</body></html>";
stream_socket_sendto($socket, $response);
}
@@ -62,11 +61,13 @@ function askWebServer($read)
$argList["cmd"] = trim($tmp);
}else
{
$argList[trim(strchr($tmp, "=", true))] = trim(substr(strchr($tmp, "="), 1));
$key = trim(strchr($tmp, "=", true));
$argList[$key] = trim(substr(strchr($tmp, "="), 1));
if (count($argTmp) == 1) $argList["cmd"] = $key;
}
}
logger(DEBUG, print_r($argList, true), __FILE__ . ":" . __LINE__);
logger(DEBUG, print_r($argList, true), __FILE__ . ":" . __LINE__);
if(array_key_exists("cmd", $argList))
{
$command = strtolower($argList["cmd"]);
@@ -74,11 +75,11 @@ function askWebServer($read)
switch($command)
{
case "dashboard":
webDashboard($spawn, $argList["dashboard"], $argList["page"]);
webDashboard($spawn, $argList["dashboard"]);
break;
case "browse":
logger(DEBUG, _("Browsing"), __FILE__ . ":" . __LINE__);
webBrowse($spawn, $argList, $argList["page"]);
webBrowse($spawn, $argList);
//return true;
break;
case "get":
@@ -99,6 +100,9 @@ function askWebServer($read)
htmlSend($spawn, webNotify($argList));
logger(DEBUG, print_r($monitored, true), __FILE__ . ":" . __LINE__);
break;
case "type":
logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
htmlSend($spawn, webDisplayByType($argList));
default:
if (is_numeric(array_key_first($argList)))
{