|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* app/Http/Controllers/Widgets/WidgetDataController.php |
|
4
|
|
|
* |
|
5
|
|
|
* HTTP Controller for Widgets data |
|
6
|
|
|
* |
|
7
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
8
|
|
|
* it under the terms of the GNU General Public License as published by |
|
9
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
10
|
|
|
* (at your option) any later version. |
|
11
|
|
|
* |
|
12
|
|
|
* This program is distributed in the hope that it will be useful, |
|
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
|
15
|
|
|
* GNU General Public License for more details. |
|
16
|
|
|
* |
|
17
|
|
|
* You should have received a copy of the GNU General Public License |
|
18
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
19
|
|
|
* |
|
20
|
|
|
* @package LibreNMS |
|
21
|
|
|
* @link http://librenms.org |
|
22
|
|
|
* @copyright 2016 Neil Lathwood |
|
23
|
|
|
* @author Neil Lathwood <[email protected]> |
|
24
|
|
|
*/ |
|
25
|
|
|
|
|
26
|
|
|
namespace App\Http\Controllers\Widgets; |
|
27
|
|
|
|
|
28
|
|
|
use App\DataTables\Alerting\AlertsDataTable; |
|
29
|
|
|
use App\DataTables\General\EventlogDataTable; |
|
30
|
|
|
use App\Http\Controllers\Controller; |
|
31
|
|
|
use Illuminate\Http\Request; |
|
32
|
|
|
|
|
33
|
|
|
class WidgetDataController extends Controller |
|
34
|
|
|
{ |
|
35
|
|
|
/** |
|
36
|
|
|
* Display the eventlog widget. |
|
37
|
|
|
* |
|
38
|
|
|
* @param int $id |
|
|
|
|
|
|
39
|
|
|
* @return \Illuminate\Http\JsonResponse|\Illuminate\View\View |
|
40
|
|
|
*/ |
|
41
|
|
|
public function eventlog(EventlogDataTable $dataTable) |
|
42
|
|
|
{ |
|
43
|
|
|
return $dataTable->render('general.widget'); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Display the alerts widget. |
|
49
|
|
|
* |
|
50
|
|
|
* @param int $id |
|
|
|
|
|
|
51
|
|
|
* @return \Illuminate\Http\JsonResponse|\Illuminate\View\View |
|
52
|
|
|
*/ |
|
53
|
|
|
public function alerts(AlertsDataTable $dataTable) |
|
54
|
|
|
{ |
|
55
|
|
|
return $dataTable->render('general.widget'); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Display the availability-map widget. |
|
60
|
|
|
* |
|
61
|
|
|
* @param int $id |
|
|
|
|
|
|
62
|
|
|
* @return \Illuminate\Http\Response|null |
|
|
|
|
|
|
63
|
|
|
*/ |
|
64
|
|
|
public function availability_map() |
|
|
|
|
|
|
65
|
|
|
{ |
|
66
|
|
|
return view('widgets.availability-map'); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
} |
|
70
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.