revert: remove deploy UI, controller, actions, tasks, and routes
- Remove Deploy/Index.vue, DeployController, DeploySiteAction, DeployTask - Remove deploy routes from web.php - Remove deploy menu item from menuConfig - Remove deploy button and methods from Main.vue - Remove deploy logging channel from logging.php - Keep _deploy/ folder for future CI/CD setup
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\UI\WEB\Controllers;
|
||||
|
||||
use App\Containers\Dashboard\Actions\Posts\DeploySiteAction;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class DeployController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DeploySiteAction $deploySiteAction,
|
||||
) {}
|
||||
|
||||
public function index(): \Inertia\Response
|
||||
{
|
||||
$history = $this->deploySiteAction->getHistory();
|
||||
$status = $this->deploySiteAction->getStatus();
|
||||
|
||||
return Inertia::render('Dashboard/Deploy/Index', [
|
||||
'history' => $history['history'],
|
||||
'status' => $status,
|
||||
]);
|
||||
}
|
||||
|
||||
public function deploy(Request $request): JsonResponse
|
||||
{
|
||||
if (app()->environment() !== 'production') {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Деплой доступен только на production',
|
||||
], 403);
|
||||
}
|
||||
|
||||
if (!$request->user()->hasRole('super_admin')) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Недостаточно прав для выполнения этой операции',
|
||||
], 403);
|
||||
}
|
||||
|
||||
$result = $this->deploySiteAction->run();
|
||||
|
||||
return response()->json($result);
|
||||
}
|
||||
|
||||
public function status(Request $request): JsonResponse
|
||||
{
|
||||
if (app()->environment() !== 'production') {
|
||||
return response()->json(['status' => 'disabled'], 403);
|
||||
}
|
||||
|
||||
if (!$request->user()->hasRole('super_admin')) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Недостаточно прав',
|
||||
], 403);
|
||||
}
|
||||
|
||||
$status = $this->deploySiteAction->getStatus();
|
||||
|
||||
return response()->json($status);
|
||||
}
|
||||
|
||||
public function log(Request $request): JsonResponse
|
||||
{
|
||||
if (!$request->user()->hasRole('super_admin')) {
|
||||
return response()->json(['success' => false], 403);
|
||||
}
|
||||
|
||||
$lines = (int) $request->query('lines', 50);
|
||||
$result = $this->deploySiteAction->getLog($lines);
|
||||
|
||||
return response()->json($result);
|
||||
}
|
||||
|
||||
public function history(Request $request): JsonResponse
|
||||
{
|
||||
if (!$request->user()->hasRole('super_admin')) {
|
||||
return response()->json(['success' => false], 403);
|
||||
}
|
||||
|
||||
$result = $this->deploySiteAction->getHistory();
|
||||
|
||||
return response()->json($result);
|
||||
}
|
||||
|
||||
public function clear(Request $request): JsonResponse
|
||||
{
|
||||
if (!$request->user()->hasRole('super_admin')) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Недостаточно прав',
|
||||
], 403);
|
||||
}
|
||||
|
||||
$this->deploySiteAction->clearStatus();
|
||||
|
||||
return response()->json(['success' => true]);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ use App\Containers\Dashboard\UI\WEB\Controllers\CategoryController as NewsCatego
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\ContactWidgetController;
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\CreateSliderController;
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\CustomFormController;
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\DeployController;
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\DepartmentController;
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\PageReferenceListController;
|
||||
use App\Containers\Dashboard\UI\WEB\Controllers\DepartmentProgramController;
|
||||
@@ -63,13 +62,6 @@ Route::post('/dashboard/logout', [AuthenticatedSessionController::class, 'destro
|
||||
// Authenticated dashboard routes
|
||||
Route::middleware(['access-check', 'dashboard.auth'])->group(function () {
|
||||
Route::get('/dashboard', IndexDashboardController::class)->name('dashboard.index');
|
||||
Route::get('/dashboard/deploy', [DeployController::class, 'index'])->name('dashboard.deploy.index');
|
||||
Route::post('/dashboard/deploy', [DeployController::class, 'deploy'])->name('dashboard.deploy');
|
||||
Route::get('/dashboard/deploy/status', [DeployController::class, 'status'])->name('dashboard.deploy.status');
|
||||
Route::get('/dashboard/deploy/log', [DeployController::class, 'log'])->name('dashboard.deploy.log');
|
||||
Route::get('/dashboard/deploy/history', [DeployController::class, 'history'])->name('dashboard.deploy.history');
|
||||
Route::post('/dashboard/deploy/clear', [DeployController::class, 'clear'])->name('dashboard.deploy.clear');
|
||||
|
||||
Route::get('/dashboard/sveden', [SvedenController::class, 'index'])->name('dashboard.sveden');
|
||||
Route::post('/dashboard/sveden', [SvedenController::class, 'store'])->name('dashboard.sveden.store');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user