mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
feat: inspect device logs
feat: create DeviceLog model on log request feat: implement logs route, logs view feat: implement details on device log timezone, latest 50 log items sort by latest device timestamp cleanup job add tests
This commit is contained in:
parent
04d089c445
commit
c045dc1e85
12 changed files with 425 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use App\Jobs\GenerateScreenJob;
|
||||
use App\Models\Device;
|
||||
use App\Models\DeviceLog;
|
||||
use App\Models\User;
|
||||
use App\Services\ImageGenerationService;
|
||||
use Illuminate\Http\Request;
|
||||
|
|
@ -185,6 +186,11 @@ Route::post('/log', function (Request $request) {
|
|||
$logs = $request->json('log.logs_array', []);
|
||||
foreach ($logs as $log) {
|
||||
\Log::info('Device Log', $log);
|
||||
DeviceLog::create([
|
||||
'device_id' => $device->id,
|
||||
'device_timestamp' => $log['creation_timestamp'] ?? now(),
|
||||
'log_entry' => $log,
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue