@@ -121,7 +121,8 @@ discard block |
||
| 121 | 121 | $uptime = Settings::get('uptime_warning', 84600); |
| 122 | 122 | if ($request->user()->hasGlobalRead()) { |
| 123 | 123 | $devices = Device::where('ignore', '=', 0)->get(); |
| 124 | - } else { |
|
| 124 | + } |
|
| 125 | + else { |
|
| 125 | 126 | $devices = User::find($request->user()->user_id)->devices()->where('ignore', '=', 0)->get(); |
| 126 | 127 | } |
| 127 | 128 | $counts = ['warn' => 0, 'up' => 0, 'down' => 0]; |
@@ -129,10 +130,12 @@ discard block |
||
| 129 | 130 | if ($device->status == 1) { |
| 130 | 131 | if (($device->uptime < $uptime) && ($device->uptime != '0')) { |
| 131 | 132 | $counts['warn']++; |
| 132 | - } else { |
|
| 133 | + } |
|
| 134 | + else { |
|
| 133 | 135 | $counts['up']++; |
| 134 | 136 | } |
| 135 | - } else { |
|
| 137 | + } |
|
| 138 | + else { |
|
| 136 | 139 | $counts['down']++; |
| 137 | 140 | } |
| 138 | 141 | } |