(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/php-handler/list"],{802:(e,t,a)=>{"use strict";a.r(t),a.d(t,{HandlerStatus:()=>h});var s=a(147),n=a.n(s),l=a(143),d=a(154),r=a(153),i=a(260),o=a.n(i);class h extends r.Component{constructor(...e){super(...e),n()(this,"state",{toggling:!1,enabled:this.props.handler.enabled}),n()(this,"handleToggle",(()=>{this.setState({toggling:!0}),new Ajax.Request((0,l.prepareUrl)(`/php-handler/toggle/id/${this.props.handler.id}`),{onSuccess:({responseText:e})=>{const{status:t,statusMessages:a}=JSON.parse(e);(0,l.clearStatusMessages)(),a.forEach((({status:e,content:t})=>{(0,l.addStatusMessage)(e,t)})),this.setState({toggling:!1,enabled:"success"===t?!this.state.enabled:this.state.enabled})}})}))}render(){const{registered:e,allowed:t}=this.props.handler,{toggling:a,enabled:s}=this.state;let n=null;return e?t||(n=(0,r.createElement)(d.Translate,{content:"statusDisallowedApacheModule"})):n=(0,r.createElement)(d.Translate,{content:"statusBroken"}),(0,r.createElement)(d.Switch,{checked:s&&e&&t,onChange:this.handleToggle,disabled:!e||!t,tooltip:n,loading:a})}}h.propTypes={handler:o().object.isRequired}},800:(e,t,a)=>{"use strict";a.r(t);var s=a(153),n=a(260),l=a.n(n),d=a(143),r=a(608),i=a(576),o=a(801);const h=({hint:e,...t})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(i.default,null,(()=>new d.Hint({hint:e}))),(0,s.createElement)(i.default,null,(()=>(0,o.default)(t))));h.propTypes={data:l().object.isRequired,dataUrl:l().string.isRequired,hint:l().string.isRequired},t.default=(0,r.withPageLayout)(h)},799:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s.default});var s=a(800)},801:(e,t,a)=>{"use strict";a.r(t);var s=a(153),n=a(143),l=a(154),d=a(802);const r=[],i=n.Locale.getSection("admin.components.lists.phphandlers");t.default=({data:e,dataUrl:t})=>new n.Panel({cls:"list-box",items:[new n.List({id:"php-handler-list",data:e,dataUrl:t,columns:[{header:"",cls:"icon",renderer:({id:e})=>`<div id="php-handler-status-${e}"></div>`},{header:i.lmsg("name"),sortable:!0,dataIndex:"name",renderer({id:e,name:t,registered:a,outdated:s,deprecated:l}){let d="";return s?d=l?i.lmsg("handlerOutdatedAndDeprecated"):i.lmsg("handlerOutdated"):l&&(d=i.lmsg("handlerDeprecated")),d&&(d=`<span class='state-error'>${d}</span>`),a?`<a href="${(0,n.prepareUrl)(`/php-handler/modules/id/${e}`)}">${(0,n.escapeHtml)(t)}</a> ${d}`:(0,n.escapeHtml)(t)+d}},{header:i.lmsg("domains"),sortable:!1,cls:"number t-r",renderer:({id:e,enabled:t,domains:a})=>t||0!==a.length?0===a.length?"0":`<a href="#" id="php-handler-domains-${e}">${a.length}</a>`:""}],onRedraw(){if(r.forEach((e=>{(0,s.unmountComponentAtNode)(e)})),!this._data)return;const e=this._getRandomNumber();this._randomId=e,this._data.forEach((e=>{0!==e.domains.length&&document.getElementById(`php-handler-domains-${e.id}`).addEventListener("click",(t=>{t.preventDefault();let a=i.lmsg("domainsTitle");a=a.replace("%%domains%%",e.domains.length).replace("%%handler%%",e.name);let s=e.domains.map((e=>(0,n.escapeHtml)(e))).join("<br/>");s=`<div class='apps-box clearfix' style='overflow: auto; max-height: 300px;'>${s}</div>`,new n.Popup({closeButtonEnabled:!0,title:(0,n.escapeHtml)(a),content:s,buttons:[{title:(0,n.escapeHtml)(i.lmsg("closeTitle")),handler:(e,t)=>{t.hide()}}]})}));const t=document.getElementById(`php-handler-status-${e.id}`);r.push(t),(0,s.render)((0,s.createElement)(l.LocaleProvider,{messages:i.messages},(0,s.createElement)(d.HandlerStatus,{handler:e})),t)}))}})]})}}]);
//# sourceMappingURL=list.js.map?83475b88bab0a76a4007