$(() => { const updatescreen = () => { setTimeout(() => updatescreen(), 1000); recentUpdates(); }; updatescreen() }); const webrequest = (handleData) => { const conf = JSON.parse(localStorage.getItem("_config")); $.ajax({ type: "GET", url: `${location.href}src/services/acm.php?ramal=${conf.ramal}&document=${conf.company}`, headers: { Accept: "application/json", "Content-Type": "application/json", }, success: handleData, error: function (err) { console.log(err); }, }); }; const recentUpdates = () => { if (localStorage.getItem("_config")) { webrequest((response) => { if ($("#contentupdates").is(":hidden")) { $("#contentupdates").show(); } $("#contentupdateschild").html('') if(response){ response.forEach((el) => { $("#contentupdateschild").append(`

STATUS CHAMADA Session: ${el.session_call} | Telefone: ${el.phone_call} | Ramal: ${el.ramal_call} | Status: ${el.status_call} | Data: ${el.data_reg}

`); }); } localStorage.setItem("_dataUpdates", JSON.stringify(response)); }); } else { $("#contentupdates").hide(); } };