fix: [tenant-console] 테넌트 콘솔 분리작업

- 라우트 파라미터 충돌 수정 (Layer 4 확장)
- TenantScope 글로벌 스코프가 테넌트 콘솔에서 올바른 tenant_id 사용하도록 수정
- 감사로그 상세 테넌트 콘솔 레이아웃 적용
- 테넌트 전환: 모달 → 컨텍스트 메뉴로 이동, 스타일 변경 (녹색+전환아이콘)
- 테넌트 전환 이벤트를 openTenantConsole 호출로 통일
- 사이드바 스타일 메인과 통일 + 리포트 주의사항 정리
This commit is contained in:
2026-03-12 18:58:34 +09:00
parent a077bd5710
commit 8da1702e47
71 changed files with 1179 additions and 429 deletions

View File

@@ -18,7 +18,6 @@
const STORAGE_KEY = 'devToolsAuth';
const USERS_ENDPOINT = '{{ route("dev-tools.api-explorer.users") }}';
const TENANT_SWITCH_ENDPOINT = '{{ route("tenant.switch") }}';
const ISSUE_TOKEN_ENDPOINT = '{{ route("dev-tools.api-explorer.issue-token") }}';
const CSRF_TOKEN = '{{ csrf_token() }}';
@@ -372,48 +371,6 @@ function notifyChange() {
}
},
// 테넌트 변경
async switchTenant(tenantId) {
if (!tenantId) return;
try {
const formData = new FormData();
formData.append('tenant_id', tenantId);
const response = await fetch(TENANT_SWITCH_ENDPOINT, {
method: 'POST',
headers: {
'X-CSRF-TOKEN': CSRF_TOKEN,
'Accept': 'application/json'
},
body: formData
});
if (!response.ok) {
throw new Error('테넌트 변경 실패');
}
// 사용자 목록 새로고침
usersLoaded = false;
await loadUsers();
// 헤더의 테넌트 선택도 동기화
const headerTenantSelect = document.getElementById('tenant-select');
if (headerTenantSelect) {
headerTenantSelect.value = tenantId;
}
if (typeof showToast === 'function') {
showToast('회사가 변경되었습니다.', 'success');
}
} catch (err) {
console.error('테넌트 변경 실패:', err);
if (typeof showToast === 'function') {
showToast('회사 변경에 실패했습니다.', 'error');
}
}
},
// 토큰 복사
async copyToken() {
const displayToken = state.actualToken || state.token;