diff --git a/app/Admin/Controllers/WarningNoticeController.php b/app/Admin/Controllers/WarningNoticeController.php index d0c069b..7a9c795 100644 --- a/app/Admin/Controllers/WarningNoticeController.php +++ b/app/Admin/Controllers/WarningNoticeController.php @@ -33,7 +33,7 @@ class WarningNoticeController extends AdminController TableColumn::make()->name('lv')->type('mapping')->map(WarningNotice::lvMap())->label('报警等级')->className('text-primary'), TableColumn::make()->name('content')->label('报警内容'), - // TableColumn::make()->name('status')->label('状态'),//可以忽略 + TableColumn::make()->name('status')->label('状态')->type('mapping')->map(WarningNotice::stateMapLabel())->className('text-primary'), TableColumn::make()->name('created_at')->label('报警时间')->type('datetime')->sortable(true), ]); @@ -52,4 +52,10 @@ class WarningNoticeController extends AdminController ]); } + + //标记已处理警报内容; + public function updateNotice() + { + + } } \ No newline at end of file diff --git a/app/Http/Controllers/Api/SettingController.php b/app/Http/Controllers/Api/SettingController.php index 604c0d7..96c61ef 100644 --- a/app/Http/Controllers/Api/SettingController.php +++ b/app/Http/Controllers/Api/SettingController.php @@ -27,4 +27,10 @@ class SettingController extends Controller } return $this->json($data); } + + public function rtspToFlvHost(){ + $rtspUrl = settings()->get('rtsp_url') ?? ''; + + return $this->json(['host_url'=>$rtspUrl]); + } } diff --git a/app/Models/WarningNotice.php b/app/Models/WarningNotice.php index 112818c..b8b7ab4 100644 --- a/app/Models/WarningNotice.php +++ b/app/Models/WarningNotice.php @@ -23,6 +23,24 @@ class WarningNotice extends Model ]; } + public static function stateMap(){ + return [ + '0'=>'未处理', + '1'=>'已处理', + '2'=>'已忽略' + ]; + } + + public static function stateMapLabel() + { + return [ + '0' => "未处理", + '1'=> "已处理", + '2' => "已忽略", + '*'=>'其他:${status}' + ]; + } + public function loggable(){ return $this->morphTo(); } diff --git a/routes/api.php b/routes/api.php index c91592c..f5e43cb 100644 --- a/routes/api.php +++ b/routes/api.php @@ -41,6 +41,8 @@ Route::group(['middleware' => 'auth:sanctum'], function () { Route::get('monitor-modes', [MonitorModeController::class, 'getMonitorMode'])->name('monitor_modes.list'); Route::get('monitor-modes/device-data', [MonitorModeController::class, 'getMonitorDeviceData'])->name('monitor_modes.device_data'); Route::get('static/base-data', [SettingController::class, 'staticBaseData'])->name('static.base_data'); + Route::get('static/rtsp-to-flv-host', [SettingController::class, 'rtspToFlvHost'])->name('static.rtsp_to_flv_host'); + Route::get('warning-notices/nums', [WarningNoticeController::class, 'warningLogNum']); Route::get('warning-notices/logs', [WarningNoticeController::class, 'warningLog']); diff --git a/routes/web.php b/routes/web.php index 6628867..1c62a65 100644 --- a/routes/web.php +++ b/routes/web.php @@ -17,9 +17,7 @@ Route::prefix('callback')->group(function () { Route::post('linkos', \App\Http\Controllers\Callback\LinkosCallbackController::class); }); -Route::get('/', function () { - return view('welcome'); -}); +Route::redirect('/', '/admin', 302); $router->get('regions-position/{id}', [\App\Admin\Controllers\RegionController::class, 'setRegionPosition']); $router->post('regions-position/save', [\App\Admin\Controllers\RegionController::class, 'saveRegionPosition']);