feat:코드그룹 DB기반 관리, 스코프 필터, 동기화 테넌트명 표시
- 공통코드/카테고리: 하드코딩 그룹 라벨 제거, DB description 기반으로 전환 - 코드그룹 신규 생성 기능 추가 (사이드바 + 모달, TenantSetting 저장) - 글로벌/테넌트 스코프 분류 및 필터 버튼 (전체/글로벌/테넌트) - 사이드바 컴팩트 레이아웃 (100+ 그룹 대응) - 동기화 페이지 3종(메뉴/공통코드/카테고리) 테넌트 회사명 표시 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Commons\Menu;
|
||||
use App\Models\Tenants\Tenant;
|
||||
use App\Models\Tenants\TenantSetting;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -12,6 +13,8 @@
|
||||
|
||||
class MenuSyncController extends Controller
|
||||
{
|
||||
private ?string $remoteTenantName = null;
|
||||
|
||||
/**
|
||||
* 현재 선택된 테넌트 ID
|
||||
*/
|
||||
@@ -50,12 +53,16 @@ public function index(Request $request): View|Response
|
||||
$environments = $this->getEnvironments();
|
||||
$selectedEnv = $request->get('env', 'dev');
|
||||
|
||||
// 로컬 테넌트 정보
|
||||
$localTenant = Tenant::find($this->getTenantId());
|
||||
|
||||
// 로컬 메뉴 조회 (트리 구조)
|
||||
$localMenus = $this->getMenuTree();
|
||||
|
||||
// 원격 메뉴 조회
|
||||
$remoteMenus = [];
|
||||
$remoteError = null;
|
||||
$this->remoteTenantName = null;
|
||||
|
||||
if (! empty($environments[$selectedEnv]['url'])) {
|
||||
try {
|
||||
@@ -75,6 +82,8 @@ public function index(Request $request): View|Response
|
||||
'remoteMenus' => $remoteMenus,
|
||||
'remoteError' => $remoteError,
|
||||
'diff' => $diff,
|
||||
'localTenantName' => $localTenant?->company_name ?? '알 수 없음',
|
||||
'remoteTenantName' => $this->remoteTenantName,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -119,10 +128,12 @@ public function export(Request $request): JsonResponse
|
||||
}
|
||||
|
||||
$menus = $this->getMenuTree();
|
||||
$tenant = Tenant::find($this->getTenantId());
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'environment' => config('app.env'),
|
||||
'tenant_name' => $tenant?->company_name ?? '알 수 없음',
|
||||
'exported_at' => now()->toIso8601String(),
|
||||
'menus' => $menus,
|
||||
]);
|
||||
@@ -383,6 +394,8 @@ private function fetchRemoteMenus(array $env): array
|
||||
throw new \Exception('잘못된 응답 형식');
|
||||
}
|
||||
|
||||
$this->remoteTenantName = $data['tenant_name'] ?? null;
|
||||
|
||||
return $data['menus'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user