Separate CP admin panel into independent Vite project at /cp/

- New /cp/ Vite project with own package.json, Dockerfile, tailwind config
- Migrated CpLoginPage, CpLayout, AdminDashboard → cp/src/ (self-contained)
- cp/src/lib/utils.ts has only what CP needs (cn, PLAN_LABELS, PLAN_COLORS)
- cp/src/data/mockData.ts has Hotel/User types and mock data
- cp/ builds to nginx static container (hotelsync-cp)
- docker-compose.yml: added cp service
- nginx: added cp.hotelsync.ru → hotelsync-cp:80 (SSL block ready for certbot)
- deploy.yml: builds hotelsync-cp:latest and restarts container on push
- Cleaned src/App.tsx: removed IS_CP branch, CpLoginPage/CpLayout/AdminDashboard imports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 01:03:28 +03:00
parent 5429b272f9
commit 526a9eefcf
21 changed files with 801 additions and 43 deletions

80
cp/src/data/mockData.ts Normal file
View File

@@ -0,0 +1,80 @@
import type { HotelPlan } from '../lib/utils'
export interface Hotel {
id: string
name: string
slug: string
address: string
plan: HotelPlan
isActive: boolean
roomCount: number
createdAt: string
}
export interface User {
id: string
email: string
name: string
role: string
hotelId: string | null
hotelName?: string
}
export const MOCK_HOTELS: Hotel[] = [
{
id: 'hotel-1',
name: 'Grand Palace Hotel',
slug: 'grand-palace',
address: 'ул. Тверская 1, Москва',
plan: 'pro',
isActive: true,
roomCount: 12,
createdAt: '2024-01-15',
},
{
id: 'hotel-2',
name: 'Sea Breeze Resort',
slug: 'sea-breeze',
address: 'ул. Набережная 12, Сочи',
plan: 'enterprise',
isActive: true,
roomCount: 48,
createdAt: '2024-03-22',
},
{
id: 'hotel-3',
name: 'City Inn Express',
slug: 'city-inn',
address: 'пр. Невский 88, Санкт-Петербург',
plan: 'starter',
isActive: false,
roomCount: 20,
createdAt: '2024-06-01',
},
]
export const MOCK_USERS: User[] = [
{
id: 'user-admin',
email: 'admin@hotelsync.io',
name: 'Александр Петров',
role: 'super_admin',
hotelId: null,
},
{
id: 'user-manager-1',
email: 'manager@grand-palace.ru',
name: 'Елена Смирнова',
role: 'hotel_manager',
hotelId: 'hotel-1',
hotelName: 'Grand Palace Hotel',
},
{
id: 'user-housekeeper-1',
email: 'cleaner@grand-palace.ru',
name: 'Мария Иванова',
role: 'housekeeper',
hotelId: 'hotel-1',
hotelName: 'Grand Palace Hotel',
},
]