(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/default/scheduler/list"],{1127:(e,t,s)=>{"use strict";s.r(t);var n=s(144);t.default=({tasksList:e,serverWide:t})=>{const a=n.Locale.getSection("components.lists.scheduler.tasks"),r={exec:s(513),http:s(1128),php:s(1129)};new n.Panel({cls:"list-box",renderTo:"main",items:[new n.List({...e,id:"scheduler-tasks",columns:[n.list.COLUMN_SELECTION,{header:a.lmsg("headerCommand"),sortable:!0,dataIndex:"command",renderer(e){const t="/scheduler/edit-task/id/".concat(encodeURIComponent(e.id)),s=e.description?'<div class="hint-sub hint">'.concat((0,n.escapeHtml)(e.description),"</div>"):"";return"<a href=".concat((0,n.prepareUrl)(t),">")+'<img src="'.concat(r[e.type],'" />')+"<span>".concat((0,n.escapeHtml)(e.command+(e.arguments?" ".concat(e.arguments):"")),"</span>")+"</a>".concat(s)}},{header:a.lmsg("headerSchedule"),sortable:!0,dataIndex:"period",cls:"nowrap",renderer(e){const t="/scheduler/toggle-task/id/".concat(encodeURIComponent(e.id),"/turn/").concat("1"===e.isActive?"off":"on"),r="1"===e.isActive?s(990):s(776),o=(0,n.escapeHtml)(e.schedule.trim()).replace(/\((.*)\)/,'<span class="hint">($1)</span>');return'<span class="tooltipData">'.concat("1"===e.isActive?a.lmsg("buttonToggleHintOn"):a.lmsg("buttonToggleHintOff"),"</span>")+'<a href="'.concat((0,n.prepareUrl)(t),'" data-method="post">')+'<img src="'.concat(r,'" />')+"</a>".concat(o)}},t.showSubscription?{header:a.lmsg("headerSubscription"),sortable:!0,dataIndex:"domainName",renderer(e){if(!e.domainName)return a.lmsg("serverTask",{user:e.sysUserLogin?(0,n.escapeHtml)(e.sysUserLogin):a.lmsg("unknownUser")});const s=t.subscriptionLink?t.subscriptionLink.replace(/%%id%%/,encodeURIComponent(e.domainId)):null;return s?'<a href="'.concat(s,'">').concat((0,n.escapeHtml)(e.domainName),"</a>"):(0,n.escapeHtml)(e.domainName)}}:"",{header:"",sortable:!1,renderer:e=>new n.Button({renderTo:document.body,title:a.lmsg("runTaskNow"),description:a.lmsg("runTaskNowHint"),cls:"s-btn sb-task-run-now",handler:t=>{const s=(0,n.escapeHtml)(e.command).replace(/"/g,"&quot;"),r=a.lmsg("runningTask"),o=(0,n.getComponent)("asyncProgressBarWrapper"),c=o.fly(Element.cumulativeOffset(t.target),r.replace("%%task%%",(0,n.escapeHtml)(s)),(function(){n.api.post((0,n.prepareUrl)("/scheduler/run-task"),{id:e.id}).then((function(){o.removePreparingItem(c),o.update()}))}))}})}],operations:[{componentType:n.SmallButton,id:"buttonAddTask",title:a.lmsg("add"),description:a.lmsg("hintAdd"),addCls:"sb-task-add",href:"/scheduler/add-task"},{componentType:n.SmallButton,id:"buttonSync",title:a.lmsg("sync"),description:a.lmsg("hintSync"),addCls:"sb-refresh",handler(){(0,n.getComponent)("scheduler-tasks").disable(),n.api.post((0,n.prepareUrl)("/scheduler/refresh")).then((()=>{n.api.post((0,n.prepareUrl)("/scheduler/sync")).then((()=>{(0,n.getComponent)("scheduler-tasks").reload()})).catch((()=>{(0,n.getComponent)("scheduler-tasks").enable()}))}))}},{componentType:n.bar.Separator},{componentType:n.SmallButton,id:"buttonRemoveTask",title:a.lmsg("remove"),description:a.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){(0,n.getComponent)("scheduler-tasks").execGroupOperation({url:"/scheduler/delete",subtype:"delete",mouseEvent:e,locale:{confirmOnGroupOperation:a.lmsg("confirmOnDelete")}})}},{componentType:n.bar.Separator},{componentType:n.SmallButton,id:"buttonSettings",title:a.lmsg("settings"),description:a.lmsg("hintSettings"),addCls:"sb-settings",href:"/scheduler/settings"}]})]})}},776:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},990:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/on.png?7f7c68cae29103cdfe0278b2fc8d1d9f"},1129:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/php.png?f73ac111074ad961fcae73bdf43e0354"},1128:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/web.png?81ffe26a62cd93520c381c205cfc08f8"}}]);
//# sourceMappingURL=list.js.map?93009c6f7d3df74a4049