@@ -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 | } |
@@ -195,7 +195,8 @@ |
||
| 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 | } |
@@ -64,7 +64,8 @@ |
||
| 64 | 64 | |
| 65 | 65 | if ($format == 'json') { |
| 66 | 66 | return $this->jsonSerialize(); |
| 67 | - } elseif ($format == 'csv') { |
|
| 67 | + } |
|
| 68 | + elseif ($format == 'csv') { |
|
| 68 | 69 | return $this->csvSerialize(); |
| 69 | 70 | } |
| 70 | 71 | return null; // shouldn't get here |
@@ -52,7 +52,8 @@ discard block |
||
| 52 | 52 | $this->request = $request; |
| 53 | 53 | if (is_null($input)) { |
| 54 | 54 | $this->input = json_decode($request->{'input'}); |
| 55 | - } else { |
|
| 55 | + } |
|
| 56 | + else { |
|
| 56 | 57 | $this->input = $input; |
| 57 | 58 | } |
| 58 | 59 | $this->device = $this->fetchDevice(); |
@@ -72,10 +73,12 @@ discard block |
||
| 72 | 73 | if ($sourceName === 'rrd') { |
| 73 | 74 | if ($format == 'png') { |
| 74 | 75 | $source = $this->createRRDGraph(); |
| 75 | - } else { |
|
| 76 | + } |
|
| 77 | + else { |
|
| 76 | 78 | $source = $this->createRRDXport(); |
| 77 | 79 | } |
| 78 | - } else { |
|
| 80 | + } |
|
| 81 | + else { |
|
| 79 | 82 | throw new UnknownDataSourceException("Source type $source is not supported"); |
| 80 | 83 | } |
| 81 | 84 | |
@@ -52,7 +52,8 @@ discard block |
||
| 52 | 52 | if ($request->device_id) { |
| 53 | 53 | return $EventlogDataTable->forDevice($request->device_id) |
| 54 | 54 | ->render('widgets.eventlog', compact(['tableName', 'action'])); |
| 55 | - } else { |
|
| 55 | + } |
|
| 56 | + else { |
|
| 56 | 57 | return $EventlogDataTable->render('widgets.eventlog', compact(['tableName', 'action'])); |
| 57 | 58 | } |
| 58 | 59 | } |
@@ -95,7 +96,8 @@ discard block |
||
| 95 | 96 | $uptime = Settings::get('uptime_warning', 84600); |
| 96 | 97 | if ($request->user()->hasGlobalRead()) { |
| 97 | 98 | $devices = Device::where('ignore', '=', 0)->get(); |
| 98 | - } else { |
|
| 99 | + } |
|
| 100 | + else { |
|
| 99 | 101 | $devices = User::find($request->user()->user_id)->devices()->where('ignore', '=', 0)->get(); |
| 100 | 102 | } |
| 101 | 103 | $count = ['warn' => 0, 'up' => 0, 'down' => 0]; |
@@ -103,10 +105,12 @@ discard block |
||
| 103 | 105 | if ($device->status == 1) { |
| 104 | 106 | if (($device->uptime < $uptime) && ($device->uptime != '0')) { |
| 105 | 107 | $count['warn']++; |
| 106 | - } else { |
|
| 108 | + } |
|
| 109 | + else { |
|
| 107 | 110 | $count['up']++; |
| 108 | 111 | } |
| 109 | - } else { |
|
| 112 | + } |
|
| 113 | + else { |
|
| 110 | 114 | $count['down']++; |
| 111 | 115 | } |
| 112 | 116 | } |
@@ -137,7 +141,8 @@ discard block |
||
| 137 | 141 | $count['ports']['down'] = Port::isDown()->count(); |
| 138 | 142 | $count['ports']['ignored'] = Port::isIgnored()->count(); |
| 139 | 143 | $count['ports']['disabled'] = Port::isDisabled()->count(); |
| 140 | - } else { |
|
| 144 | + } |
|
| 145 | + else { |
|
| 141 | 146 | $user = User::find($request->user()->user_id); |
| 142 | 147 | |
| 143 | 148 | $count['devices']['total'] = $user->devices()->count(); |