- 디자인 시스템: #151515 배경, 1px 보더 카드, CSS vars, mono 포인트 - GlobalStyle/theme.ts v2 (DESIGN-SYSTEM.md 기반) - 공통 컴포넌트 (ui/base.tsx): LabelMeta, BracketValue, Card, TechBar, Timeline 등 - Sidebar: [대시] 브라켓 네비 + 모바일 하단 탭바 (767px) - LayoutShell: SidebarContext 제거, 단순화 - 대시보드 (/): SYS 상태 카드 4개 + ONGOING PROJECTS + ACTIVITY FEED - 활동 로그 (/activities): 로그 테이블 + 필터 + 검색 + 페이지네이션 (신규) - 설정 (/settings): 4섹션 Toggle/Bracket Input 그리드 - 자매 노드 관리 (/sisters): 3열 수평 레이아웃 (INFO/GRAPH/SYNC) - 자매 상세 (/sisters/[name]): 간소화 + 터미널 스타일 - 조직도 (/org): 터미널 카드 트리 구조 + 레벨 색상 - 프로젝트 목록 (/projects): 새 라우트 - 프로젝트 상세 (/projects/[id]): Phase Timeline + Audit Log + Checklist - FE 14 routes build 성공
113 lines
2.8 KiB
TypeScript
113 lines
2.8 KiB
TypeScript
'use client';
|
|
|
|
import React, { useState, useEffect } from 'react';
|
|
import styled from 'styled-components';
|
|
import Link from 'next/link';
|
|
import { usePathname } from 'next/navigation';
|
|
import { LabelMeta, SectionTitle } from '@/components/ui/base';
|
|
|
|
const ADMIN_TABS = [
|
|
{ href: '/admin', label: '자매 관리' },
|
|
{ href: '/admin/harness', label: '하네스 편집' },
|
|
{ href: '/admin/logs', label: '로그 뷰어' },
|
|
{ href: '/admin/costs', label: '비용 모니터' },
|
|
{ href: '/admin/repos', label: '저장소' },
|
|
];
|
|
|
|
const Wrapper = styled.div`
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-lg);
|
|
`;
|
|
|
|
const AdminHeader = styled.div`
|
|
border-bottom: 1px solid var(--border-color);
|
|
padding-bottom: var(--space-md);
|
|
`;
|
|
|
|
const TabNav = styled.div`
|
|
display: flex;
|
|
gap: var(--space-lg);
|
|
flex-wrap: wrap;
|
|
`;
|
|
|
|
const TabLink = styled(Link)<{ $active: boolean }>`
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
color: ${({ $active }) => $active ? 'var(--text-primary)' : 'var(--text-secondary)'};
|
|
text-decoration: none;
|
|
padding: var(--space-sm) 0;
|
|
border-bottom: 1px solid ${({ $active }) => $active ? 'var(--text-primary)' : 'transparent'};
|
|
transition: color 0.15s, border-color 0.15s;
|
|
|
|
&:hover { color: var(--text-primary); }
|
|
`;
|
|
|
|
const ApiKeyRow = styled.div`
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-sm);
|
|
font-family: var(--font-mono);
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
`;
|
|
|
|
const ApiKeyInput = styled.input`
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid var(--border-color);
|
|
color: var(--text-primary);
|
|
font-family: var(--font-mono);
|
|
font-size: 12px;
|
|
outline: none;
|
|
flex: 1;
|
|
max-width: 300px;
|
|
padding: 2px 0;
|
|
|
|
&:focus { border-bottom-color: var(--text-primary); }
|
|
`;
|
|
|
|
export default function AdminLayout({ children }: { children: React.ReactNode }) {
|
|
const pathname = usePathname();
|
|
const [apiKey, setApiKey] = useState('');
|
|
|
|
useEffect(() => {
|
|
setApiKey(localStorage.getItem('hanarang_admin_key') ?? '');
|
|
}, []);
|
|
|
|
const saveKey = (v: string) => {
|
|
setApiKey(v);
|
|
localStorage.setItem('hanarang_admin_key', v);
|
|
};
|
|
|
|
return (
|
|
<Wrapper>
|
|
<AdminHeader>
|
|
<div style={{ fontSize: '28px', fontWeight: 600, letterSpacing: '-0.02em', marginBottom: 'var(--space-md)' }}>
|
|
관리자
|
|
</div>
|
|
<TabNav>
|
|
{ADMIN_TABS.map((tab) => (
|
|
<TabLink key={tab.href} href={tab.href} $active={pathname === tab.href}>
|
|
{tab.label}
|
|
</TabLink>
|
|
))}
|
|
</TabNav>
|
|
</AdminHeader>
|
|
|
|
<ApiKeyRow>
|
|
<span>KEY [</span>
|
|
<ApiKeyInput
|
|
type="password"
|
|
placeholder="ADMIN_API_KEY"
|
|
value={apiKey}
|
|
onChange={(e) => saveKey(e.target.value)}
|
|
/>
|
|
<span>]</span>
|
|
</ApiKeyRow>
|
|
|
|
{children}
|
|
</Wrapper>
|
|
);
|
|
}
|