2021-10-19 13:53:28 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Models\Plugin;
|
2024-08-15 15:26:47 -05:00
|
|
|
use LibreNMS\Interfaces\Plugins\PluginManagerInterface;
|
2021-10-19 13:53:28 +02:00
|
|
|
|
|
|
|
|
class PluginAdminController extends Controller
|
|
|
|
|
{
|
2024-08-15 15:26:47 -05:00
|
|
|
public function __invoke(PluginManagerInterface $manager): \Illuminate\Contracts\View\View
|
2021-10-19 13:53:28 +02:00
|
|
|
{
|
|
|
|
|
// legacy v1 plugins
|
|
|
|
|
\LibreNMS\Plugins::scanNew();
|
|
|
|
|
\LibreNMS\Plugins::scanRemoved();
|
|
|
|
|
|
|
|
|
|
// v2 cleanup
|
|
|
|
|
$manager->cleanupPlugins();
|
|
|
|
|
|
|
|
|
|
$plugins = Plugin::get();
|
|
|
|
|
|
|
|
|
|
return view('plugins.admin', [
|
|
|
|
|
'plugins' => $plugins,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|