1
0

- lots of debugging

- beginning to add graphical stats
- beginning to add device by type
- added a dashboard "etage"
- begining to add notification to multiple recipients in freemobile hook
This commit is contained in:
2022-03-28 00:40:34 +02:00
parent 80234fc505
commit 0d35b1ff3f
24 changed files with 491 additions and 205 deletions

View File

@@ -10,11 +10,17 @@ $error_code = null;
$listenHost = "0.0.0.0";
$listenPort = 1025;
$Dashboards = array();
for ($m=1; $m<=12; $m++)
{
$months[$m] = date('F', mktime(0,0,0,$m, 1));
}
require_once $configDir . "/aliases.php";
require_once $configDir . "/dashboard_conf.php";
require_once "class/main.php";
require_once "webserver/cmd_functions.php";
//require_once "webserver/display_stats.php";
// opening listening server
$socket = stream_socket_server("tcp://" . $listenHost . ":" . $listenPort, $error_code, $error_message) or logger(ERROR, _("Could not create socket"), __FILE__ . ":" . __LINE__);
@@ -27,7 +33,15 @@ function htmlSend($socket, $text, $meta="")
"Date: " . date("r") . EOLR .
"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>";
$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);
}
@@ -102,7 +116,10 @@ function askWebServer($read)
break;
case "type":
logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
htmlSend($spawn, webDisplayByType($argList));
//htmlSend($spawn, webDisplayByType($argList));
case "stat":
logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
htmlSend($spawn, displayStats($argList));
default:
if (is_numeric(array_key_first($argList)))
{