@@ -97,7 +97,8 @@ |
||
| 97 | 97 | $alert->state = $request->input('state'); |
| 98 | 98 | if ($alert->save()) { |
| 99 | 99 | return $this->response->array(array('statusText' => 'OK')); |
| 100 | - } else { |
|
| 100 | + } |
|
| 101 | + else { |
|
| 101 | 102 | return $this->response->errorInternal(); |
| 102 | 103 | } |
| 103 | 104 | } |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | $versions['db_driver'] = strtoupper(DB::connection()->getDriverName()); |
| 19 | 19 | if ($versions['db_driver'] == 'SQLITE') { |
| 20 | 20 | $versions['db_version'] = DB::select('SELECT sqlite_version() AS version')[0]->version; |
| 21 | - } else { |
|
| 21 | + } |
|
| 22 | + else { |
|
| 22 | 23 | $versions['db_version'] = DB::select('SELECT version() AS version')[0]->version; |
| 23 | 24 | } |
| 24 | 25 | return $versions; |
@@ -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 | } |
@@ -93,7 +93,8 @@ |
||
| 93 | 93 | |
| 94 | 94 | if ($this->option('dry-run')) { |
| 95 | 95 | $this->warn(trans('commands.migrate-settings.nochanges')); |
| 96 | - } else { |
|
| 96 | + } |
|
| 97 | + else { |
|
| 97 | 98 | Settings::flush(); // clear the settings cache |
| 98 | 99 | DbConfig::updateOrCreate(['config_name' => 'settings.migrated'], ['config_value' => true]); |
| 99 | 100 | } |
@@ -74,7 +74,8 @@ |
||
| 74 | 74 | } |
| 75 | 75 | if (count($names) > 1) { |
| 76 | 76 | $name = $this->choice('Who would you like to remove?', $names); |
| 77 | - } else { |
|
| 77 | + } |
|
| 78 | + else { |
|
| 78 | 79 | $name = $names[0]; |
| 79 | 80 | } |
| 80 | 81 | if ($this->confirm('Do you wish to remove '.$name.'?')) { |
@@ -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 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Api\Controllers; |
| 4 | 4 | |
| 5 | -use App\Http\Requests; |
|
| 6 | 5 | use Illuminate\Http\Request; |
| 7 | 6 | use JWTAuth; |
| 8 | 7 | use Tymon\JWTAuth\Exceptions\JWTException; |
@@ -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; |