From 727ed03be76070341e0f7f88c623057b89283e99 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Thu, 23 Jul 2020 15:16:44 +0200 Subject: [PATCH] Server Fixes --- app/Routes.php | 2 +- app/views/Automation.php | 2 +- app/views/Log.php | 4 +++- app/views/Login.php | 3 +-- app/views/Oauth.php | 4 +--- app/views/Setting.php | 2 +- app/views/templates/log.phtml | 27 ++++++++++++++++----------- app/views/templates/part/menu.phtml | 2 +- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/app/Routes.php b/app/Routes.php index 007ef5d..d6e1eb9 100644 --- a/app/Routes.php +++ b/app/Routes.php @@ -7,7 +7,7 @@ $router->setDefault(function(){ }); //Pages -$router->any('/', 'Log'); +$router->any('/log', 'Log'); $router->any('/login', 'Login'); $router->any('/logout', 'Logout'); $router->any('/automation', 'Automation'); diff --git a/app/views/Automation.php b/app/views/Automation.php index 5f76e22..6b6e20d 100644 --- a/app/views/Automation.php +++ b/app/views/Automation.php @@ -4,7 +4,7 @@ class Automation extends Template function __construct() { $userManager = new UserManager(); - global $lang; + $langMng = new LanguageManager('en'); if (!$userManager->isLogin()){ header('Location: ' . BASEURL . 'login'); diff --git a/app/views/Log.php b/app/views/Log.php index cf95de1..9d2cc50 100644 --- a/app/views/Log.php +++ b/app/views/Log.php @@ -19,7 +19,7 @@ class Log extends Template function __construct() { $userManager = new UserManager(); - global $lang; + $langMng = new LanguageManager('en'); if (!$userManager->isLogin()){ header('Location: ' . BASEURL . 'login'); @@ -48,6 +48,8 @@ class Log extends Template $template->prepare('UPTIME', shell_exec('uptime -p')); $template->prepare('ramFree', $this->getSystemMemInfo()["MemFree"]); $template->prepare('ramTotal', $this->getSystemMemInfo()["MemTotal"]); + + $template->prepare('diskFree', disk_free_space("/")); $template->prepare('diskTotal', disk_total_space("/")); $template->prepare('serverTime', date('m. d. Y H:i:s - e')); diff --git a/app/views/Login.php b/app/views/Login.php index e91c775..72ede1c 100644 --- a/app/views/Login.php +++ b/app/views/Login.php @@ -4,7 +4,7 @@ class Login extends Template function __construct() { $userManager = new UserManager(); - global $lang; + if ($userManager->isLogin()){ header('Location: ' . BASEURL); @@ -13,7 +13,6 @@ class Login extends Template $template = new Template('login'); $template->prepare('baseDir', BASEDIR); $template->prepare('title', 'Home'); - $template->prepare('lang', $lang); diff --git a/app/views/Oauth.php b/app/views/Oauth.php index 1bddb0d..3da5d77 100644 --- a/app/views/Oauth.php +++ b/app/views/Oauth.php @@ -4,14 +4,12 @@ class Oauth extends Template function __construct() { global $userManager; - global $lang; + $langMng = new LanguageManager('en'); $template = new Template('oauth'); $template->prepare('baseDir', BASEDIR); $template->prepare('title', 'Simple Home - Oauth'); - $template->prepare('lang', $lang); - if (isset($_GET['redirect_uri'])) { $template->prepare('responseType', $_GET['response_type']); $template->prepare('redirectUrl', $_GET['redirect_uri']); diff --git a/app/views/Setting.php b/app/views/Setting.php index e173ec1..4c8836f 100644 --- a/app/views/Setting.php +++ b/app/views/Setting.php @@ -5,7 +5,7 @@ class Setting extends Template { $userManager = new UserManager(); - global $lang; + $langMng = new LanguageManager('en'); if (!$userManager->isLogin()){ header('Location: ' . BASEURL . 'login'); diff --git a/app/views/templates/log.phtml b/app/views/templates/log.phtml index b9fbb3f..1eb808e 100644 --- a/app/views/templates/log.phtml +++ b/app/views/templates/log.phtml @@ -22,20 +22,25 @@
-
- -
-
+

get('t_ServerStats'); ?>

+

+
+
+
+
+


- " max="">
- -
-
- - + " max="">
+
+
+
+ " max="">
+
+

get('t_Logs'); ?>

+