Corrigir cópia de login, senha e IP
This commit is contained in:
@@ -189,11 +189,22 @@ async function renderUnits(filter = "") {
|
|||||||
}
|
}
|
||||||
const actions = card.querySelector('.actions');
|
const actions = card.querySelector('.actions');
|
||||||
if (actions) {
|
if (actions) {
|
||||||
|
const copyIpBtn = card.querySelector('[data-act="copyip"]');
|
||||||
|
if (copyIpBtn && u.ip) {
|
||||||
|
copyIpBtn.addEventListener('click', (ev) => {
|
||||||
|
ev.stopPropagation();
|
||||||
|
copyText(u.ip);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (u.login && !actions.querySelector('[data-act="copylogin"]')) {
|
if (u.login && !actions.querySelector('[data-act="copylogin"]')) {
|
||||||
const b = document.createElement('button');
|
const b = document.createElement('button');
|
||||||
b.className = 'btn small';
|
b.className = 'btn small';
|
||||||
b.setAttribute('data-act', 'copylogin');
|
b.setAttribute('data-act', 'copylogin');
|
||||||
b.textContent = 'Copiar Login';
|
b.textContent = 'Copiar Login';
|
||||||
|
b.addEventListener('click', (ev) => {
|
||||||
|
ev.stopPropagation();
|
||||||
|
copyText(u.login);
|
||||||
|
});
|
||||||
actions.insertBefore(b, actions.querySelector('[data-act="edit"]') || null);
|
actions.insertBefore(b, actions.querySelector('[data-act="edit"]') || null);
|
||||||
}
|
}
|
||||||
if (u.senha && !actions.querySelector('[data-act="copypass"]')) {
|
if (u.senha && !actions.querySelector('[data-act="copypass"]')) {
|
||||||
@@ -201,6 +212,10 @@ async function renderUnits(filter = "") {
|
|||||||
b2.className = 'btn small';
|
b2.className = 'btn small';
|
||||||
b2.setAttribute('data-act', 'copypass');
|
b2.setAttribute('data-act', 'copypass');
|
||||||
b2.textContent = 'Copiar Senha';
|
b2.textContent = 'Copiar Senha';
|
||||||
|
b2.addEventListener('click', (ev) => {
|
||||||
|
ev.stopPropagation();
|
||||||
|
copyText(u.senha);
|
||||||
|
});
|
||||||
actions.insertBefore(b2, actions.querySelector('[data-act="edit"]') || null);
|
actions.insertBefore(b2, actions.querySelector('[data-act="edit"]') || null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user