Add Availability Calendar, Modules system, and route refactoring

- Add AvailabilityPage with price grid (categories × dates), drag-select,
  channel prices, EditPanel, PeriodModal, and rate periods tab
- Add ModulesContext with localStorage persistence and dynamic sidebar items
- Add ModulesPage with WiFi Auth, Payments, TV Welcome, Smart Locks,
  OLAP Reports, Website Builder, Booking Widget modules
- Add ReportsPage (OLAP analytics with KPI cards, charts, tables)
- Add WebsitePage and BookingWidgetPage placeholders
- Remove hotel slug from URL routing; hotel context from JWT
- Add Доступность nav item in Sidebar under Управление
- Fix LoginPage redirects and HotelSync branding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 14:43:18 +03:00
parent 63c9ae574f
commit b277e3e38d
14 changed files with 1869 additions and 78 deletions

View File

@@ -24,23 +24,21 @@ export function LoginPage() {
if (user) {
if (user.role === 'super_admin') return <Navigate to="/admin" replace />
return <Navigate to="/grand-palace/calendar" replace />
return <Navigate to="/calendar" replace />
}
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
setError('')
setLoading(true)
const ok = await login(email, password)
const loggedIn = await login(email, password)
setLoading(false)
if (!ok) {
if (!loggedIn) {
setError('Неверный email или пароль')
return
}
// Redirect based on role
const user = DEMO_ACCOUNTS.find(a => a.email === email)
if (user?.role === 'super_admin') navigate('/admin')
else navigate('/grand-palace/calendar')
if (loggedIn.role === 'super_admin') navigate('/admin')
else navigate('/calendar')
}
const fillDemo = (acc: typeof DEMO_ACCOUNTS[number]) => {
@@ -105,7 +103,7 @@ export function LoginPage() {
<Hotel size={18} className="text-white" />
</div>
<span className="text-xl font-bold text-slate-900 dark:text-slate-100">
Hotel<span className="text-brand-600">Next</span>
Hotel<span className="text-brand-600">Sync</span>
</span>
</div>