mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 15:37:53 +00:00
feat: adapt device models api
This commit is contained in:
parent
a88e72b75e
commit
731d995f20
29 changed files with 2379 additions and 215 deletions
|
|
@ -266,6 +266,22 @@ Route::get('/devices', function (Request $request) {
|
|||
]);
|
||||
})->middleware('auth:sanctum');
|
||||
|
||||
Route::get('/device-models', function (Request $request) {
|
||||
$deviceModels = App\Models\DeviceModel::get([
|
||||
'id',
|
||||
'name',
|
||||
'label',
|
||||
'description',
|
||||
'width',
|
||||
'height',
|
||||
'bit_depth',
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'data' => $deviceModels,
|
||||
]);
|
||||
})->middleware('auth:sanctum');
|
||||
|
||||
Route::post('/display/update', function (Request $request) {
|
||||
$request->validate([
|
||||
'device_id' => 'required|exists:devices,id',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Jobs\CleanupDeviceLogsJob;
|
||||
use App\Jobs\FetchDeviceModelsJob;
|
||||
use App\Jobs\FetchProxyCloudResponses;
|
||||
use App\Jobs\FirmwarePollJob;
|
||||
use App\Jobs\NotifyDeviceBatteryLowJob;
|
||||
|
|
@ -13,4 +14,5 @@ Schedule::job(FetchProxyCloudResponses::class, [])->cron(
|
|||
|
||||
Schedule::job(FirmwarePollJob::class)->daily();
|
||||
Schedule::job(CleanupDeviceLogsJob::class)->daily();
|
||||
Schedule::job(FetchDeviceModelsJob::class)->weekly();
|
||||
Schedule::job(NotifyDeviceBatteryLowJob::class)->dailyAt('10:00');
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ Route::middleware(['auth'])->group(function () {
|
|||
Volt::route('/devices/{device}/configure', 'devices.configure')->name('devices.configure');
|
||||
Volt::route('/devices/{device}/logs', 'devices.logs')->name('devices.logs');
|
||||
|
||||
Volt::route('/device-models', 'device-models.index')->name('device-models.index');
|
||||
|
||||
Volt::route('plugins', 'plugins.index')->name('plugins.index');
|
||||
|
||||
Volt::route('plugins/recipe/{plugin}', 'plugins.recipe')->name('plugins.recipe');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue