mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Port Validation Page to Laravel (#13921)
* Revamp validate web page to load page then validate, instead of validate then load page * style fixes * lint cleanups * fixes * translations and a couple fixes * style fixes * move result serialization into the class.
This commit is contained in:
23
app/Http/Controllers/ValidateController.php
Normal file
23
app/Http/Controllers/ValidateController.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use LibreNMS\Validator;
|
||||
|
||||
class ValidateController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
return view('validate.index');
|
||||
}
|
||||
|
||||
public function runValidation(): JsonResponse
|
||||
{
|
||||
$validator = new Validator();
|
||||
$validator->validate();
|
||||
|
||||
return response()->json($validator->toArray());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user