Add additional info to the server model
This commit is contained in:
@@ -97,7 +97,12 @@ class Server extends CI_Model {
|
||||
* @param string $serverId
|
||||
*/
|
||||
public function getById($serverId) {
|
||||
return $this->db->get_where('servers', array('id' => $serverId))->row();
|
||||
$this->load->helper('date');
|
||||
$server = $this->db->get_where('servers', array('id' => $serverId))->row();
|
||||
$server->uptimestring = secondsToString($server->uptime);
|
||||
$server->lastheartbeat = sprintf(_('%s ago'),
|
||||
secondsToString(time_diff($server->last_update, mysql_now())));
|
||||
return $server;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user