style(master): substituir botoes de acao de WhatsApp por icones compactos
This commit is contained in:
@@ -16,6 +16,14 @@ const emailForm = document.querySelector('#email-form'),
|
||||
|
||||
let empresas = [];
|
||||
|
||||
const Icons = {
|
||||
userCheck: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline></svg>',
|
||||
qrCode: '<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect><rect x="14" y="14" width="3" height="3"></rect><rect x="18" y="18" width="3" height="3"></rect><rect x="18" y="14" width="3" height="3"></rect><rect x="14" y="18" width="3" height="3"></rect></svg>',
|
||||
restart: '<svg viewBox="0 0 24 24" aria-hidden="true"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>',
|
||||
trash: '<svg viewBox="0 0 24 24" aria-hidden="true"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>',
|
||||
check: '<svg viewBox="0 0 24 24" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>'
|
||||
};
|
||||
|
||||
const emailKeys = ['smtp_from', 'smtp_host', 'smtp_password', 'smtp_port', 'smtp_starttls', 'smtp_user'];
|
||||
const abacateKeys = ['abacatepay_api_key', 'abacatepay_webhook_secret'];
|
||||
|
||||
@@ -135,21 +143,21 @@ async function loadEvolution() {
|
||||
let btns = [];
|
||||
|
||||
// Botão Reativar para Cliente (sempre disponível)
|
||||
btns.push(`<button class="btn secondary" type="button" onclick="abrirModalReativar('${safeName}', ${i.empresa_id || 'null'}, '${i.numero_whatsapp || ''}')">Reativar</button>`);
|
||||
btns.push(`<button class="table-icon-btn" type="button" onclick="abrirModalReativar('${safeName}', ${i.empresa_id || 'null'}, '${i.numero_whatsapp || ''}')" title="Reativar para cliente" aria-label="Reativar para cliente">${Icons.userCheck}</button>`);
|
||||
|
||||
// Se pendente com empresa vinculada, botão aprovar rápido
|
||||
if (i.status === 'pendente' && i.empresa_id && i.db_id) {
|
||||
btns.push(`<button class="btn secondary" type="button" onclick="aprovar(${i.empresa_id}, ${i.db_id})">Aprovar</button>`);
|
||||
btns.push(`<button class="table-icon-btn" style="color:var(--ok);" type="button" onclick="aprovar(${i.empresa_id}, ${i.db_id})" title="Aprovar acesso" aria-label="Aprovar acesso">${Icons.check}</button>`);
|
||||
}
|
||||
|
||||
// Se não conectado na Evolution, botões de QR Code e Reiniciar
|
||||
if (String(i.connection_status).toLowerCase() !== 'open') {
|
||||
btns.push(`<button class="btn secondary" type="button" onclick="verQrCode('${safeName}')">QR Code</button>`);
|
||||
btns.push(`<button class="btn secondary" type="button" onclick="reiniciarEvolution('${safeName}')">Reiniciar</button>`);
|
||||
btns.push(`<button class="table-icon-btn" type="button" onclick="verQrCode('${safeName}')" title="Ver QR Code" aria-label="Ver QR Code">${Icons.qrCode}</button>`);
|
||||
btns.push(`<button class="table-icon-btn" type="button" onclick="reiniciarEvolution('${safeName}')" title="Reiniciar conexão na Evolution" aria-label="Reiniciar conexão">${Icons.restart}</button>`);
|
||||
}
|
||||
|
||||
// Botão Excluir da Evolution (sempre disponível)
|
||||
btns.push(`<button class="btn danger" type="button" onclick="excluirEvolution('${safeName}')">Excluir da Evolution</button>`);
|
||||
btns.push(`<button class="table-icon-btn danger" type="button" onclick="excluirEvolution('${safeName}')" title="Excluir da Evolution" aria-label="Excluir da Evolution">${Icons.trash}</button>`);
|
||||
|
||||
return `<tr>
|
||||
<td><code>${instName}</code></td>
|
||||
@@ -157,7 +165,7 @@ async function loadEvolution() {
|
||||
<td>${numFmt}</td>
|
||||
<td>${connBadge}</td>
|
||||
<td>${platBadge}</td>
|
||||
<td style="white-space: nowrap;">${btns.join(' ')}</td>
|
||||
<td><div class="table-actions start">${btns.join('')}</div></td>
|
||||
</tr>`;
|
||||
}).join('');
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user