Completed
Push — develop ( 9b97d4...a923a4 )
by Neil
11s
created
app/Settings.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@
 block discarded – undo
185 185
      * Or when the user is not a global admin.
186 186
      *
187 187
      * @param string $key The path to check
188
-     * @return bool|string false or the source: config | auth
188
+     * @return string|false false or the source: config | auth
189 189
      */
190 190
     public function isReadOnly($key)
191 191
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
      */
190 190
     public function isReadOnly($key)
191 191
     {
192
-        if(Config::has('config.'.$key)) {
192
+        if (Config::has('config.'.$key)) {
193 193
             return 'config';
194 194
         }
195 195
         $user = \Auth::user();
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -195,7 +195,8 @@
 block discarded – undo
195 195
         $user = \Auth::user();
196 196
         if (!is_null($user) && $user->isAdmin()) {
197 197
             return false;
198
-        } else {
198
+        }
199
+        else {
199 200
             return 'auth';
200 201
         }
201 202
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Alerting/AlertsController.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
 
26 26
 namespace App\Http\Controllers\Alerting;
27 27
 
28
-use Illuminate\Http\Request;
29 28
 use App\DataTables\AlertsDataTable;
30 29
 use App\Http\Controllers\Controller;
30
+use Illuminate\Http\Request;
31 31
 
32 32
 class AlertsController extends Controller
33 33
 {
Please login to merge, or discard this patch.
app/DataTables/Alerting/LogsDataTable.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 
26 26
 namespace App\DataTables\Alerting;
27 27
 
28
-use App\Models\Alerting\Alert;
29 28
 use App\Models\Alerting\Log;
30 29
 use Yajra\Datatables\Services\DataTable;
31 30
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,8 @@
 block discarded – undo
102 102
             } catch(\Exception $e) {
103 103
                 if(starts_with($e->getMessage(), 'unserialize():')) {
104 104
                     return $value;
105
-                } else {
105
+                }
106
+                else {
106 107
                     throw $e;
107 108
                 }
108 109
             }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 return '<b><span class="fa fa-'.$icon.'" style="color:'.$colour.'"></span> '.$text.'</b>';
83 83
             })
84 84
             ->editColumn('time_logged', function($log) {
85
-                return date('Y-m-d H:i:s', $log->time_logged/1000);
85
+                return date('Y-m-d H:i:s', $log->time_logged / 1000);
86 86
             })
87 87
             ->make(true);
88 88
     }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function query()
96 96
     {
97
-        $logs = Log::with('device','rule')->select('alert_log.*');
97
+        $logs = Log::with('device', 'rule')->select('alert_log.*');
98 98
         return $this->applyScopes($logs);
99 99
     }
100 100
 
Please login to merge, or discard this patch.
app/Http/Controllers/Alerting/LogsController.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
 
26 26
 namespace App\Http\Controllers\Alerting;
27 27
 
28
-use Illuminate\Http\Request;
29 28
 use App\DataTables\AlertsDataTable;
30 29
 use App\Http\Controllers\Controller;
30
+use Illuminate\Http\Request;
31 31
 
32 32
 class AlertsController extends Controller
33 33
 {
Please login to merge, or discard this patch.
app/Http/Controllers/Alerting/StatsController.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
 
26 26
 namespace App\Http\Controllers\Alerting;
27 27
 
28
-use Illuminate\Http\Request;
29
-use App\Models\Alerting\Log;
30 28
 use App\Http\Controllers\Controller;
29
+use App\Models\Alerting\Log;
30
+use Illuminate\Http\Request;
31 31
 
32 32
 class StatsController extends Controller
33 33
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
app/Models/Alerting/Log.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
app/Api/Controllers/General/EventlogController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 
28 28
 use App\Api\Controllers\Controller;
29 29
 use App\Models\General\Eventlog;
30
-use App\Models\Alerting\Log;
31 30
 use Dingo\Api\Http;
32 31
 use Dingo\Api\Routing\Helpers;
33 32
 use Illuminate\Http\Request;
Please login to merge, or discard this patch.