(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/scheduler/list"],{804:(e,s,t)=>{"use strict";t.r(s);var n=t(153),r=t(260),a=t.n(r),o=t(608),l=t(576),i=t(805);const d=({...e})=>(0,n.createElement)(l.default,null,(()=>(0,i.default)(e)));d.propTypes={data:a().object.isRequired,dataUrl:a().string.isRequired,searchFilters:a().object.isRequired,showSubscription:a().bool.isRequired,subscriptionLink:a().string},d.defaultProps={subscriptionLink:""},s.default=(0,o.withPageLayout)(d)},803:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n.default});var n=t(804)},805:(e,s,t)=>{"use strict";t.r(s);var n=t(143);const r=n.Locale.getSection("components.lists.scheduler.tasks"),a={exec:t(512),http:t(806),php:t(807)};s.default=({data:e,dataUrl:s,searchFilters:o,showSubscription:l,subscriptionLink:i})=>new n.Panel({cls:"list-box",renderTo:"main",items:[new n.List({data:e,dataUrl:s,searchFilters:o,id:"scheduler-tasks",columns:[n.list.COLUMN_SELECTION,{header:r.lmsg("headerCommand"),sortable:!0,dataIndex:"command",renderer(e){const s=`/scheduler/edit-task/id/${encodeURIComponent(e.id)}`,t=e.description?`<div class="hint-sub hint">${(0,n.escapeHtml)(e.description)}</div>`:"";return`<a href=${(0,n.prepareUrl)(s)}><img src="${a[e.type]}" /><span>${(0,n.escapeHtml)(e.command+(e.arguments?` ${e.arguments}`:""))}</span></a>${t}`}},{header:r.lmsg("headerSchedule"),sortable:!0,dataIndex:"period",cls:"nowrap",renderer(e){const s=`/scheduler/toggle-task/id/${encodeURIComponent(e.id)}/turn/${"1"===e.isActive?"off":"on"}`,a="1"===e.isActive?t(808):t(809),o=(0,n.escapeHtml)(e.schedule.trim()).replace(/\((.*)\)/,'<span class="hint">($1)</span>');return`<span class="tooltipData">${"1"===e.isActive?r.lmsg("buttonToggleHintOn"):r.lmsg("buttonToggleHintOff")}</span><a href="${(0,n.prepareUrl)(s)}" data-method="post"><img src="${a}" /></a>${o}`}},l?{header:r.lmsg("headerSubscription"),sortable:!0,dataIndex:"domainName",renderer(e){if(!e.domainName)return r.lmsg("serverTask",{user:e.sysUserLogin?(0,n.escapeHtml)(e.sysUserLogin):r.lmsg("unknownUser")});const s=i?i.replace(/%%id%%/,encodeURIComponent(e.domainId)):null;return s?`<a href="${s}">${(0,n.escapeHtml)(e.domainName)}</a>`:(0,n.escapeHtml)(e.domainName)}}:"",{header:"",sortable:!1,renderer:e=>new n.Button({renderTo:document.body,title:r.lmsg("runTaskNow"),description:r.lmsg("runTaskNowHint"),cls:"s-btn sb-task-run-now",handler:s=>{const t=(0,n.escapeHtml)(e.command).replace(/"/g,"&quot;"),a=r.lmsg("runningTask"),o=(0,n.getComponent)("asyncProgressBarWrapper"),l=o.fly(Element.cumulativeOffset(s.target),a.replace("%%task%%",(0,n.escapeHtml)(t)),(function(){n.api.post((0,n.prepareUrl)("/scheduler/run-task"),{id:e.id}).then((function(){o.removePreparingItem(l),o.update()}))}))}})}],operations:[{componentType:n.SmallButton,id:"buttonAddTask",title:r.lmsg("add"),description:r.lmsg("hintAdd"),addCls:"sb-task-add btn-primary",href:"/scheduler/add-task"},{componentType:n.SmallButton,id:"buttonSync",title:r.lmsg("sync"),description:r.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:r.lmsg("remove"),description:r.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){(0,n.getComponent)("scheduler-tasks").execGroupOperation({url:"/scheduler/delete",subtype:"delete",mouseEvent:e,locale:{confirmOnGroupOperation:r.lmsg("confirmOnDelete")}})}},{componentType:n.bar.Separator},{componentType:n.SmallButton,id:"buttonSettings",title:r.lmsg("settings"),description:r.lmsg("hintSettings"),addCls:"sb-settings",href:"/scheduler/settings"}]})]})},809:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},808:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/on.png?7f7c68cae29103cdfe0278b2fc8d1d9f"},807:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/php.png?f73ac111074ad961fcae73bdf43e0354"},806:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/web.png?81ffe26a62cd93520c381c205cfc08f8"}}]);
//# sourceMappingURL=list.js.map?86dd0c6da484ceea8e04