feat: speek funcionando no android atraves do firefox

This commit is contained in:
2025-01-28 10:44:20 -03:00
parent 7005796e7a
commit 7ccc505299
7 changed files with 24 additions and 11 deletions

View File

@@ -9,3 +9,4 @@ python manage.py migrate
python manage.py createsuperuser python manage.py createsuperuser
pip freeze > requirements.txt pip freeze > requirements.txt
pip install -r requirements.txt pip install -r requirements.txt
python manage.py runserver_plus 192.168.0.100:8000 --cert-file /tmp/cert.crt

Binary file not shown.

View File

@@ -1,5 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load static %} {% load static %}
{% load custom_filter_tag %}
<!DOCTYPE html> <!DOCTYPE html>
@@ -51,9 +53,11 @@
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4> <h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_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> <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')" <button class="btn-primary" onclick="delayTab('Fila')"
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#etapas" hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#etapas"
>Preparar</button> >Preparar</button>
{% endif %}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@@ -75,9 +79,11 @@
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4> <h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_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> <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')" <button class="btn-secondary" onclick="delayTab( 'Preparo')"
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#etapas" hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#etapas"
>Finalizar</button> >Finalizar</button>
{% endif %}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@@ -98,9 +104,11 @@
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4> <h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_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> <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')" <button class="btn-secondary" onclick="delayTab( 'Finalizado')"
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#etapas" hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#etapas"
>Entregar</button> >Entregar</button>
{% endif %}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@@ -4,7 +4,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="pt-BR"> <html lang="pt-BR" id="all">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -24,7 +24,6 @@
<div class="logo"> <div class="logo">
<h1> <h1>
<img src="{% static 'midia/logo.png' %}" width="60"> <img src="{% static 'midia/logo.png' %}" width="60">
</h1> </h1>
</div> </div>
<div class="nav-list"> <div class="nav-list">

View File

@@ -11,4 +11,14 @@ function menuShow() {
function entrar(){ function entrar(){
alert('Onde tu pensa que vai entrar?🤨'); alert('Onde tu pensa que vai entrar?🤨');
} }
var elem = document.getElementById("all");
function openFullscreen() {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.webkitRequestFullscreen) { /* Safari */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE11 */
elem.msRequestFullscreen();
}
}

View File

@@ -58,10 +58,8 @@ function notificacao(){
if (data['notificacao'] == 'true'){ if (data['notificacao'] == 'true'){
console.log('verdadeiro') console.log('verdadeiro')
document.cookie = `pronto=${data['pronto']}`; document.cookie = `pronto=${data['pronto']}`;
// navigator.vibrate(200);
// navigator.vibrate([200, 100, 200]);
mostrarNotificacao(data['titulo'], data['corpo'],'Garçom') mostrarNotificacao(data['titulo'], data['corpo'],'Garçom')
texto = new SpeechSynthesisUtterance(data['corpo']+', para '+data['titulo']); texto = new SpeechSynthesisUtterance(data['corpo']+', para '+data['titulo']+' tá pronto.');
window.speechSynthesis.speak(texto); window.speechSynthesis.speak(texto);
console.log(data['notificacao']) console.log(data['notificacao'])
@@ -78,7 +76,6 @@ function notificacao(){
} }
setInterval(()=> { setInterval(()=> {
notificacao() notificacao()
}, 10000) }, 10000)

View File

@@ -77,16 +77,14 @@ function notificacao(){
.then(data => { .then(data => {
if (data['notificacao'] == 'true'){ if (data['notificacao'] == 'true'){
document.cookie = `fila=${data['fila']}`; document.cookie = `fila=${data['fila']}`;
// navigator.vibrate(200);
// navigator.vibrate([200, 100, 200]);
mostrarNotificacao(data['titulo'], data['corpo'],'Cozinha') mostrarNotificacao(data['titulo'], data['corpo'],'Cozinha')
texto = new SpeechSynthesisUtterance(data['corpo']+', '+data['titulo']+'.');
window.speechSynthesis.speak(texto);
}else{ }else{
console.log(data['notificacao']) console.log(data['notificacao'])
console.log('notificação foi false') console.log('notificação foi false')
} }
// var produtos_mais_vendidos = data.produtos_mais_vendidos
}) })
.catch(error => { .catch(error => {
alert('Erro verificar notificação:', error) alert('Erro verificar notificação:', error)