Compare commits

..

No commits in common. "74f6779c63bf7d79eebc7090344b58fe44747d7c" and "ff2c51d5052beb44c64e3f5b1d57d7fe7af70f07" have entirely different histories.

10 changed files with 15 additions and 29 deletions

View File

@ -22,15 +22,11 @@ class SettingsManager{
} }
public static function update ($name, $value) { public static function update ($name, $value) {
if ($this.getByName($name)){ try {
$this->create($name, $value); Db::edit ('settings', ['value' => $value], 'WHERE name = ?', array($name));
} else { } catch(PDOException $error) {
try { echo $error->getMessage();
Db::edit ('settings', ['value' => $value], 'WHERE name = ?', array($name)); die();
} catch(PDOException $error) {
echo $error->getMessage();
die();
}
} }
} }
} }

View File

@ -53,7 +53,6 @@ class Automation extends Template
$template = new Template('automation'); $template = new Template('automation');
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('debugMod', DEBUGMOD); $template->prepare('debugMod', DEBUGMOD);
$template->prepare('title', 'Automation'); $template->prepare('title', 'Automation');
$template->prepare('langMng', $langMng); $template->prepare('langMng', $langMng);

View File

@ -19,7 +19,6 @@ class Log extends Template
$result = $this->logFinder ('../logs/', $result); $result = $this->logFinder ('../logs/', $result);
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('debugMod', DEBUGMOD); $template->prepare('debugMod', DEBUGMOD);
$template->prepare('logToLiveTime', LOGTIMOUT); $template->prepare('logToLiveTime', LOGTIMOUT);
$template->prepare('title', 'Logy'); $template->prepare('title', 'Logy');

View File

