use lib\Users; use lib\Temp; $uptime = Uptime::uptime(); $ram = Memory::ram(); $swap = Memory::swap(); $cpu = CPU::cpu(); $cpu_heat = CPU::heat(); $hdd = Storage::hdd(); $hdd_alert = 'success'; for ($i = 0; $i < sizeof($hdd); $i++) { if ($hdd[$i]['alert'] == 'warning') { $hdd_alert = 'warning'; } } $network = Network::connections(); $users = sizeof(Users::connected()); $temp = Temp::temp(); $external_ip = Rbpi::externalIp(); function icon_alert($alert) { echo '<i class="icon-'; switch ($alert) { case 'success': echo 'ok'; break; case 'warning': echo 'warning-sign'; break; default: echo 'exclamation-sign'; }
use lib\Memory; use lib\CPU; use lib\Storage; use lib\Network; use lib\Rbpi; use lib\Users; use lib\Temp; $uptime = Uptime::uptime(); $ram = Memory::ram(); $swap = Memory::swap(); $cpu = CPU::cpu(); $cpu_heat = CPU::heat(); $hdd = Storage::hdd(); $net_connections = Network::connections(); $net_eth = Network::ethernet(); $users = Users::connected(); $temp = Temp::temp(); function icon_alert($alert) { echo '<i class="icon-'; switch ($alert) { case 'success': echo 'ok'; break; case 'warning': echo 'warning-sign'; break; default: echo 'exclamation-sign'; } echo '"></i>';
function build_users($response) { $response['users'] = Users::connected(); return $response; }