Current File : /home/pacjaorg/.trash/media.1/com_scheduler/js/admin-view-run-test-task.min.js
import i from"joomla.dialog";/**
 * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */const a=(r,t="",d=[])=>{const o=document.createElement(r);return o.textContent=t,d&&d.length&&o.classList.add(...d),o},c=(r,t)=>{const d=t.querySelector(".scheduler-status"),o=t.querySelector(".progress-bar"),s=e=>{o.style.width="100%",o.classList.add(e?"bg-success":"bg-danger"),setTimeout(()=>o.classList.remove("progress-bar-animated"),500)};o.style.width="15%",fetch(r,{headers:{"X-CSRF-Token":Joomla.getOptions("csrf.token","")}}).then(e=>{if(!e.ok)throw new Error(Joomla.Text._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",e.status).replace("%d",e.status));return e.json()}).then(e=>{if(!e.data)throw new Error(Joomla.Text._("JLIB_JS_AJAX_ERROR_NO_CONTENT"));d.textContent=Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_COMPLETED"),e.data.duration>0&&t.appendChild(a("div",Joomla.Text._("COM_SCHEDULER_TEST_RUN_DURATION").replace("%s",e.data.duration.toFixed(2)))),e.data.output&&(t.appendChild(a("div",Joomla.Text._("COM_SCHEDULER_TEST_RUN_OUTPUT").replace("%s","").replace("<br>",""))),t.appendChild(a("pre",e.data.output,["bg-body","p-2"]))),s(!0)}).catch(e=>{s(!1),d.textContent=Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_TERMINATED"),t.appendChild(a("div",e.message,["text-danger"]))})};document.addEventListener("click",r=>{const t=r.target.closest("button[data-scheduler-run]");if(!t)return;r.preventDefault();const{id:d,title:o,url:s}=t.dataset,e=(()=>{const n=a("div","",["p-3"]),_=a("div","",["progress","mb-2"]),T=a("div","",["progress-bar","progress-bar-striped","progress-bar-animated"]);return n.appendChild(a("h4",Joomla.Text._("COM_SCHEDULER_TEST_RUN_TASK").replace("%s",o))),n.appendChild(a("div",Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_STARTED"),["mb-2","scheduler-status"])),_.appendChild(T),n.appendChild(_),T.style.width="0%",n})(),l=new i({popupType:"inline",textHeader:Joomla.Text._("COM_SCHEDULER_TEST_RUN_TITLE").replace("%d",d),textClose:Joomla.Text._("JCLOSE"),popupContent:e,width:"800px",height:"fit-content"});l.addEventListener("joomla-dialog:open",()=>{c(s,e)}),l.addEventListener("joomla-dialog:close",()=>{window.location.reload()}),l.show()});
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!