This commit applies the modular refactoring to the web-ui,
including the new daily attendance tracking feature.
- **Modular Structure:** Re-introduced the modular files 'config.js',
'component-loader.js', and 'navigation.js' to centralize configuration,
component loading, and navigation logic.
- **Refactored Dashboard:** Refactored 'group-leader-dashboard.js' to use
the new 'apiCall' function from 'api-config.js' for API requests,
removing duplicated code and improving error handling.
- **ES6 Modules:** Updated 'group-leader.html' to load scripts as
ES6 modules ('type="module"'), ensuring compatibility with the
modular JavaScript files.
- **Clean-up:** Removed unnecessary global variables and duplicated
functions, improving code quality and maintainability.
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
// /js/config.js
|
|
|
|
// ES6 모듈을 사용하여 설정을 내보냅니다.
|
|
// 이 파일을 통해 프로젝트의 모든 하드코딩된 값을 관리합니다.
|
|
|
|
export const config = {
|
|
// API 관련 설정
|
|
api: {
|
|
// 로컬 개발 및 Docker 환경에서 사용하는 API 서버 포트
|
|
port: 20005,
|
|
// API의 기본 경로
|
|
path: '/api',
|
|
},
|
|
|
|
// 페이지 경로 설정
|
|
paths: {
|
|
// 로그인 페이지 경로
|
|
loginPage: '/index.html',
|
|
// 로그인 후 기본적으로 이동할 대시보드 경로
|
|
defaultDashboard: '/pages/dashboard/user.html',
|
|
// 시스템 대시보드 경로
|
|
systemDashboard: '/pages/dashboard/system.html',
|
|
// 그룹 리더 대시보드 경로
|
|
groupLeaderDashboard: '/pages/dashboard/group-leader.html',
|
|
},
|
|
|
|
// 공용 컴포넌트 경로 설정
|
|
components: {
|
|
// 사이드바 HTML 파일 경로
|
|
sidebar: '/components/sidebar.html',
|
|
// 네비게이션 바 HTML 파일 경로 (예상)
|
|
navbar: '/components/navbar.html',
|
|
},
|
|
|
|
// 애플리케이션 관련 기타 설정
|
|
app: {
|
|
// 토큰 만료 확인 주기 (밀리초 단위, 예: 5분)
|
|
tokenRefreshInterval: 5 * 60 * 1000,
|
|
}
|
|
}; |