@@ -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 | } |
@@ -38,33 +38,33 @@ |
||
| 38 | 38 | { |
| 39 | 39 | return $this->datatables |
| 40 | 40 | ->eloquent($this->query()) |
| 41 | - ->editColumn('status_reason', function ($device) { |
|
| 41 | + ->editColumn('status_reason', function($device) { |
|
| 42 | 42 | if ($device->status == 0) { |
| 43 | 43 | return '<span data-toggle="tooltip" title="down" class="device-status label label-danger">'.$device->status_reason.'</span>'; |
| 44 | 44 | } else { |
| 45 | 45 | return '<span data-toggle="tooltip" title="up" class="device-status label label-success">up</span>'; |
| 46 | 46 | } |
| 47 | 47 | }) |
| 48 | - ->editColumn('vendor', function ($device) { |
|
| 48 | + ->editColumn('vendor', function($device) { |
|
| 49 | 49 | return '<img src="'.$device->icon.'" alt="'.$device->os.'">'; |
| 50 | 50 | }) |
| 51 | - ->editColumn('hostname', function ($device) { |
|
| 51 | + ->editColumn('hostname', function($device) { |
|
| 52 | 52 | $hostname = is_null($device) ? trans('devices.text.deleted') : $device->hostname; |
| 53 | 53 | return '<a href="'.url("devices/".$device->device_id).'">'.$hostname.'</a>'; |
| 54 | 54 | }) |
| 55 | - ->editColumn('resources', function ($device) { |
|
| 55 | + ->editColumn('resources', function($device) { |
|
| 56 | 56 | $ports = $device->ports()->count(); |
| 57 | 57 | $sensors = $device->sensors()->count(); |
| 58 | 58 | return '<span data-toggle="tooltip" title="'.$ports.' Ports" class="badge bg-light-blue"><i class="fa fa-link"></i> '.$ports.'</span><br /> |
| 59 | 59 | <span data-toggle="tooltip" title="'.$sensors.' Sensors" class="badge bg-light-blue"><i class="fa fa-dashboard"></i> '.$sensors.'</span>'; |
| 60 | 60 | }) |
| 61 | - ->editColumn('hardware', function ($device) { |
|
| 61 | + ->editColumn('hardware', function($device) { |
|
| 62 | 62 | return $device->hardware.'<br />'.$device->features; |
| 63 | 63 | }) |
| 64 | - ->editColumn('os', function ($device) { |
|
| 64 | + ->editColumn('os', function($device) { |
|
| 65 | 65 | return ucfirst($device->os).'<br />'.$device->version; |
| 66 | 66 | }) |
| 67 | - ->editColumn('location', function ($device) { |
|
| 67 | + ->editColumn('location', function($device) { |
|
| 68 | 68 | return $device->formatUptime($device->uptime).'<br />'.$device->location; |
| 69 | 69 | }) |
| 70 | 70 | ->make(true); |
@@ -41,7 +41,8 @@ |
||
| 41 | 41 | ->editColumn('status_reason', function ($device) { |
| 42 | 42 | if ($device->status == 0) { |
| 43 | 43 | return '<span data-toggle="tooltip" title="down" class="device-status label label-danger">'.$device->status_reason.'</span>'; |
| 44 | - } else { |
|
| 44 | + } |
|
| 45 | + else { |
|
| 45 | 46 | return '<span data-toggle="tooltip" title="up" class="device-status label label-success">up</span>'; |
| 46 | 47 | } |
| 47 | 48 | }) |