mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-13 16:03:04 +00:00
🚀 Refactor Blade
- Optimize Blade JavaScript code. - Refactored multiple admin controllers for improved validation, error handling, and query efficiency. - Added ProxyConfig trait to centralize proxy configuration options. - Updated NodeStatusDetection to use model relationships for heartbeat checks. - Improved category, label, and country management logic and error logging. - Added new Blade components for admin UI and updated language files and assets for better localization and frontend support. - Bug fixed & introduced more bug :)
This commit is contained in:
@@ -23,8 +23,14 @@ class LevelController extends Controller
|
||||
return response()->json(['status' => 'fail', 'message' => $validator->errors()->all()]);
|
||||
}
|
||||
|
||||
if (Level::create($validator->validated())) {
|
||||
return response()->json(['status' => 'success', 'message' => trans('common.success_item', ['attribute' => trans('common.add')])]);
|
||||
try {
|
||||
if (Level::create($validator->validated())) {
|
||||
return response()->json(['status' => 'success', 'message' => trans('common.success_item', ['attribute' => trans('common.add')])]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error(trans('common.error_action_item', ['action' => trans('common.add'), 'attribute' => trans('model.common.level')]).': '.$e->getMessage());
|
||||
|
||||
return response()->json(['status' => 'fail', 'message' => trans('common.failed_item', ['attribute' => trans('common.add')]).', '.$e->getMessage()]);
|
||||
}
|
||||
|
||||
return response()->json(['status' => 'fail', 'message' => trans('common.failed_item', ['attribute' => trans('common.add')])]);
|
||||
@@ -41,8 +47,14 @@ class LevelController extends Controller
|
||||
return response()->json(['status' => 'fail', 'message' => $validator->errors()->all()]);
|
||||
}
|
||||
|
||||
if ($level->update($validator->validated())) {
|
||||
return response()->json(['status' => 'success', 'message' => trans('common.success_item', ['attribute' => trans('common.edit')])]);
|
||||
try {
|
||||
if ($level->update($validator->validated())) {
|
||||
return response()->json(['status' => 'success', 'message' => trans('common.success_item', ['attribute' => trans('common.edit')])]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error(trans('common.error_action_item', ['action' => trans('common.edit'), 'attribute' => trans('model.common.level')]).': '.$e->getMessage());
|
||||
|
||||
return response()->json(['status' => 'fail', 'message' => trans('common.failed_item', ['attribute' => trans('common.edit')]).', '.$e->getMessage()]);
|
||||
}
|
||||
|
||||
return response()->json(['status' => 'fail', 'message' => trans('common.failed_item', ['attribute' => trans('common.edit')])]);
|
||||
|
||||
Reference in New Issue
Block a user