Compare commits
6 Commits
ce6ea377ce
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c59f027ea | ||
|
|
b54cdb878d | ||
|
|
57fd82c6dd | ||
|
|
6647379abc | ||
|
|
11122c7919 | ||
|
|
357a395cbb |
48
.gitea/workflows/deploy.yml
Normal file
48
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
name: Build and Push Docker Images
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-backend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.chedius.ru
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push backend
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ./backend
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
gitea.gitea.chedius.ru/${{ gitea.repository_owner }}/delivery-tracker/backend:latest
|
||||||
|
gitea.gitea.chedius.ru/${{ gitea.repository_owner }}/delivery-tracker/backend:${{ gitea.sha }}
|
||||||
|
|
||||||
|
build-frontend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.chedius.ru
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push frontend
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ./frontend
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
gitea.gitea.chedius.ru/${{ gitea.repository_owner }}/delivery-tracker/frontend:latest
|
||||||
|
gitea.gitea.chedius.ru/${{ gitea.repository_owner }}/delivery-tracker/frontend:${{ gitea.sha }}
|
||||||
168
DEPLOY.md
Normal file
168
DEPLOY.md
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
# Автоматический деплой на LXC + Docker + Nginx Proxy Manager
|
||||||
|
|
||||||
|
## Схема работы
|
||||||
|
|
||||||
|
```
|
||||||
|
[Git Push] → [Gitea Actions] → [Build Images] → [Gitea Registry]
|
||||||
|
↓
|
||||||
|
[LXC Server] ← [Watchtower] ← [Poll every 60s]
|
||||||
|
↓
|
||||||
|
[Nginx Proxy Manager] → [HTTPS] → [frontend:80]
|
||||||
|
↓
|
||||||
|
/api/* → [backend:8080] (внутри сети)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Пошаговая настройка
|
||||||
|
|
||||||
|
### 1. Настройка Gitea
|
||||||
|
|
||||||
|
В конфиге Gitea (`app.ini`) включи registry:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[packages]
|
||||||
|
ENABLED = true
|
||||||
|
```
|
||||||
|
|
||||||
|
Перезапусти Gitea.
|
||||||
|
|
||||||
|
### 2. Обнови workflow файл
|
||||||
|
|
||||||
|
Открой `.gitea/workflows/deploy.yml` и замени:
|
||||||
|
- `gitea.your-domain.com` → на твой домен Gitea
|
||||||
|
- Убедись что путь `${{ gitea.repository_owner }}/delivery-tracker` корректен
|
||||||
|
|
||||||
|
### 3. Создай токен в Gitea
|
||||||
|
|
||||||
|
- Gitea → Settings → Applications → Generate Token
|
||||||
|
- Сохрани токен (понадобится для Watchtower)
|
||||||
|
|
||||||
|
### 4. Настройка LXC сервера (если еще не настроен Docker)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://get.docker.com | sh
|
||||||
|
sudo usermod -aG docker $USER
|
||||||
|
newgrp docker
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Клонируй репозиторий на сервер
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /opt
|
||||||
|
sudo git clone https://gitea.your-domain.com/yourusername/delivery-tracker.git
|
||||||
|
sudo chown -R $USER:$USER delivery-tracker
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6. Настрой переменные окружения
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd delivery-tracker
|
||||||
|
cp .env.production.example .env
|
||||||
|
nano .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Заполни:
|
||||||
|
- Пароли для PostgreSQL
|
||||||
|
- JWT секрет: `openssl rand -hex 32`
|
||||||
|
- Gitea credentials для Watchtower
|
||||||
|
- `GITEA_REGISTRY` — твой registry (например: `gitea.example.com/yourusername`)
|
||||||
|
|
||||||
|
### 7. Логин в Gitea Registry на сервере
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker login gitea.your-domain.com
|
||||||
|
# Введи username и токен/password
|
||||||
|
```
|
||||||
|
|
||||||
|
### 8. Первый запуск
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose -f docker-compose.prod.yml pull
|
||||||
|
docker-compose -f docker-compose.prod.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### 9. Настройка Nginx Proxy Manager
|
||||||
|
|
||||||
|
Открой веб-интерфейс NPM (обычно `http://server-ip:81` или через твой домен).
|
||||||
|
|
||||||
|
#### Добавь Proxy Host для приложения:
|
||||||
|
|
||||||
|
- **Domain Names**: `delivery.yourdomain.com` (замени на свой поддомен)
|
||||||
|
- **Scheme**: `http`
|
||||||
|
- **Forward Hostname/IP**: `frontend` (имя сервиса в docker-compose)
|
||||||
|
- **Forward Port**: `80`
|
||||||
|
- **Cache Assets**: Включи
|
||||||
|
- **Block Common Exploits**: Включи
|
||||||
|
|
||||||
|
**SSL Tab:**
|
||||||
|
- SSL Certificate: Request a new SSL Certificate
|
||||||
|
- Force SSL: Включи
|
||||||
|
- HTTP/2 Support: Включи
|
||||||
|
|
||||||
|
**Как это работает:**
|
||||||
|
- NPM проксирует все запросы на frontend контейнер
|
||||||
|
- Frontend nginx сам проксирует `/api/*` запросы на backend через docker network
|
||||||
|
- Backend вообще не доступен извне — только через frontend
|
||||||
|
|
||||||
|
**Важно**: Контейнеры используют `expose` порты (не `ports`). NPM достучится до `frontend` через docker network если NPM в той же сети, или по IP сервера.
|
||||||
|
|
||||||
|
#### Подключение NPM к сети контейнеров:
|
||||||
|
|
||||||
|
Если NPM запущен в другом compose, подключи его к сети delivery-tracker:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker network connect delivery-tracker_delivery-network npm-app-1
|
||||||
|
```
|
||||||
|
|
||||||
|
Или используй IP адрес сервера (`172.17.0.1` или `host.docker.internal`) в поле Forward Hostname.
|
||||||
|
|
||||||
|
### 10. Проверь автоматическое обновление
|
||||||
|
|
||||||
|
Watchtower будет каждые 60 секунд проверять новые образы:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose -f docker-compose.prod.yml logs -f watchtower
|
||||||
|
```
|
||||||
|
|
||||||
|
## Как работает автодеплой
|
||||||
|
|
||||||
|
1. `git push` в main/master
|
||||||
|
2. Gitea Actions собирает образы → push в Registry
|
||||||
|
3. Watchtower (60s poll) → проверяет registry → pull новых образов → перезапускает контейнеры
|
||||||
|
4. NPM продолжает проксировать трафик на обновленные контейнеры
|
||||||
|
|
||||||
|
## Ручной деплой
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /opt/delivery-tracker
|
||||||
|
docker-compose -f docker-compose.prod.yml pull
|
||||||
|
docker-compose -f docker-compose.prod.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## Обновление SSL через NPM
|
||||||
|
|
||||||
|
NPM автоматически обновляет SSL сертификаты Let's Encrypt. Ничего делать не нужно.
|
||||||
|
|
||||||
|
## Траблшутинг
|
||||||
|
|
||||||
|
**Образы не обновляются:**
|
||||||
|
```bash
|
||||||
|
docker-compose -f docker-compose.prod.yml logs watchtower
|
||||||
|
docker login gitea.your-domain.com
|
||||||
|
```
|
||||||
|
|
||||||
|
**NPM не видит контейнеры:**
|
||||||
|
- Проверь что NPM и delivery-tracker в одной docker-сети
|
||||||
|
- Или используй IP сервера вместо имен сервисов
|
||||||
|
- Проверь `docker network ls` и `docker network inspect delivery-tracker_delivery-network`
|
||||||
|
|
||||||
|
**Контейнеры не запускаются:**
|
||||||
|
```bash
|
||||||
|
docker-compose -f docker-compose.prod.yml logs backend
|
||||||
|
docker-compose -f docker-compose.prod.yml logs frontend
|
||||||
|
docker-compose -f docker-compose.prod.yml logs postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
**Frontend не подключается к backend:**
|
||||||
|
- Проверь что frontend nginx проксирует `/api/` на `backend:8080`
|
||||||
|
- Проверь логи frontend: `docker-compose -f docker-compose.prod.yml logs frontend`
|
||||||
|
- Убедись что backend работает: `docker-compose -f docker-compose.prod.yml logs backend`
|
||||||
40
Makefile
Normal file
40
Makefile
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Delivery Tracker - Local Build & Deploy
|
||||||
|
REGISTRY = gitea.chedius.ru/chedius
|
||||||
|
PLATFORM = linux/amd64
|
||||||
|
|
||||||
|
# Build and push both services
|
||||||
|
.PHONY: all build push deploy
|
||||||
|
|
||||||
|
all: build push
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build --platform $(PLATFORM) -t $(REGISTRY)/delivery-tracker/backend:latest ./backend
|
||||||
|
docker build --platform $(PLATFORM) -t $(REGISTRY)/delivery-tracker/frontend:latest ./frontend
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/delivery-tracker/backend:latest
|
||||||
|
docker push $(REGISTRY)/delivery-tracker/frontend:latest
|
||||||
|
|
||||||
|
# Quick deploy - build, push and trigger watchtower check
|
||||||
|
deploy: build push
|
||||||
|
@echo "Build and push complete. Watchtower will auto-update within 60 seconds."
|
||||||
|
@echo "Or run 'make watchtower-now' to force immediate update"
|
||||||
|
|
||||||
|
# Force watchtower to check now (run from server)
|
||||||
|
watchtower-now:
|
||||||
|
docker exec delivery-tracker-watchtower-1 /watchtower --run-once delivery-tracker-backend-1 delivery-tracker-frontend-1
|
||||||
|
|
||||||
|
# Update specific containers on server (if watchtower fails)
|
||||||
|
update-server:
|
||||||
|
docker pull $(REGISTRY)/delivery-tracker/backend:latest
|
||||||
|
docker pull $(REGISTRY)/delivery-tracker/frontend:latest
|
||||||
|
docker-compose up -d --force-recreate backend frontend
|
||||||
|
|
||||||
|
# Full workflow: commit, build, push
|
||||||
|
release:
|
||||||
|
@if [ -z "$(MSG)" ]; then echo "Usage: make release MSG='commit message'"; exit 1; fi
|
||||||
|
git add -A
|
||||||
|
git commit -m "$(MSG)" || true
|
||||||
|
git push
|
||||||
|
$(MAKE) build push
|
||||||
|
@echo "Released! Watchtower will deploy within 60 seconds."
|
||||||
@@ -54,8 +54,7 @@ services:
|
|||||||
- WATCHTOWER_REVIVE_STOPPED=false
|
- WATCHTOWER_REVIVE_STOPPED=false
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- /root/.docker/config.json:/config.json
|
command: delivery-tracker-backend-1 delivery-tracker-frontend-1 --interval 60
|
||||||
command: backend frontend --interval 60
|
|
||||||
networks:
|
networks:
|
||||||
- delivery-network
|
- delivery-network
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { MapPin, Phone, Package, Store, Calendar, MessageSquare, CheckCircle2, Circle, CheckSquare, User, Wrench } from 'lucide-react';
|
import { MapPin, Phone, Store, Calendar, MessageSquare, CheckCircle2, Circle, CheckSquare, User, Wrench } from 'lucide-react';
|
||||||
import type { Delivery } from '../../types';
|
import type { Delivery } from '../../types';
|
||||||
import { pickupLocationLabels } from '../../types';
|
import { pickupLocationLabels } from '../../types';
|
||||||
import { StatusBadge } from './StatusBadge';
|
import { StatusBadge } from './StatusBadge';
|
||||||
@@ -58,24 +58,23 @@ export const DeliveryCard = memo(({ delivery, onStatusChange, onEdit, onDelete }
|
|||||||
<span className="text-[#1b1b1d] font-medium">{delivery.date}</span>
|
<span className="text-[#1b1b1d] font-medium">{delivery.date}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Pickup locations */}
|
{/* Pickup locations paired with products */}
|
||||||
<div className="flex items-center gap-2 text-sm">
|
<div className="flex items-start gap-2 text-sm">
|
||||||
<Store size={16} className="text-[#75777d]" />
|
<Store size={16} className="text-[#75777d] mt-0.5 shrink-0" />
|
||||||
<span className="text-[#1b1b1d]">
|
<div className="flex flex-col gap-1 min-w-0">
|
||||||
{delivery.pickupLocation2
|
<div className="flex items-baseline gap-2 flex-wrap">
|
||||||
? `${pickupLocationLabels[delivery.pickupLocation]} + ${pickupLocationLabels[delivery.pickupLocation2]}`
|
<span className="text-[#1b1b1d] font-medium">{pickupLocationLabels[delivery.pickupLocation]}</span>
|
||||||
: pickupLocationLabels[delivery.pickupLocation]}
|
<span className="text-[#75777d]">—</span>
|
||||||
</span>
|
<span className="text-[#1b1b1d]">{delivery.productName}</span>
|
||||||
</div>
|
</div>
|
||||||
{delivery.pickupLocation2 && delivery.productName2 && (
|
{delivery.pickupLocation2 && (
|
||||||
<div className="flex items-start gap-2 text-sm pl-6">
|
<div className="flex items-baseline gap-2 flex-wrap">
|
||||||
<span className="text-[#75777d] text-xs">Со 2-й точки: {delivery.productName2}</span>
|
<span className="text-[#1b1b1d] font-medium">{pickupLocationLabels[delivery.pickupLocation2]}</span>
|
||||||
|
<span className="text-[#75777d]">—</span>
|
||||||
|
<span className="text-[#1b1b1d]">{delivery.productName2 || '—'}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="flex items-center gap-2 text-sm">
|
|
||||||
<Package size={16} className="text-[#75777d]" />
|
|
||||||
<span className="text-[#1b1b1d]">{delivery.productName}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { useState, useEffect, useCallback } from 'react';
|
|||||||
import { Button, Input, Select, Modal } from '../ui';
|
import { Button, Input, Select, Modal } from '../ui';
|
||||||
import { pickupOptions } from '../../constants/pickup';
|
import { pickupOptions } from '../../constants/pickup';
|
||||||
import { formatDateForInput, parseDateFromInput, getTodayFrontend } from '../../utils/date';
|
import { formatDateForInput, parseDateFromInput, getTodayFrontend } from '../../utils/date';
|
||||||
import { parseAddress } from '../../utils/addressParser';
|
|
||||||
import type { Delivery, PickupLocation, DeliveryStatus } from '../../types';
|
import type { Delivery, PickupLocation, DeliveryStatus } from '../../types';
|
||||||
|
|
||||||
interface DeliveryFormProps {
|
interface DeliveryFormProps {
|
||||||
@@ -17,6 +16,23 @@ interface DeliveryFormProps {
|
|||||||
// Phone validation regex for Kazakhstan numbers
|
// Phone validation regex for Kazakhstan numbers
|
||||||
const PHONE_REGEX = /^\+7\s?\(?\d{3}\)?\s?\d{3}[\s-]?\d{2}[\s-]?\d{2}$/;
|
const PHONE_REGEX = /^\+7\s?\(?\d{3}\)?\s?\d{3}[\s-]?\d{2}[\s-]?\d{2}$/;
|
||||||
|
|
||||||
|
// City is not shown in UI but is included in the saved address (used for 2GIS search).
|
||||||
|
const CITY_LABEL = 'Кокшетау';
|
||||||
|
|
||||||
|
const buildAddressString = (
|
||||||
|
street: string,
|
||||||
|
house: string,
|
||||||
|
apartment: string,
|
||||||
|
entrance: string,
|
||||||
|
): string => {
|
||||||
|
const parts: string[] = [CITY_LABEL];
|
||||||
|
if (street) parts.push(`ул. ${street}`);
|
||||||
|
if (house) parts.push(`д. ${house}`);
|
||||||
|
if (apartment) parts.push(`кв. ${apartment}`);
|
||||||
|
if (entrance) parts.push(`подъезд ${entrance}`);
|
||||||
|
return parts.join(', ');
|
||||||
|
};
|
||||||
|
|
||||||
export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDate, isSubmitting }: DeliveryFormProps) => {
|
export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDate, isSubmitting }: DeliveryFormProps) => {
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
date: defaultDate || getTodayFrontend(),
|
date: defaultDate || getTodayFrontend(),
|
||||||
@@ -39,7 +55,6 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
|||||||
status: 'new' as DeliveryStatus,
|
status: 'new' as DeliveryStatus,
|
||||||
});
|
});
|
||||||
const [showSecondPickup, setShowSecondPickup] = useState(false);
|
const [showSecondPickup, setShowSecondPickup] = useState(false);
|
||||||
const [showAddressDetails, setShowAddressDetails] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialData) {
|
if (initialData) {
|
||||||
@@ -76,13 +91,17 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
|||||||
|
|
||||||
const isPhoneValid = !formData.phone || validatePhone(formData.phone);
|
const isPhoneValid = !formData.phone || validatePhone(formData.phone);
|
||||||
const isAdditionalPhoneValid = !formData.additionalPhone || validatePhone(formData.additionalPhone);
|
const isAdditionalPhoneValid = !formData.additionalPhone || validatePhone(formData.additionalPhone);
|
||||||
const isFormValid = formData.productName && formData.address && formData.phone && isPhoneValid && formData.customerName && formData.street && formData.house;
|
const isFormValid = formData.productName && formData.phone && isPhoneValid && formData.customerName && formData.street && formData.house;
|
||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!isFormValid) return;
|
if (!isFormValid) return;
|
||||||
try {
|
try {
|
||||||
await onSubmit(formData);
|
const payload = {
|
||||||
|
...formData,
|
||||||
|
address: buildAddressString(formData.street, formData.house, formData.apartment, formData.entrance),
|
||||||
|
};
|
||||||
|
await onSubmit(payload);
|
||||||
if (!initialData) {
|
if (!initialData) {
|
||||||
setFormData({
|
setFormData({
|
||||||
date: defaultDate || getTodayFrontend(),
|
date: defaultDate || getTodayFrontend(),
|
||||||
@@ -105,7 +124,6 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
|||||||
status: 'new',
|
status: 'new',
|
||||||
});
|
});
|
||||||
setShowSecondPickup(false);
|
setShowSecondPickup(false);
|
||||||
setShowAddressDetails(false);
|
|
||||||
}
|
}
|
||||||
onClose();
|
onClose();
|
||||||
} catch {
|
} catch {
|
||||||
@@ -159,44 +177,9 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
|||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Address with auto-parse */}
|
{/* Address fields */}
|
||||||
<div>
|
<div className="bg-[#f5f3f5] rounded-lg p-4 space-y-3">
|
||||||
<label className="block text-sm font-medium text-[#1b1b1d] mb-1">
|
<p className="text-sm font-medium text-[#1b1b1d]">Адрес доставки</p>
|
||||||
Адрес доставки
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
value={formData.address}
|
|
||||||
onChange={(e) => {
|
|
||||||
const newAddress = e.target.value;
|
|
||||||
const parsed = parseAddress(newAddress);
|
|
||||||
setFormData({
|
|
||||||
...formData,
|
|
||||||
address: newAddress,
|
|
||||||
street: parsed.street || formData.street,
|
|
||||||
house: parsed.house || formData.house,
|
|
||||||
apartment: parsed.apartment || formData.apartment,
|
|
||||||
entrance: parsed.entrance || formData.entrance,
|
|
||||||
floor: parsed.floor || formData.floor,
|
|
||||||
});
|
|
||||||
if (parsed.street || parsed.house) {
|
|
||||||
setShowAddressDetails(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onBlur={() => setShowAddressDetails(true)}
|
|
||||||
placeholder="ул. Абая, д. 15, кв. 45, подъезд 3, этаж 5"
|
|
||||||
className="w-full px-3 py-2 bg-[#f5f3f5] border border-[#c5c6cd] rounded-md text-[#1b1b1d] focus:outline-none focus:ring-2 focus:ring-[#1B263B] focus:border-transparent transition-colors"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<p className="text-xs text-[#75777d] mt-1">
|
|
||||||
Улица, дом, квартира, подъезд, этаж
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Parsed address details */}
|
|
||||||
{showAddressDetails && (
|
|
||||||
<div className="bg-[#f5f3f5] rounded-lg p-4 space-y-3">
|
|
||||||
<p className="text-sm font-medium text-[#1b1b1d]">Проверьте распознанные данные:</p>
|
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs text-[#75777d] mb-1">Улица *</label>
|
<label className="block text-xs text-[#75777d] mb-1">Улица *</label>
|
||||||
@@ -246,8 +229,7 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
label="ФИО клиента *"
|
label="ФИО клиента *"
|
||||||
@@ -327,7 +309,7 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
|||||||
options={pickupOptions}
|
options={pickupOptions}
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
label="Что забрать со второй точки"
|
label="Название товара 2"
|
||||||
value={formData.productName2}
|
value={formData.productName2}
|
||||||
onChange={(e) => setFormData({ ...formData, productName2: e.target.value })}
|
onChange={(e) => setFormData({ ...formData, productName2: e.target.value })}
|
||||||
placeholder="Название товара со второй точки"
|
placeholder="Название товара со второй точки"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default defineConfig({
|
|||||||
allowedHosts: ['delivery.loca.lt', '.loca.lt'],
|
allowedHosts: ['delivery.loca.lt', '.loca.lt'],
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://192.168.3.96:8080',
|
target: 'http://localhost:8080',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user