Server informations
This commit is contained in:
		@@ -3,6 +3,19 @@
 | 
			
		||||
 | 
			
		||||
class Log extends Template
 | 
			
		||||
{
 | 
			
		||||
	//TODO: to server manager
 | 
			
		||||
	function getSystemMemInfo()
 | 
			
		||||
	{
 | 
			
		||||
		$data = explode("\n", file_get_contents("/proc/meminfo"));
 | 
			
		||||
		$meminfo = array();
 | 
			
		||||
		foreach ($data as $line) {
 | 
			
		||||
			$data = explode(":", $line);
 | 
			
		||||
			if (count($data)!=2) continue;
 | 
			
		||||
			$meminfo[$data[0]] = trim($data[1]);
 | 
			
		||||
		}
 | 
			
		||||
		return $meminfo;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	function __construct()
 | 
			
		||||
	{
 | 
			
		||||
		global $userManager;
 | 
			
		||||
@@ -31,6 +44,16 @@ class Log extends Template
 | 
			
		||||
		$template->prepare('title', 'Logy');
 | 
			
		||||
		$template->prepare('logsFiles', $result);
 | 
			
		||||
		$template->prepare('langMng', $langMng);
 | 
			
		||||
		$template->prepare('CPU', sys_getloadavg()[0]);
 | 
			
		||||
		$template->prepare('UPTIME', shell_exec('uptime -p'));
 | 
			
		||||
		$template->prepare('ramFree', $this->getSystemMemInfo()["MemFree"]);
 | 
			
		||||
		$template->prepare('ramTotal', $this->getSystemMemInfo()["MemTotal"]);
 | 
			
		||||
		$template->prepare('diskTotal', disk_total_space("/"));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		$template->render();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,18 @@
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="col-md-9 main-body">
 | 
			
		||||
            <div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
                <label><?php echo $LANGMNG->get('l_logMaxLiveTime') . " " . $LOGTOLIVETIME . " days";?></label>
 | 
			
		||||
                <label><?php echo $LANGMNG->get('l_logMaxLiveTime') . " " . $LOGTOLIVETIME . " days";?></label></br>
 | 
			
		||||
 | 
			
		||||
                <label>CPU: <?php echo $CPU;?></label></br>
 | 
			
		||||
					 <progress value="<?php echo $CPU;?>" max="1"> <?php echo $RAMFREE;?> </progress></br>
 | 
			
		||||
                <label>UPTIME: <?php echo $UPTIME;?></label></br>
 | 
			
		||||
                <label>RAM TOTAL: <?php echo $RAMTOTAL;?></label></br>
 | 
			
		||||
                <label>RAM FREE: <?php echo $RAMFREE;?></label></br>
 | 
			
		||||
					 <progress value="<?php echo explode(" ", $RAMFREE)[0];?>" max="<?php echo explode(" ", $RAMTOTAL)[0];?>"> <?php echo $RAMFREE;?> </progress></br>
 | 
			
		||||
 | 
			
		||||
                <label>DISKTOTAL: <?php echo $DISKTOTAL;?> bytes available</label></br>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                <form method="post" action="">
 | 
			
		||||
                    <div class="field">
 | 
			
		||||
                        <select class="input" name="LogFile">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user