@@ -96,7 +96,7 @@ |
||
| 96 | 96 | public function getTimeLoggedAttribute($date) |
| 97 | 97 | { |
| 98 | 98 | if ($date) { |
| 99 | - return strtotime($date)*1000; |
|
| 99 | + return strtotime($date) * 1000; |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function index(Request $request) |
| 40 | 40 | { |
| 41 | - $data = Log::join('alert_rules', 'alert_rules.id', '=', 'alert_log.rule_id')->where('state', '!=', '0')->groupBy('time_logged')->groupBy('alert_rules.severity')->select('time_logged','alert_rules.severity',\DB::raw('COUNT(alert_log.id) as total'))->get(); |
|
| 41 | + $data = Log::join('alert_rules', 'alert_rules.id', '=', 'alert_log.rule_id')->where('state', '!=', '0')->groupBy('time_logged')->groupBy('alert_rules.severity')->select('time_logged', 'alert_rules.severity', \DB::raw('COUNT(alert_log.id) as total'))->get(); |
|
| 42 | 42 | $output = array(); |
| 43 | 43 | foreach ($data as $log) { |
| 44 | 44 | $output[$log->severity]['label'] = $log->severity; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | return '<b><span class="fa fa-'.$icon.'" style="color:'.$colour.'"></span> '.$text.'</b>'; |
| 83 | 83 | }) |
| 84 | 84 | ->editColumn('time_logged', function($this) { |
| 85 | - return date('Y-m-d H:i:s', $this['time_logged']/1000); |
|
| 85 | + return date('Y-m-d H:i:s', $this['time_logged'] / 1000); |
|
| 86 | 86 | }) |
| 87 | 87 | ->make(true); |
| 88 | 88 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function query() |
| 96 | 96 | { |
| 97 | - $logs = Log::query()->with('device','user','rule')->select('alert_log.*'); |
|
| 97 | + $logs = Log::query()->with('device', 'user', 'rule')->select('alert_log.*'); |
|
| 98 | 98 | return $this->applyScopes($logs); |
| 99 | 99 | } |
| 100 | 100 | |