2026-02-14 13:25:11 +09:00
|
|
|
import type { NavItem } from '../types';
|
|
|
|
|
|
|
|
|
|
export const DEV_NAV: NavItem[] = [
|
|
|
|
|
{ path: '/dev/env-intro', label: '개발환경 소개' },
|
|
|
|
|
{ path: '/dev/initial-setup', label: '초기 환경 설정' },
|
|
|
|
|
{ path: '/dev/gitea-usage', label: 'Gitea 사용법' },
|
|
|
|
|
{ path: '/dev/git-workflow', label: 'Git 워크플로우' },
|
|
|
|
|
{ path: '/dev/starting-project', label: '프로젝트 시작하기' },
|
2026-02-15 19:35:35 +09:00
|
|
|
{ path: '/dev/nexus-usage', label: 'Nexus 사용법' },
|
2026-02-14 20:03:16 +09:00
|
|
|
{ path: '/dev/ci-cd', label: 'CI/CD 자동 배포' },
|
2026-02-15 19:35:35 +09:00
|
|
|
{ path: '/dev/chat-bot', label: 'Chat 봇 연동' },
|
|
|
|
|
{ path: '/dev/design-system', label: '디자인 시스템' },
|
2026-02-14 13:25:11 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const ADMIN_NAV: NavItem[] = [
|
|
|
|
|
{ path: '/admin/users', label: '사용자 관리' },
|
|
|
|
|
{ path: '/admin/roles', label: '롤 관리' },
|
|
|
|
|
{ path: '/admin/permissions', label: '권한 관리' },
|
2026-02-16 23:25:53 +09:00
|
|
|
{ path: '/admin/settings', label: '설정' },
|
2026-02-14 13:25:11 +09:00
|
|
|
{ path: '/admin/stats', label: '통계' },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export function canAccessPath(path: string, urlPatterns: string[]): boolean {
|
|
|
|
|
return urlPatterns.some((pattern) => matchAntPattern(pattern, path));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function matchAntPattern(pattern: string, path: string): boolean {
|
|
|
|
|
if (pattern === '/**') return true;
|
|
|
|
|
const regex = pattern
|
|
|
|
|
.replace(/\*\*/g, '.*')
|
|
|
|
|
.replace(/(?<!\.)(\*)/g, '[^/]*')
|
|
|
|
|
.replace(/\?/g, '[^/]');
|
|
|
|
|
return new RegExp(`^${regex}$`).test(path);
|
|
|
|
|
}
|