fix:HTMX 네비게이션 리다이렉트 처리 개선
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
use App\Models\Admin\AdminApiFlowRun;
|
||||
use App\Services\FlowTester\FlowExecutor;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/**
|
||||
@@ -19,8 +20,13 @@ class FlowTesterController extends Controller
|
||||
/**
|
||||
* 플로우 목록
|
||||
*/
|
||||
public function index(): View
|
||||
public function index(Request $request): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드 (스크립트 로딩을 위해)
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('dev-tools.flow-tester.index'));
|
||||
}
|
||||
|
||||
$flows = AdminApiFlow::with('latestRun')
|
||||
->orderByDesc('created_at')
|
||||
->paginate(20);
|
||||
@@ -36,8 +42,13 @@ public function index(): View
|
||||
/**
|
||||
* 플로우 생성 폼
|
||||
*/
|
||||
public function create(): View
|
||||
public function create(Request $request): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('dev-tools.flow-tester.create'));
|
||||
}
|
||||
|
||||
return view('dev-tools.flow-tester.create');
|
||||
}
|
||||
|
||||
@@ -66,8 +77,13 @@ public function store(Request $request)
|
||||
/**
|
||||
* 플로우 편집 폼
|
||||
*/
|
||||
public function edit(int $id): View
|
||||
public function edit(Request $request, int $id): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('dev-tools.flow-tester.edit', $id));
|
||||
}
|
||||
|
||||
$flow = AdminApiFlow::findOrFail($id);
|
||||
|
||||
return view('dev-tools.flow-tester.edit', compact('flow'));
|
||||
@@ -315,8 +331,13 @@ public function runStatus(int $runId)
|
||||
/**
|
||||
* 실행 이력 목록
|
||||
*/
|
||||
public function history(int $id): View
|
||||
public function history(Request $request, int $id): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('dev-tools.flow-tester.history', $id));
|
||||
}
|
||||
|
||||
$flow = AdminApiFlow::findOrFail($id);
|
||||
$runs = $flow->runs()
|
||||
->orderByDesc('created_at')
|
||||
@@ -328,8 +349,13 @@ public function history(int $id): View
|
||||
/**
|
||||
* 실행 상세 보기
|
||||
*/
|
||||
public function runDetail(int $runId): View
|
||||
public function runDetail(Request $request, int $runId): View|Response
|
||||
{
|
||||
// HTMX 요청 시 전체 페이지 리로드
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('dev-tools.flow-tester.run-detail', $runId));
|
||||
}
|
||||
|
||||
$run = AdminApiFlowRun::with('flow')->findOrFail($runId);
|
||||
|
||||
return view('dev-tools.flow-tester.run-detail', compact('run'));
|
||||
|
||||
Reference in New Issue
Block a user