diff --git a/app/api/ServerApi.php b/app/api/ServerApi.php new file mode 100644 index 0000000..4685e98 --- /dev/null +++ b/app/api/ServerApi.php @@ -0,0 +1,28 @@ +requireAuth(); + $response = [ + "cpu_load" => sys_getloadavg()[0], + "uptime" => shell_exec('uptime -p'), + "ramFree" => $this->getSystemMemInfo()["MemFree"], + "ramTotal" => $this->getSystemMemInfo()["MemTotal"], + "diskFree" => disk_free_space("/"), + "diskTotal" => disk_total_space("/"), + "serverTime" => date('m. d. Y H:i:s - e'), + ]; + $this->response($response); + } +}