@@ -25,7 +25,6 @@ |
||
| 25 | 25 | |
| 26 | 26 | namespace App\DataTables; |
| 27 | 27 | |
| 28 | -use App\Models\DeviceGroup; |
|
| 29 | 28 | use App\Models\Device; |
| 30 | 29 | |
| 31 | 30 | class DeviceDataTable extends BaseDataTable |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | 5 | use App\DataTables\DeviceDataTable; |
| 6 | -use App\DataTables\DeviceGroupDataTable; |
|
| 7 | 6 | use App\Models\DeviceGroup; |
| 8 | 7 | use Dingo\Api\Http; |
| 9 | 8 | use Dingo\Api\Routing\Helpers; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * Store a newly created resource in storage. |
| 59 | 59 | * |
| 60 | 60 | * @param \Illuminate\Http\Request $request |
| 61 | - * @return \Illuminate\Http\Response |
|
| 61 | + * @return \Illuminate\Http\JsonResponse |
|
| 62 | 62 | */ |
| 63 | 63 | public function store(DeviceGroupRequest $request) |
| 64 | 64 | { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * Display the specified resource. |
| 72 | 72 | * |
| 73 | 73 | * @param int $id |
| 74 | - * @return \Illuminate\Http\Response |
|
| 74 | + * @return \Illuminate\Http\RedirectResponse |
|
| 75 | 75 | */ |
| 76 | 76 | public function show($id) |
| 77 | 77 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * |
| 96 | 96 | * @param \Illuminate\Http\Request $request |
| 97 | 97 | * @param int $id |
| 98 | - * @return \Illuminate\Http\Response |
|
| 98 | + * @return \Illuminate\Http\JsonResponse |
|
| 99 | 99 | */ |
| 100 | 100 | public function update(DeviceGroupRequest $request, $id) |
| 101 | 101 | { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @param \Illuminate\Http\Request $request |
| 112 | 112 | * @param int $id |
| 113 | - * @return \Illuminate\Http\Response |
|
| 113 | + * @return \Illuminate\Http\JsonResponse |
|
| 114 | 114 | * @throws \Exception |
| 115 | 115 | */ |
| 116 | 116 | public function destroy(AdminOnlyRequest $request, $id) |
@@ -203,7 +203,7 @@ |
||
| 203 | 203 | * Convert a v1 device group pattern to v2 style |
| 204 | 204 | * |
| 205 | 205 | * @param $pattern |
| 206 | - * @return array |
|
| 206 | + * @return string |
|
| 207 | 207 | */ |
| 208 | 208 | private function convertV1Pattern($pattern) |
| 209 | 209 | { |
@@ -38,6 +38,9 @@ |
||
| 38 | 38 | return json_encode(self::generateMacroFilter('alert.macros.rule', self::generateTableFilter())); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $setting |
|
| 43 | + */ |
|
| 41 | 44 | private static function generateMacroFilter($setting, $filter = []) |
| 42 | 45 | { |
| 43 | 46 | foreach (Settings::get($setting, []) as $key => $value) { |