feat: move amenities directory to RoomCategoriesPage + cdn.hotelsync.ru for uploads

- Remove "Справочник удобств" block from RoomsPage, add to RoomCategoriesPage
- Fix RoomsPage imports (add Pencil back, remove unused amenity icons)
- Update hint in CategoryForm to point to current page
- Upload route now returns cdn.hotelsync.ru URLs instead of api.hotelsync.ru/uploads/
- Nginx config for cdn.hotelsync.ru (serves /opt/hotelsync/uploads directly)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 12:31:08 +03:00
parent 3ef7f8265a
commit 3ed3156fe8
4 changed files with 445 additions and 101 deletions

View File

@@ -31,10 +31,8 @@ const upload: FastifyPluginAsync = async (fastify) => {
await pipeline(data.file, createWriteStream(filepath))
const host = (request.headers['x-forwarded-proto'] ?? 'https') + '://' +
(request.headers['x-forwarded-host'] ?? request.headers.host ?? 'api.hotelsync.ru')
return { url: `${host}/uploads/${filename}` }
const cdnHost = process.env.CDN_HOST ?? 'cdn.hotelsync.ru'
return { url: `https://${cdnHost}/${filename}` }
},
)
}