@@ -213,11 +213,14 @@ |
||
| 213 | 213 | $disabled = $this->disabled; |
| 214 | 214 | if ($disabled == 1) { |
| 215 | 215 | return 'teal'; |
| 216 | - } elseif ($ignore == 1) { |
|
| 216 | + } |
|
| 217 | + elseif ($ignore == 1) { |
|
| 217 | 218 | return 'yellow'; |
| 218 | - } elseif ($status == 0) { |
|
| 219 | + } |
|
| 220 | + elseif ($status == 0) { |
|
| 219 | 221 | return 'danger'; |
| 220 | - } else { |
|
| 222 | + } |
|
| 223 | + else { |
|
| 221 | 224 | return 'success'; |
| 222 | 225 | } |
| 223 | 226 | } |
@@ -58,7 +58,8 @@ discard block |
||
| 58 | 58 | $user_widget->dashboard_id = $request->dashboard_id; |
| 59 | 59 | if ($user_widget->save()) { |
| 60 | 60 | return $this->response->array(array('statusText' => 'OK', 'user_widget_id' => $user_widget->user_widget_id)); |
| 61 | - } else { |
|
| 61 | + } |
|
| 62 | + else { |
|
| 62 | 63 | return $this->response->errorInternal(); |
| 63 | 64 | } |
| 64 | 65 | } |
@@ -99,7 +100,8 @@ discard block |
||
| 99 | 100 | if ($request->input('settings')) { |
| 100 | 101 | $users_widgets = UsersWidgets::find($id); |
| 101 | 102 | $users_widgets->settings = json_encode($request->input('settings')); |
| 102 | - } else { |
|
| 103 | + } |
|
| 104 | + else { |
|
| 103 | 105 | $users_widgets = UsersWidgets::find($id); |
| 104 | 106 | $users_widgets->col = $request->input('x'); |
| 105 | 107 | $users_widgets->row = $request->input('y'); |
@@ -109,7 +111,8 @@ discard block |
||
| 109 | 111 | |
| 110 | 112 | if ($users_widgets->save()) { |
| 111 | 113 | return $this->response->array(array('statusText' => 'OK')); |
| 112 | - } else { |
|
| 114 | + } |
|
| 115 | + else { |
|
| 113 | 116 | return $this->response->errorInternal(); |
| 114 | 117 | } |
| 115 | 118 | } |
@@ -124,7 +127,8 @@ discard block |
||
| 124 | 127 | { |
| 125 | 128 | if (UsersWidgets::destroy($id)) { |
| 126 | 129 | return $this->response->array(array('statusText' => 'OK')); |
| 127 | - } else { |
|
| 130 | + } |
|
| 131 | + else { |
|
| 128 | 132 | return $this->response->errorInternal(); |
| 129 | 133 | } |
| 130 | 134 | } |
@@ -44,7 +44,8 @@ |
||
| 44 | 44 | if (array_key_exists($key, $out)) { |
| 45 | 45 | // concat the values |
| 46 | 46 | $out[$key] = $out[$key].$arr[$key]; |
| 47 | - } else { |
|
| 47 | + } |
|
| 48 | + else { |
|
| 48 | 49 | $out[$key] = $arr[$key]; |
| 49 | 50 | } |
| 50 | 51 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function query() |
| 54 | 54 | { |
| 55 | - $syslog = Syslog::with(['device' => function ($query) { |
|
| 55 | + $syslog = Syslog::with(['device' => function($query) { |
|
| 56 | 56 | return $query->addSelect(['device_id', 'hostname']); |
| 57 | 57 | }])->select('syslog.*'); |
| 58 | 58 | return $this->applyScopes($syslog); |
@@ -41,21 +41,21 @@ |
||
| 41 | 41 | { |
| 42 | 42 | return $this->datatables |
| 43 | 43 | ->eloquent($this->query()) |
| 44 | - ->editColumn('hostname', function ($data) { |
|
| 44 | + ->editColumn('hostname', function($data) { |
|
| 45 | 45 | $hostname = is_null($data->device) ? trans('devices.text.deleted') : $data->device->hostname; |
| 46 | 46 | return '<a href="'.url("devices/".$data->device_id).'">'.$hostname.'</a>'; |
| 47 | 47 | }) |
| 48 | - ->editColumn('ifName', function ($data) { |
|
| 48 | + ->editColumn('ifName', function($data) { |
|
| 49 | 49 | $ifName = is_null($data->ifName) ? trans('devices.text.deleted') : $data->ifName; |
| 50 | 50 | return '<a href="'.url("devices/".$data->device_id."/ports/".$data->port_id).'">'.$ifName.'</a>'; |
| 51 | 51 | }) |
| 52 | - ->addColumn('remote_device', function ($data) { |
|
| 52 | + ->addColumn('remote_device', function($data) { |
|
| 53 | 53 | $remote_device = IPv4::where('ipv4_addresses.ipv4_address', $data->ipv4_address)->with('port.device')->first(); |
| 54 | 54 | $remote_id = empty($remote_device->port->device->device_id) ? '' : $remote_device->port->device->device_id; |
| 55 | 55 | $remote_hostname = empty($remote_device->port->device->hostname) ? '' : $remote_device->port->device->hostname; |
| 56 | 56 | return '<a href="'.url("devices/".$remote_id).'">'.$remote_hostname.'</a>'; |
| 57 | 57 | }) |
| 58 | - ->addColumn('remote_interface', function ($data) { |
|
| 58 | + ->addColumn('remote_interface', function($data) { |
|
| 59 | 59 | $remote_device = IPv4::where('ipv4_addresses.ipv4_address', $data->ipv4_address)->with('port.device')->first(); |
| 60 | 60 | $remote_id = empty($remote_device->port->device->device_id) ? '' : $remote_device->port->device->device_id; |
| 61 | 61 | $remote_port_id = empty($remote_device->port->port_id) ? '' : $remote_device->port->port_id; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | return $this->datatables |
| 41 | 41 | ->eloquent($this->query()) |
| 42 | - ->editColumn('level', function ($user) { |
|
| 42 | + ->editColumn('level', function($user) { |
|
| 43 | 43 | return trans('user.level.'.$user->level); |
| 44 | 44 | }) |
| 45 | 45 | ->editColumn('actions', 'datatables.user.actions') |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | return $this->datatables |
| 42 | 42 | ->eloquent($this->query()) |
| 43 | 43 | ->editColumn('hostname', 'datatables.generic.hostname') |
| 44 | - ->editColumn('ifName', function ($data) { |
|
| 44 | + ->editColumn('ifName', function($data) { |
|
| 45 | 45 | $ifName = is_null($data->ifName) ? trans('devices.text.deleted') : $data->ifName; |
| 46 | 46 | return '<a href="'.url("devices/".$data->device_id."/ports/".$data->port_id).'">'.$ifName.'</a>'; |
| 47 | 47 | }) |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $eventlogs = Device::find($this->device_id)->eventlogs()->select('eventlog.*'); |
| 61 | 61 | } else { |
| 62 | 62 | $eventlogs = Eventlog::with([ |
| 63 | - 'device' => function ($query) { |
|
| 63 | + 'device' => function($query) { |
|
| 64 | 64 | return $query->addSelect(['device_id', 'hostname']); |
| 65 | 65 | }, |
| 66 | 66 | ])->select('eventlog.*'); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function getAjax() |
| 124 | 124 | { |
| 125 | - return url('eventlog?device_id=' . $this->device_id); |
|
| 125 | + return url('eventlog?device_id='.$this->device_id); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | public function forDevice($device_id) |
@@ -58,7 +58,8 @@ |
||
| 58 | 58 | if (is_numeric($this->device_id)) { |
| 59 | 59 | // eventlogs for a single device |
| 60 | 60 | $eventlogs = Device::find($this->device_id)->eventlogs()->select('eventlog.*'); |
| 61 | - } else { |
|
| 61 | + } |
|
| 62 | + else { |
|
| 62 | 63 | $eventlogs = Eventlog::with([ |
| 63 | 64 | 'device' => function ($query) { |
| 64 | 65 | return $query->addSelect(['device_id', 'hostname']); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | public function query() |
| 53 | 53 | { |
| 54 | 54 | $inventory = Inventory::with([ |
| 55 | - 'device' => function ($query) { |
|
| 55 | + 'device' => function($query) { |
|
| 56 | 56 | return $query->addSelect(['device_id', 'hostname']); |
| 57 | 57 | }, |
| 58 | 58 | ])->select('entPhysical.*'); |