@ -4,7 +4,7 @@ class Login extends Template
function __construct() function __construct()
{ {
$userManager = new UserManager(); $userManager = new UserManager();
if ($userManager->isLogin()){ if ($userManager->isLogin()){
header('Location: ' . BASEURL); header('Location: ' . BASEURL);
@ -12,7 +12,6 @@ class Login extends Template
$template = new Template('login'); $template = new Template('login');
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('title', 'Home'); $template->prepare('title', 'Home');

View File

@ -8,7 +8,6 @@ class Oauth extends Template
$template = new Template('oauth'); $template = new Template('oauth');
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('title', 'Simple Home - Oauth'); $template->prepare('title', 'Simple Home - Oauth');
if (isset($_GET['redirect_uri'])) { if (isset($_GET['redirect_uri'])) {

View File

@ -22,10 +22,9 @@ class Plugins extends Template
} }
$plugins = Utilities::sortArrayByKey($plugins, 'status', "desc"); $plugins = Utilities::sortArrayByKey($plugins, 'status', "desc");
$template = new Template('plugins'); $template = new Template('plugins');
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('debugMod', DEBUGMOD); $template->prepare('debugMod', DEBUGMOD);
$template->prepare('title', 'Plugins'); $template->prepare('title', 'Plugins');
$template->prepare('langMng', $langMng); $template->prepare('langMng', $langMng);

View File

@ -22,7 +22,7 @@ class Server extends Template
$load = round($loads[0]/($core_nums + 1)*100, 2); $load = round($loads[0]/($core_nums + 1)*100, 2);
return $load; return $load;
} }
function __construct() function __construct()
{ {
$userManager = new UserManager(); $userManager = new UserManager();
@ -36,7 +36,6 @@ class Server extends Template
$template->prepare('title', 'Server'); $template->prepare('title', 'Server');
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('debugMod', DEBUGMOD); $template->prepare('debugMod', DEBUGMOD);
$template->prepare('langMng', $langMng); $template->prepare('langMng', $langMng);

View File

@ -23,7 +23,6 @@ class Setting extends Template
$template = new Template('setting'); $template = new Template('setting');
$template->prepare('baseDir', BASEDIR); $template->prepare('baseDir', BASEDIR);
$template->prepare('baseUrl', BASEURL);
$template->prepare('debugMod', DEBUGMOD); $template->prepare('debugMod', DEBUGMOD);
$template->prepare('title', 'Automation'); $template->prepare('title', 'Automation');
$template->prepare('langMng', $langMng); $template->prepare('langMng', $langMng);

View File

@ -4,8 +4,6 @@
<?php <?php
$partial = new Partial('head'); $partial = new Partial('head');
$partial->prepare('baseDir',$BASEDIR); $partial->prepare('baseDir',$BASEDIR);
$partial->prepare('baseUrl',$BASEURL);
$partial->render(); $partial->render();
?> ?>
<title><?php echo $TITLE ?></title> <title><?php echo $TITLE ?></title>

View File

@ -3,8 +3,7 @@
<head> <head>
<?php <?php
$partial = new Partial('head'); $partial = new Partial('head');
$partial->prepare('baseDir', $BASEDIR); $partial->prepare('baseDir', $BASEDIR);
$partial->prepare('baseUrl', $BASEURL);
$partial->render(); $partial->render();
?> ?>
<title><?php echo $TITLE ?></title> <title><?php echo $TITLE ?></title>
@ -24,23 +23,23 @@
<div class="col-md-9 main-body"> <div class="col-md-9 main-body">
<div class="col-12 col-sm-9 mx-auto mt-4"> <div class="col-12 col-sm-9 mx-auto mt-4">
<h1><?php echo $LANGMNG->get('t_ServerStats'); ?></h1> <h1><?php echo $LANGMNG->get('t_ServerStats'); ?></h1>
<hr> <hr>
<label>UPTIME: <?php echo $UPTIME;?></label></br> <label>UPTIME: <?php echo $UPTIME;?></label></br>
<label>SERVER TIME: <?php echo $SERVERTIME;?></label></br> <label>SERVER TIME: <?php echo $SERVERTIME;?></label></br>
<label>SERVER NAME: <?php echo $NAME;?></label></br> <label>SERVER NAME: <?php echo $NAME;?></label></br>
<label>SERVER ADDRESS: <?php echo $IP;?></label></br> <label>SERVER ADDRESS: <?php echo $IP;?></label></br>
<hr> <hr>
<label>CPU: <?php echo $CPU;?></label></br> <label>CPU: <?php echo $CPU;?></label></br>
<label>CPU Usage: </label><progress value="<?php echo $CPU;?>" max="100"> <?php echo $RAMFREE;?> </progress></br> <label>CPU Usage: </label><progress value="<?php echo $CPU;?>" max="100"> <?php echo $RAMFREE;?> </progress></br>
<hr> <hr>
<label>RAM TOTAL: <?php echo $RAMTOTAL;?></label></br> <label>RAM TOTAL: <?php echo $RAMTOTAL;?></label></br>
<label>RAM FREE: <?php echo $RAMFREE;?></label></br> <label>RAM FREE: <?php echo $RAMFREE;?></label></br>
<label>RAM Usage: </label><progress value="<?php echo explode(" ", $RAMTOTAL)[0] - explode(" ", $RAMFREE)[0];?>" max="<?php echo explode(" ", $RAMTOTAL)[0];?>"> <?php echo $RAMFREE;?> </progress></br> <label>RAM Usage: </label><progress value="<?php echo explode(" ", $RAMTOTAL)[0] - explode(" ", $RAMFREE)[0];?>" max="<?php echo explode(" ", $RAMTOTAL)[0];?>"> <?php echo $RAMFREE;?> </progress></br>
<hr> <hr>
<label>DISK TOTAL: <?php echo $DISKTOTAL;?> bytes</label></br> <label>DISK TOTAL: <?php echo $DISKTOTAL;?> bytes</label></br>
<label>DISK FREE: <?php echo $DISKFREE;?> bytes</label></br> <label>DISK FREE: <?php echo $DISKFREE;?> bytes</label></br>
<label>DISK Usage: </label><progress value="<?php echo explode(" ", $DISKTOTAL)[0] - explode(" ", $DISKFREE)[0];?>" max="<?php echo explode(" ", $DISKTOTAL)[0];?>"> <?php echo $DISKFREE;?> </progress></br> <label>DISK Usage: </label><progress value="<?php echo explode(" ", $DISKTOTAL)[0] - explode(" ", $DISKFREE)[0];?>" max="<?php echo explode(" ", $DISKTOTAL)[0];?>"> <?php echo $DISKFREE;?> </progress></br>
<hr> <hr>
</div> </div>
</div> </div>
@ -50,6 +49,6 @@
$partial->render(); $partial->render();
//TODO js do main.js //TODO js do main.js
?> ?>
</body> </body>
</html> </html>