@@ -25,10 +25,10 @@ |
||
| 25 | 25 | |
| 26 | 26 | namespace App\Http\Controllers\General; |
| 27 | 27 | |
| 28 | +use App\DataTables\General\ArpDataTable; |
|
| 28 | 29 | use App\DataTables\General\IPv4DataTable; |
| 29 | 30 | use App\DataTables\General\IPv6DataTable; |
| 30 | 31 | use App\DataTables\General\MacDataTable; |
| 31 | -use App\DataTables\General\ArpDataTable; |
|
| 32 | 32 | use App\Http\Controllers\Controller; |
| 33 | 33 | use Illuminate\Http\Request; |
| 34 | 34 | |
@@ -82,7 +82,8 @@ discard block |
||
| 82 | 82 | $uptime = Settings::get('uptime_warning', 84600); |
| 83 | 83 | if ($request->user()->hasGlobalRead()) { |
| 84 | 84 | $devices = Device::where('ignore', '=', 0)->get(); |
| 85 | - } else { |
|
| 85 | + } |
|
| 86 | + else { |
|
| 86 | 87 | $devices = User::find($request->user()->user_id)->devices()->where('ignore', '=', 0)->get(); |
| 87 | 88 | } |
| 88 | 89 | $count = ['warn' => 0, 'up' => 0, 'down' => 0]; |
@@ -90,10 +91,12 @@ discard block |
||
| 90 | 91 | if ($device->status == 1) { |
| 91 | 92 | if (($device->uptime < $uptime) && ($device->uptime != '0')) { |
| 92 | 93 | $count['warn']++; |
| 93 | - } else { |
|
| 94 | + } |
|
| 95 | + else { |
|
| 94 | 96 | $count['up']++; |
| 95 | 97 | } |
| 96 | - } else { |
|
| 98 | + } |
|
| 99 | + else { |
|
| 97 | 100 | $count['down']++; |
| 98 | 101 | } |
| 99 | 102 | } |
@@ -122,7 +125,8 @@ discard block |
||
| 122 | 125 | $count['ports']['down'] = Port::isDown()->count(); |
| 123 | 126 | $count['ports']['ignored'] = Port::isIgnored()->count(); |
| 124 | 127 | $count['ports']['disabled'] = Port::isDisabled()->count(); |
| 125 | - } else { |
|
| 128 | + } |
|
| 129 | + else { |
|
| 126 | 130 | $user = User::find($request->user()->user_id); |
| 127 | 131 | |
| 128 | 132 | $count['devices']['total'] = $user->devices()->count(); |