[feat] solution/backend,frontend: 개발자 전용 사이트관리·유저관리 — 조회 전용 경량 화면
admin 앱을 새 메뉴로 키우려면 새 도메인이 필요해서, solution 앱에 DEVELOPER 게이트 하나로 얹었다. 메뉴 문자열은 사장님 번들에도 실리지만 데이터 접근은 백엔드 게이트가 막는다. - router/v1/ops: GET /v1/ops/sites · /v1/ops/users (RequireDeveloper) - services/ops_service.py, crud/site_crud.list_all_sites, crud/user_crud.list_users - frontend: OpsSitesPage · OpsUsersPage, AppShell 에 role===DEVELOPER 일 때만 두 줄 - api/generated: orval 코드젠 결과 프론트 tsc·eslint 통과, openapi 코드젠 성공. DB 조회는 미검증(DEVLOG 2026-09-23) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
79962b93e2
commit
46b74b310b
37 files changed
+1237
-6
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import type {ComponentType, ReactNode} from 'react';
|
||||
import {Link, NavLink, useLocation, useNavigate} from 'react-router';
|
||||
import {LayoutGrid, LogIn, LogOut, Receipt, Search, Store, Wand2} from 'lucide-react';
|
||||
import {Globe2, LayoutGrid, LogIn, LogOut, Receipt, Search, Store, Users, Wand2} from 'lucide-react';
|
||||
import {UserRole} from '@/api';
|
||||
import {cn} from '@/lib/utils';
|
||||
import {userLabel, useAuthStore} from '@/stores/auth';
|
||||
|
||||
@@ -36,11 +37,23 @@ const OWNER_NAV: NavItem[] = [
|
||||
{to: '/pricing', match: '/pricing', label: '요금', icon: Receipt},
|
||||
];
|
||||
|
||||
export function AppShell({children, nav = OWNER_NAV}: {children: ReactNode; nav?: NavItem[]}) {
|
||||
/**
|
||||
* 개발자 전용 두 줄(사이트관리·유저관리, 2026-09-23 기획). admin/frontend 를 새 도메인으로
|
||||
* 키우는 대신 solution 앱에 경량으로 얹은 것 — 그래서 위 주석의 "메뉴가 섞이면 새어 나간다"가
|
||||
* 그대로 적용된다: 이 문자열은 role 과 무관하게 사장님에게 나가는 번들에도 실린다(런타임에만
|
||||
* 숨긴다). 실제 데이터 접근은 백엔드 RequireDeveloper 가 막으므로 노출은 경로 이름 정도다.
|
||||
*/
|
||||
const DEVELOPER_NAV: NavItem[] = [
|
||||
{to: '/ops/sites', match: '/ops/sites', label: '사이트관리', icon: Globe2},
|
||||
{to: '/ops/users', match: '/ops/users', label: '유저관리', icon: Users},
|
||||
];
|
||||
|
||||
export function AppShell({children, nav}: {children: ReactNode; nav?: NavItem[]}) {
|
||||
const user = useAuthStore((s) => s.user);
|
||||
const signOut = useAuthStore((s) => s.signOut);
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const items = nav ?? (user?.role === UserRole.DEVELOPER ? [...OWNER_NAV, ...DEVELOPER_NAV] : OWNER_NAV);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen w-screen overflow-hidden bg-background text-foreground">
|
||||
@@ -52,7 +65,7 @@ export function AppShell({children, nav = OWNER_NAV}: {children: ReactNode; nav?
|
||||
</Link>
|
||||
|
||||
<nav className="flex-1 space-y-0.5 px-2">
|
||||
{nav.map(({to, match, label, icon: Icon}) => (
|
||||
{items.map(({to, match, label, icon: Icon}) => (
|
||||
<NavLink
|
||||
key={to}
|
||||
to={to}
|
||||
|
||||
Reference in new issue
Block a user