Files
Hyungi Ahn 2b1c7bfb88 feat: 다수 기능 개선 - 순찰, 출근, 작업분석, 모바일 UI 등
- 순찰/점검 기능 개선 (zone-detail 페이지 추가)
- 출근/근태 시스템 개선 (연차 조회, 근무현황)
- 작업분석 대분류 그룹화 및 마이그레이션 스크립트
- 모바일 네비게이션 UI 추가
- NAS 배포 도구 및 문서 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:41:01 +09:00

55 lines
1.8 KiB
JavaScript

// /js/navigation.js
import { config } from './config.js';
/**
* 지정된 URL로 페이지를 리디렉션합니다.
* @param {string} url - 이동할 URL
*/
function redirect(url) {
window.location.href = url;
}
/**
* 로그인 페이지로 리디렉션합니다.
*/
export function redirectToLogin() {
console.log(`🔄 로그인 페이지로 이동합니다: ${config.paths.loginPage}`);
redirect(config.paths.loginPage);
}
/**
* 사용자의 기본 대시보드 페이지로 리디렉션합니다.
* 백엔드가 지정한 URL이 있으면 그곳으로, 없으면 기본 URL로 이동합니다.
* @param {string} [backendRedirectUrl=null] - 백엔드에서 전달받은 리디렉션 URL
*/
export function redirectToDefaultDashboard(backendRedirectUrl = null) {
const destination = backendRedirectUrl || config.paths.defaultDashboard;
console.log(`🔄 대시보드로 이동합니다: ${destination}`);
// 부드러운 화면 전환 효과
document.body.style.transition = 'opacity 0.3s ease-out';
document.body.style.opacity = '0';
setTimeout(() => {
redirect(destination);
}, 300);
}
/**
* 시스템 대시보드 페이지로 리디렉션합니다.
*/
export function redirectToSystemDashboard() {
console.log(`🔄 시스템 대시보드로 이동합니다: ${config.paths.systemDashboard}`);
redirect(config.paths.systemDashboard);
}
/**
* 그룹 리더 대시보드 페이지로 리디렉션합니다.
*/
export function redirectToGroupLeaderDashboard() {
console.log(`🔄 그룹 리더 대시보드로 이동합니다: ${config.paths.groupLeaderDashboard}`);
redirect(config.paths.groupLeaderDashboard);
}
// 필요에 따라 더 많은 리디렉션 함수를 추가할 수 있습니다.
// export function redirectToUserProfile() { ... }