Completed
Push — logon-svg ( be6d0e )
by Tony
08:35
created
app/DataTables/Alerting/LogsDataTable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
     {
40 40
         return $this->datatables
41 41
             ->eloquent($this->query())
42
-            ->editColumn('device.hostname', function ($log) {
42
+            ->editColumn('device.hostname', function($log) {
43 43
                 $hostname = is_null($log->device) ? trans('devices.text.deleted') : $log->device->hostname;
44 44
                 return '<a href="'.url("devices/".$log->device_id).'">'.$hostname.'</a>';
45 45
             })
46
-            ->editColumn('rule.name', function ($log) {
46
+            ->editColumn('rule.name', function($log) {
47 47
                 if ($log->rule_id) {
48 48
                     return '<a href="'.url("alerting/rules/".$log->rule_id).'">'.$log->rule->name.'</a>';
49 49
                 } else {
50 50
                     return trans('alerting.general.text.invalid');
51 51
                 }
52 52
             })
53
-            ->editColumn('state', function ($log) {
53
+            ->editColumn('state', function($log) {
54 54
                 $icon   = '';
55 55
                 $colour = '';
56 56
                 $text   = '';
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 }
78 78
                 return '<b><span class="fa fa-'.$icon.'" style="color:'.$colour.'"></span> '.$text.'</b>';
79 79
             })
80
-            ->editColumn('time_logged', function ($log) {
80
+            ->editColumn('time_logged', function($log) {
81 81
                 return date('Y-m-d H:i:s', $log->time_logged / 1000);
82 82
             })
83 83
             ->make(true);
Please login to merge, or discard this patch.
app/DataTables/Alerting/AlertsDataTable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
                                     @else
50 50
                                         <div class="label label-default">UNKNOWN</div>
51 51
                                     @endif')
52
-            ->editColumn('rule.name', function ($alert) {
52
+            ->editColumn('rule.name', function($alert) {
53 53
                 return '<a href="'.url("alerting/rules/".$alert->rule_id).'">'.$alert->rule->name.'</a>';
54 54
             })
55
-            ->editColumn('device.hostname', function ($alert) {
55
+            ->editColumn('device.hostname', function($alert) {
56 56
                 $hostname = is_null($alert->device) ? trans('devices.text.deleted') : $alert->device->hostname;
57 57
                 return '<a href="'.url("devices/".$alert->device_id).'">'.$hostname.'</a>';
58 58
             })
59
-            ->addColumn('actions', function ($alert) {
59
+            ->addColumn('actions', function($alert) {
60 60
                 if ($alert->state == 2) {
61 61
                     $btn  = "btn-danger";
62 62
                     $icon = "volume-off";
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 }
67 67
                 return '<a id="alerts-ack" data-id="'.$alert->id.'" data-state="'.$alert->state.'" class="btn btn-xs '.$btn.'"><i class="fa fa-'.$icon.' fa-fw"></i></a>';
68 68
             })
69
-            ->editColumn('rule.severity', function ($alert) {
69
+            ->editColumn('rule.severity', function($alert) {
70 70
                 return $alert->rule->severity;
71 71
             })
72 72
             ->make(true);
Please login to merge, or discard this patch.
app/DataTables/DeviceGroupDataTable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@
 block discarded – undo
38 38
     {
39 39
         return $this->datatables
40 40
             ->eloquent($this->query())
41
-            ->editColumn('name', function ($group) {
41
+            ->editColumn('name', function($group) {
42 42
                 return '<a href="'.url('devices/group='.$group->id).'">'.$group->name.'</a>';
43 43
             })
44
-            ->editColumn('count', function ($group) {
44
+            ->editColumn('count', function($group) {
45 45
                 return '<span data-toggle="tooltip" title="'.$group->deviceCount.' '.trans('nav.devices.devices').'" class="badge bg-aqua">
46 46
                 <i class="fa fa-server"></i>&nbsp; '.$group->deviceCount.'</span>';
47 47
             })
48
-            ->addColumn('actions', function ($group) {
48
+            ->addColumn('actions', function($group) {
49 49
                 $edit = '<button type="button" class="btn btn-xs btn-primary showModal"  data-toggle="modal" data-target="#generalModal" data-href="'.
50 50
                     route('device-groups.edit', ['group_id' => $group->id]).
51 51
                     '"><i class="fa fa-edit fa-lg fa-fw"></i><span class="hidden-xs"> '.trans('button.edit').'</span></button> ';
Please login to merge, or discard this patch.
app/DataTables/DeviceDataTable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,33 +38,33 @@
 block discarded – undo
38 38
     {
39 39
         return $this->datatables
40 40
             ->eloquent($this->query())
41
-            ->editColumn('status_reason', function ($device) {
41
+            ->editColumn('status_reason', function($device) {
42 42
                 if ($device->status == 0) {
43 43
                     return '<span data-toggle="tooltip" title="down" class="device-status label label-danger">'.$device->status_reason.'</span>';
44 44
                 } else {
45 45
                     return '<span data-toggle="tooltip" title="up" class="device-status label label-success">up</span>';
46 46
                 }
47 47
             })
48
-            ->editColumn('vendor', function ($device) {
48
+            ->editColumn('vendor', function($device) {
49 49
                 return '<img src="'.$device->icon.'" alt="'.$device->os.'">';
50 50
             })
51
-            ->editColumn('hostname', function ($device) {
51
+            ->editColumn('hostname', function($device) {
52 52
                 $hostname = is_null($device) ? trans('devices.text.deleted') : $device->hostname;
53 53
                 return '<a href="'.url("devices/".$device->device_id).'">'.$hostname.'</a>';
54 54
             })
55
-            ->editColumn('resources', function ($device) {
55
+            ->editColumn('resources', function($device) {
56 56
                 $ports   = $device->ports()->count();
57 57
                 $sensors = $device->sensors()->count();
58 58
                 return '<span data-toggle="tooltip" title="'.$ports.' Ports" class="badge bg-light-blue"><i class="fa fa-link"></i>&nbsp; '.$ports.'</span><br />
59 59
                         <span data-toggle="tooltip" title="'.$sensors.' Sensors" class="badge bg-light-blue"><i class="fa fa-dashboard"></i>&nbsp; '.$sensors.'</span>';
60 60
             })
61
-            ->editColumn('hardware', function ($device) {
61
+            ->editColumn('hardware', function($device) {
62 62
                 return $device->hardware.'<br />'.$device->features;
63 63
             })
64
-            ->editColumn('os', function ($device) {
64
+            ->editColumn('os', function($device) {
65 65
                 return ucfirst($device->os).'<br />'.$device->version;
66 66
             })
67
-            ->editColumn('location', function ($device) {
67
+            ->editColumn('location', function($device) {
68 68
                 return $device->formatUptime($device->uptime).'<br />'.$device->location;
69 69
             })
70 70
             ->make(true);
Please login to merge, or discard this patch.
app/DataTables/General/MacDataTable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
     {
41 41
         return $this->datatables
42 42
             ->eloquent($this->query())
43
-            ->editColumn('hostname', function ($data) {
43
+            ->editColumn('hostname', function($data) {
44 44
                 $hostname = is_null($data->device) ? trans('devices.text.deleted') : $data->device->hostname;
45 45
                 return '<a href="'.url("devices/".$data->device_id).'">'.$hostname.'</a>';
46 46
             })
47
-            ->editColumn('ifName', function ($data) {
47
+            ->editColumn('ifName', function($data) {
48 48
                 $ifName = is_null($data->ifName) ? trans('devices.text.deleted') : $data->ifName;
49 49
                 return '<a href="'.url("devices/".$data->device_id."/ports/".$data->port_id).'">'.$ifName.'</a>';
50 50
             })
Please login to merge, or discard this patch.
app/DataTables/General/IPv6DataTable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
     {
41 41
         return $this->datatables
42 42
             ->eloquent($this->query())
43
-            ->editColumn('hostname', function ($data) {
43
+            ->editColumn('hostname', function($data) {
44 44
                 $hostname = is_null($data->device) ? trans('devices.text.deleted') : $data->device->hostname;
45 45
                 return '<a href="'.url("devices/".$data->device_id).'">'.$hostname.'</a>';
46 46
             })
47
-            ->editColumn('ifName', function ($data) {
47
+            ->editColumn('ifName', function($data) {
48 48
                 $ifName = is_null($data->ifName) ? trans('devices.text.deleted') : $data->ifName;
49 49
                 return '<a href="'.url("devices/".$data->device_id."/ports/".$data->port_id).'">'.$ifName.'</a>';
50 50
             })
Please login to merge, or discard this patch.
app/Models/DeviceGroup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
 
174 174
         foreach (Settings::get('alert.macros.group', []) as $macro => $value) {
175
-            $value = str_replace(['%', '&&', '||'], ['', 'AND', 'OR'], $value);  // this might need something more complex
175
+            $value = str_replace(['%', '&&', '||'], ['', 'AND', 'OR'], $value); // this might need something more complex
176 176
             if (!str_contains($macro, ' ')) {
177 177
                 $pattern = str_replace('macros.'.$macro, '('.$value.')', $pattern);
178 178
             }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         $sql = $this->pattern;
299 299
 
300 300
         // fill in parameters
301
-        foreach ((array)$this->params as $value) {
301
+        foreach ((array) $this->params as $value) {
302 302
             if (!is_numeric($value) && !starts_with($value, "'")) {
303 303
                 $value = "'".$value."'";
304 304
             }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         $related = $this->getRelation('deviceCountRelation')->first();
324 324
 
325 325
         // then return the count directly
326
-        return ($related) ? (int)$related->count : 0;
326
+        return ($related) ? (int) $related->count : 0;
327 327
     }
328 328
 
329 329
     /**
Please login to merge, or discard this patch.