mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-04 21:20:35 +00:00
page orders | add duplicati container
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
dev_env/lib/python3.12/site-packages/PIL/__pycache__/XVThumbImagePlugin.cpython-312.pyc
|
||||
dev_env
|
||||
meu_dev_home
|
||||
dev_home
|
||||
gestaoRaul/static
|
||||
.env
|
||||
.env
|
||||
gestaoRaul/db.sqlite3
|
||||
|
||||
@@ -37,7 +37,6 @@ Armazena as informações dos funcionários do bar que utilizam o aplicativo int
|
||||
|`ativo`|BOOLEAN|NOT NULL, DEFAULT TRUE|
|
||||
|
||||
### 2.3. `Produtos`
|
||||
![[Product]]
|
||||
|
||||
Armazena os itens do cardápio do bar.
|
||||
|
||||
|
||||
@@ -13,6 +13,30 @@ services:
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
duplicati:
|
||||
image: duplicati/duplicati:latest # Ou uma versão específica, ex: duplicati/duplicati:2.0.7.1
|
||||
container_name: duplicati
|
||||
hostname: duplicati
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8200:8200" # Porta para a interface web do Duplicati
|
||||
environment:
|
||||
- PUID=1000 # ID do usuário que o Duplicati irá rodar (normalmente o seu usuário no host)
|
||||
- PGID=1000 # ID do grupo que o Duplicati irá rodar (normalmente o seu grupo no host)
|
||||
- TZ=America/Fortaleza # Ajuste para o seu fuso horário (Juazeiro do Norte)
|
||||
volumes:
|
||||
# Volume para persistir as configurações e bancos de dados do Duplicati
|
||||
- ./duplicati_config:/config
|
||||
# Volume para armazenar os backups (pode ser um volume nomeado ou um bind mount)
|
||||
- ./duplicati_backups:/backups
|
||||
# Montar o volume do PostgreSQL para que o Duplicati possa acessá-lo.
|
||||
# Substitua 'seu_volume_postgresql' pelo nome real do seu volume Docker do PostgreSQL.
|
||||
# Se você montou uma pasta local, use o caminho absoluto dela aqui.
|
||||
- db_data:/var/lib/postgresql/data/:ro # 'ro' para somente leitura, por segurança
|
||||
# EX: Se seu PostgreSQL está em uma pasta local:
|
||||
# - /caminho/completo/para/sua/pasta/de/dados/do/postgresql:/source_data:ro
|
||||
|
||||
|
||||
django_app:
|
||||
build:
|
||||
context: ./
|
||||
@@ -21,7 +45,7 @@ services:
|
||||
- "8000:8000"
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://0.0.0.0:8000/"]
|
||||
test: ["CMD", "curl", "-f", "http://192.168.0.150:8000/"]
|
||||
interval: 5m
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
@@ -37,7 +61,7 @@ services:
|
||||
DB_USER: "${DB_USER}"
|
||||
DB_PASSWORD: "${DB_PASSWORD}"
|
||||
DEBUG: "False"
|
||||
ALLOWED_HOSTS: "rrbec.local.com, 0.0.0.0, django_app"
|
||||
ALLOWED_HOSTS: "rrbec.local.com, 0.0.0.0, 127.0.0.1, 192.168.0.150, django_app"
|
||||
|
||||
networks:
|
||||
- app_network
|
||||
@@ -50,8 +74,8 @@ services:
|
||||
- static_volume:/app/gestaoRaul/static
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- django_app
|
||||
# depends_on:
|
||||
# - django_app
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -78,9 +78,10 @@ def addProduct(request, product_id, comanda_id):
|
||||
<h4>{comanda.name} - {comanda.mesa.name}</h4>
|
||||
<h4> {order.queue.strftime("%d/%m/%Y - %H:%M")}</h4>
|
||||
<h4> Atendente: {comanda.user.first_name}</h4>
|
||||
<button class="btn-primary" onclick="delayTab('Fila')"
|
||||
hx-get="/pedidos/preparing/{order.id}/" hx-trigger="click" hx-target="#etapas"
|
||||
>Preparar</button></div>
|
||||
<form method="path" action="/pedidos/preparing/{order.id}/">
|
||||
<button class="btn-primary" type="submit">Preparar</button>
|
||||
</form>
|
||||
</div>
|
||||
""",
|
||||
'local':'cozinha',
|
||||
'tipo':'add',
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,26 +20,16 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
{% block 'body' %}
|
||||
|
||||
<h1>Pedidos cozinha</h1>
|
||||
|
||||
|
||||
<div id="list-orders">
|
||||
|
||||
<div class="tab">
|
||||
<button class="tablinks active" onclick="openTab(event, 'Fila')">Fila</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Preparo')">Preparo</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Finalizado')">Pronto</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Entregue')">Entregue</button>
|
||||
</div>
|
||||
|
||||
<div id="etapas">
|
||||
|
||||
<div id="Fila" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
<div class="container">
|
||||
<h1>Pedidos cozinha</h1>
|
||||
<div class="kanban-board">
|
||||
{% csrf_token %}
|
||||
<div class="column">
|
||||
<h2>FILA</h2>
|
||||
<div id="fila" class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.preparing == None and order.productComanda != Null %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -54,18 +44,21 @@
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
{% if user|groupUser:"Cozinha" %}
|
||||
<button class="btn-primary" onclick="delayTab('Fila')"
|
||||
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Preparar</button>
|
||||
|
||||
<form method="path" action="{% url 'preparing' order.id %}">
|
||||
|
||||
<button class="btn-primary" type="submit">Preparar</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Preparo" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h2>PREPARANDO</h2>
|
||||
<div class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.finished == None and order.preparing != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -80,17 +73,20 @@
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
{% if user|groupUser:"Cozinha" %}
|
||||
<button class="btn-secondary" onclick="delayTab( 'Preparo')"
|
||||
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Finalizar</button>
|
||||
<form method="path" action="{% url 'finished' order.id %}">
|
||||
<button class="btn-primary" type="submit">Finalizar</button>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Finalizado" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h2>PRONTO</h2>
|
||||
<div class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered == None and order.finished != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -105,17 +101,27 @@
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
{% if user|groupUser:"Garçom" %}
|
||||
<button class="btn-secondary" onclick="delayTab( 'Finalizado')"
|
||||
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Entregar</button>
|
||||
<form method="path" action="{% url 'delivered' order.id %}">
|
||||
<button class="btn-primary" type="submit">Entregar</button>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Entregue" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column"
|
||||
{% if user|groupUser:"Gerente" %}
|
||||
style="display:block"
|
||||
{% else %}
|
||||
style="display:none"
|
||||
{% endif %}
|
||||
|
||||
>
|
||||
<h2>ENTREGUE</h2>
|
||||
<div class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -132,21 +138,11 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<dialog id="loading" >
|
||||
<div >
|
||||
<img class="loading" src="{% static 'midia/icons/loading.svg' %}" alt="">
|
||||
</div>
|
||||
<br><br>
|
||||
<h1>Carregando...</h1>
|
||||
</dialog>
|
||||
|
||||
<script src="{% static 'orders/js/orders.js' %}"></script> {% endblock %}
|
||||
<script src="{% static 'orders/js/orders.js' %}"></script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
# from datetime import timezone
|
||||
from django.utils import timezone
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import render, redirect
|
||||
from django.http import JsonResponse, HttpResponse
|
||||
import asyncio
|
||||
import websockets
|
||||
@@ -35,7 +35,7 @@ def preparing(request, order_id):
|
||||
order.save()
|
||||
fifteen_hours_ago = timezone.now() - timezone.timedelta(hours=15)
|
||||
orders = Order.objects.filter(queue__gte=fifteen_hours_ago )
|
||||
return render(request, 'htmx_components/orders/htmx_list_orders_fila.html',{'orders': orders})
|
||||
return redirect(request.META.get('HTTP_REFERER', '/'))
|
||||
|
||||
|
||||
@group_required(groupName='Cozinha')
|
||||
@@ -45,8 +45,8 @@ def finished(request, order_id):
|
||||
order.save()
|
||||
fifteen_hours_ago = timezone.now() - timezone.timedelta(hours=15)
|
||||
orders = Order.objects.filter(queue__gte=fifteen_hours_ago )
|
||||
asyncio.run(enviar_mensagem())
|
||||
return render(request, 'htmx_components/orders/htmx_list_orders_fila.html',{'orders': orders})
|
||||
# asyncio.run(enviar_mensagem())
|
||||
return redirect(request.META.get('HTTP_REFERER', '/'))
|
||||
|
||||
@group_required(groupName='Garçom')
|
||||
def delivered(request, order_id):
|
||||
@@ -55,7 +55,7 @@ def delivered(request, order_id):
|
||||
order.save()
|
||||
fifteen_hours_ago = timezone.now() - timezone.timedelta(hours=15)
|
||||
orders = Order.objects.filter(queue__gte=fifteen_hours_ago )
|
||||
return render(request, 'htmx_components/orders/htmx_list_orders_fila.html',{'orders': orders})
|
||||
return redirect(request.META.get('HTTP_REFERER', '/'))
|
||||
|
||||
|
||||
def notificacao(request):
|
||||
|
||||
Binary file not shown.
@@ -1,103 +0,0 @@
|
||||
|
||||
|
||||
|
||||
<div class="tab">
|
||||
<button class="tablinks active" onclick="openTab(event, 'Fila')">Fila</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Preparo')">Preparo</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Finalizado')">Pronto</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Entregue')">Entregue</button>
|
||||
</div>
|
||||
|
||||
<div id="Fila" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.preparing == None and order.productComanda != Null %}
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Preparar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Preparo" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.finished == None and order.preparing != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Finalizar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Finalizado" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered == None and order.finished != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Entregar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Entregue" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<!-- <button>Preparar</button> -->
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -1,94 +0,0 @@
|
||||
|
||||
|
||||
|
||||
<div id="Fila" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.preparing == None and order.productComanda != Null %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button class="btn-primary" onclick="delayTab('Fila')"
|
||||
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Preparar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Preparo" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.finished == None and order.preparing != None %}
|
||||
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button class="btn-secondary" onclick="delayTab('Preparo')"
|
||||
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Finalizar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Finalizado" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered == None and order.finished != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button class="btn-secondary" onclick="delayTab('Finalizado')"
|
||||
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Entregar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Entregue" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered != None %}
|
||||
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -1,103 +0,0 @@
|
||||
|
||||
|
||||
|
||||
<div class="tab">
|
||||
<button class="tablinks active" onclick="openTab(event, 'Fila')">Fila</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Preparo')">Preparo</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Finalizado')">Pronto</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Entregue')">Entregue</button>
|
||||
</div>
|
||||
|
||||
<div id="Fila" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.preparing == None and order.productComanda != Null %}
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Preparar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Preparo" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.finished == None and order.preparing != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Finalizar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Finalizado" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered == None and order.finished != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Entregar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Entregue" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<!-- <button>Preparar</button> -->
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -1,103 +0,0 @@
|
||||
|
||||
|
||||
|
||||
<div class="tab">
|
||||
<button class="tablinks active" onclick="openTab(event, 'Fila')">Fila</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Preparo')">Preparo</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Finalizado')">Pronto</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Entregue')">Entregue</button>
|
||||
</div>
|
||||
|
||||
<div id="Fila" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.preparing == None and order.productComanda != Null %}
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button class="btn-primary"
|
||||
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Preparar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Preparo" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.finished == None and order.preparing != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button class="btn-secondary"
|
||||
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Finalizar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Finalizado" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered == None and order.finished != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<button
|
||||
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#list-orders"
|
||||
>Entregar</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Entregue" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered != None %}
|
||||
|
||||
<div class="m-card"
|
||||
{% if order.productComanda == Null %}
|
||||
style="background-color: rgb(253, 69, 69);"
|
||||
{% elif order.obs != '' %}
|
||||
style="background-color: rgb(243, 165, 75);"
|
||||
{% endif %}
|
||||
>
|
||||
<h4>{{order.id_product.name}}</h4>
|
||||
<h4>{{order.obs}} </h4>
|
||||
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
<!-- <button>Preparar</button> -->
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -51,7 +51,7 @@ function cookieNotificacao() {
|
||||
}
|
||||
}
|
||||
|
||||
const websocket = new WebSocket('ws://0.0.0.0:8765');
|
||||
const websocket = new WebSocket('ws://192.168.0.150:8765');
|
||||
const nomeUsuario = document.getElementById('user-info').textContent;
|
||||
|
||||
websocket.addEventListener('open', (event) => {
|
||||
@@ -64,37 +64,34 @@ websocket.addEventListener('message', (event) => {
|
||||
switch (data.local) {
|
||||
case 'cozinha':
|
||||
|
||||
|
||||
|
||||
|
||||
if (document.getElementById('Fila') !== null && data.tipo === 'add'){
|
||||
|
||||
|
||||
// const novoElemento = document.createElement('div');
|
||||
// novoElemento.innerHTML = data.message;
|
||||
// var fila = document.getElementById('Fila').appendChild(novoElemento);
|
||||
var novoElemento = document.createElement('div');
|
||||
novoElemento.innerHTML = data.message;
|
||||
document.getElementById('Fila').appendChild(novoElemento);
|
||||
let valorAtual = document.cookie.replace(/(?:(?:^|.*;\s*)notificacao\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
if (valorAtual === 'true') {
|
||||
texto = new SpeechSynthesisUtterance(data.speak);
|
||||
window.speechSynthesis.speak(texto);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 6000);
|
||||
// setTimeout(function() {
|
||||
// location.reload();
|
||||
// }, 6000);
|
||||
}
|
||||
}
|
||||
else if (document.getElementById('obs-'+data.id) !== null && data.tipo === 'edit'){
|
||||
const obs = document.getElementById('obs-'+data.id)
|
||||
// const card = obs.parentNode;
|
||||
// card.style.backgroundColor = 'rgb(243, 165, 75)';
|
||||
// obs.innerHTML = data.message;
|
||||
const card = obs.parentNode;
|
||||
card.style.backgroundColor = 'rgb(243, 165, 75)';
|
||||
obs.innerHTML = data.message;
|
||||
let valorAtual = document.cookie.replace(/(?:(?:^|.*;\s*)notificacao\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
|
||||
if (valorAtual === 'true') {
|
||||
texto = new SpeechSynthesisUtterance(data.speak);
|
||||
window.speechSynthesis.speak(texto);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 6000);
|
||||
// setTimeout(function() {
|
||||
// location.reload();
|
||||
// }, 6000);
|
||||
}
|
||||
}
|
||||
else if (document.getElementById('m-card-'+data.id) !== null && data.tipo === 'delete'){
|
||||
|
||||
@@ -1,37 +1,62 @@
|
||||
|
||||
@keyframes girar {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
||||
h4{
|
||||
color: black;
|
||||
}
|
||||
|
||||
.container {
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@keyframes jump {
|
||||
0% {
|
||||
transform: scale(0.0);
|
||||
}
|
||||
70% {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.kanban-board {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.loading {
|
||||
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
align-self: center;
|
||||
margin: 0 auto;
|
||||
animation: girar 4s infinite linear;
|
||||
.column {
|
||||
flex: 1;
|
||||
border: 1px solid #535353;
|
||||
border-radius: 6px;
|
||||
padding: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.cards-container {
|
||||
flex-grow: 1; /* Permite que o container de cards ocupe o espaço restante */
|
||||
overflow-y: auto; /* Adiciona a barra de rolagem vertical */
|
||||
max-height: 85vh; /* Defina uma altura máxima para ativar o scroll */
|
||||
padding-right: 5px; /* Espaçamento para não cortar a barra de rolagem */
|
||||
}
|
||||
|
||||
.cards-container::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.cards-container::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.cards-container::-webkit-scrollbar-thumb {
|
||||
background: #888;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.cards-container::-webkit-scrollbar-thumb:hover {
|
||||
background: #555;
|
||||
}
|
||||
|
||||
|
||||
.m-card {
|
||||
/* width: 50px; */
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 10px;
|
||||
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
|
||||
@@ -46,51 +71,24 @@
|
||||
animation: jump 0.7s;
|
||||
}
|
||||
|
||||
h4{
|
||||
color: black;
|
||||
|
||||
@media screen and (max-width: 1028px) {
|
||||
.container {
|
||||
padding: 0px;
|
||||
gap: 0px;
|
||||
min-width: 100%;
|
||||
min-height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.kanban-board {
|
||||
gap: 0px;
|
||||
}
|
||||
|
||||
.column {
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
padding-top: 15px;
|
||||
justify-content: space-between;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
border-bottom: 2px solid rgba(86, 187, 255, 0.192);
|
||||
}
|
||||
padding: 0px;
|
||||
|
||||
.tab button {
|
||||
width: 24%;
|
||||
background-color: #999aeb00;
|
||||
padding: 10px 10px;
|
||||
transition: 0.6s;
|
||||
border-radius: 20px 20px 0px 0px;
|
||||
align-items: center;
|
||||
border-color: rgba(86, 187, 255, 0.192);
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.tab button.active {
|
||||
border-radius: 8px 8px 0px 0px;
|
||||
border-color: rgba(86, 187, 255, 0.192);
|
||||
background: var(--main-gradient);
|
||||
box-shadow: 0px 0px 15px rgba(86, 187, 255, 0.815);
|
||||
}
|
||||
|
||||
.tabcontent {
|
||||
display: none;
|
||||
padding: 6px 12px;
|
||||
|
||||
}
|
||||
|
||||
#list-orders{
|
||||
justify-self: center;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
#list-orders{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@@ -4,49 +4,49 @@ function reloadPage(){
|
||||
location.reload();}, 3000);
|
||||
}
|
||||
|
||||
function openTab(evt, etapa) {
|
||||
var i, tabcontent, tablinks;
|
||||
tabcontent = document.getElementsByClassName("tabcontent");
|
||||
for (i = 0; i < tabcontent.length; i++) {
|
||||
tabcontent[i].style.display = "none";
|
||||
}
|
||||
tablinks = document.getElementsByClassName("tablinks");
|
||||
for (i = 0; i < tablinks.length; i++) {
|
||||
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
||||
}
|
||||
document.getElementById(etapa).style.display = "block";
|
||||
evt.currentTarget.className += " active";
|
||||
}
|
||||
// function openTab(evt, etapa) {
|
||||
// var i, tabcontent, tablinks;
|
||||
// tabcontent = document.getElementsByClassName("tabcontent");
|
||||
// for (i = 0; i < tabcontent.length; i++) {
|
||||
// tabcontent[i].style.display = "none";
|
||||
// }
|
||||
// tablinks = document.getElementsByClassName("tablinks");
|
||||
// for (i = 0; i < tablinks.length; i++) {
|
||||
// tablinks[i].className = tablinks[i].className.replace(" active", "");
|
||||
// }
|
||||
// document.getElementById(etapa).style.display = "block";
|
||||
// evt.currentTarget.className += " active";
|
||||
// }
|
||||
|
||||
function displayBlock(etapa) {
|
||||
// function displayBlock(etapa) {
|
||||
|
||||
document.getElementById('loading').style.display = "none";
|
||||
document.getElementById(etapa).style.display = "block";
|
||||
}
|
||||
// document.getElementById('loading').style.display = "none";
|
||||
// document.getElementById(etapa).style.display = "block";
|
||||
// }
|
||||
|
||||
|
||||
tabcontent = document.getElementsByClassName("tabcontent");
|
||||
for (i = 0; i < tabcontent.length; i++) {
|
||||
tabcontent[i].style.display = "none";
|
||||
}
|
||||
tabcontent[0].style.display = "block";
|
||||
// tabcontent = document.getElementsByClassName("tabcontent");
|
||||
// for (i = 0; i < tabcontent.length; i++) {
|
||||
// tabcontent[i].style.display = "none";
|
||||
// }
|
||||
// tabcontent[0].style.display = "block";
|
||||
|
||||
|
||||
function delayTab(tab){
|
||||
document.getElementById('Fila').style.display = "none";
|
||||
document.getElementById('Preparo').style.display = "none";
|
||||
document.getElementById('Finalizado').style.display = "none";
|
||||
document.getElementById('Entregue').style.display = "none";
|
||||
document.getElementById('loading').style.display = "block";
|
||||
// function delayTab(tab){
|
||||
// document.getElementById('Fila').style.display = "none";
|
||||
// document.getElementById('Preparo').style.display = "none";
|
||||
// document.getElementById('Finalizado').style.display = "none";
|
||||
// document.getElementById('Entregue').style.display = "none";
|
||||
// document.getElementById('loading').style.display = "block";
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
displayBlock(tab);}, 1000);
|
||||
// reloadPage();
|
||||
}
|
||||
// setTimeout(function() {
|
||||
// displayBlock(tab);}, 1000);
|
||||
// // reloadPage();
|
||||
// }
|
||||
|
||||
|
||||
displayBlock('Fila');
|
||||
// displayBlock('Fila');
|
||||
|
||||
|
||||
// function mostrarNotificacao(titulo,corpo,grupo) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user