@@ -17,12 +17,11 @@ |
||
| 17 | 17 | |
| 18 | 18 | namespace App\Api\Controllers\Alerting; |
| 19 | 19 | |
| 20 | -use App\Api\Transformers\AlertsTransformer; |
|
| 20 | +use App\Api\Controllers\Controller; |
|
| 21 | +use App\Models\Alerting\Alerts; |
|
| 21 | 22 | use Dingo\Api\Http; |
| 22 | 23 | use Dingo\Api\Routing\Helpers; |
| 23 | 24 | use Illuminate\Http\Request; |
| 24 | -use App\Api\Controllers\Controller; |
|
| 25 | -use App\Models\Alerting\Alerts; |
|
| 26 | 25 | |
| 27 | 26 | class AlertsController extends Controller |
| 28 | 27 | { |
@@ -19,9 +19,8 @@ |
||
| 19 | 19 | |
| 20 | 20 | use Illuminate\Http\Request; |
| 21 | 21 | |
| 22 | -use App\Http\Requests; |
|
| 23 | -use App\Http\Controllers\Controller; |
|
| 24 | 22 | use App\DataTables\AlertsDataTable; |
| 23 | +use App\Http\Controllers\Controller; |
|
| 25 | 24 | |
| 26 | 25 | class AlertsController extends Controller |
| 27 | 26 | { |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | public function transform(Alerts $alerts) |
| 32 | 32 | { |
| 33 | 33 | return [ |
| 34 | - 'id' => (int)$alerts->id, |
|
| 34 | + 'id' => (int) $alerts->id, |
|
| 35 | 35 | 'device_id' => $alerts->device_id, |
| 36 | 36 | 'rule_id' => $alerts->rule_id, |
| 37 | 37 | 'state' => $alerts->state, |
@@ -42,13 +42,13 @@ |
||
| 42 | 42 | @else |
| 43 | 43 | <div class="label label-primary">UNKNOWN</div> |
| 44 | 44 | @endif') |
| 45 | - ->editColumn('rule.name', function ($this) { |
|
| 46 | - return '<a href="' . url("alerting/rules/".$this['rule']['id']) . '">' . $this['rule']['name'] . '</a>'; |
|
| 45 | + ->editColumn('rule.name', function($this) { |
|
| 46 | + return '<a href="'.url("alerting/rules/".$this['rule']['id']).'">'.$this['rule']['name'].'</a>'; |
|
| 47 | 47 | }) |
| 48 | - ->editColumn('device.hostname', function ($this) { |
|
| 49 | - return '<a href="' . url("devices/".$this['device']['device_id']) . '">' . $this['device']['hostname'] . '</a>'; |
|
| 48 | + ->editColumn('device.hostname', function($this) { |
|
| 49 | + return '<a href="'.url("devices/".$this['device']['device_id']).'">'.$this['device']['hostname'].'</a>'; |
|
| 50 | 50 | }) |
| 51 | - ->addColumn('actions', function ($this) { |
|
| 51 | + ->addColumn('actions', function($this) { |
|
| 52 | 52 | return ''; |
| 53 | 53 | }) |
| 54 | 54 | ->make(true); |