(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/server/tools"],{832:(e,t,s)=>{"use strict";s.r(t),s.d(t,{PanelAccess:()=>g});var n=s(154),a=s(261),o=s.n(a),r=s(155),l=s(144),i=s(597),c=s(635);const m="enabled",p="disabled",u="domain",d=l.Locale.getTranslate("components.forms.panel-access"),g=({getAccessUrl:e,setAccessUrl:t,helpUrl:s,httpsPort:a})=>{const[o,g]=(0,i.default)("customize-panel-access"),[b,f]=(0,n.useState)(!0),[E,k]=(0,n.useState)(null),[y,h]=(0,n.useState)(null),[w,v]=(0,n.useState)(null),[P,S]=(0,n.useState)(null),{addToast:x}=(0,c.useToaster)();(0,n.useEffect)((()=>{o&&(f(!0),l.api.get(e).then((e=>{k({proxy:B(e),domainName:e.domainName}),f(!1)})))}),[o,e]);const B=e=>e.proxy?e.domainName?u:m:p;return(0,n.createElement)(r.Drawer,{title:(0,n.createElement)(d,{content:"title"}),size:"sm",isOpen:o,onClose:()=>g(!1),form:{values:E,vertical:!0,state:w,applyButton:!1,hideRequiredLegend:!0,submitButton:{disabled:b},onSubmit:async({proxy:e,domainName:s})=>{if(h(null),v(null),S(null),e===u&&!s)return void h({domainName:{isEmpty:(0,n.createElement)(d,{content:"domainNameIsRequired"})}});v("submit");const a=await l.api.post(t,{proxy:e!==p,domainName:e===u?s:""});if(v(null),!a||"error"!==a.status)return x({intent:"success",message:(0,n.createElement)(d,{content:"successMessage"})}),void g(!1);a.formMessages&&Object.keys(a.formMessages).forEach((e=>h({[e]:a.formMessages[e]}))),a.messages&&S(a.messages)},errors:y},"data-type":"customize-panel-access"},(0,n.createElement)(r.Paragraph,null,(0,n.createElement)(d,{content:"hint",params:{httpsPort:a,link:s?(0,n.createElement)("a",{href:s,target:"_blank",id:"linkOpenHelp",rel:"noopener noreferrer"},(0,n.createElement)(d,{content:"details"})):""}})),b?(0,n.createElement)(r.ContentLoader,null):(0,n.createElement)(n.Fragment,null,P?(0,n.createElement)(n.Fragment,null,P.map((e=>(0,n.createElement)(r.StatusMessage,{intent:"danger",key:e},e)))):null,(0,n.createElement)(r.FormFieldRadioButtons,{name:"proxy",options:[{value:m,label:(0,n.createElement)(d,{content:"proxyEnabled"})},{value:u,label:(0,n.createElement)(d,{content:"proxyDomain"}),indentFields:[(0,n.createElement)(r.FormFieldText,{key:"domainName",name:"domainName",placeholder:"www.example.com",size:"lg"})]},{value:p,label:(0,n.createElement)(d,{content:"proxyDisabled",params:{httpsPort:a}})}]})))};g.propTypes={getAccessUrl:o().string.isRequired,setAccessUrl:o().string.isRequired,helpUrl:o().string.isRequired,httpsPort:o().string.isRequired};const b=e=>{const[t]=(0,i.default)("customize-panel-access"),[s,a]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{t&&a(!0)}),[t]),s?(0,n.createElement)(g,e):null};b.propTypes=g.propTypes,t.default=b},831:(e,t,s)=>{"use strict";s.r(t);var n=s(155),a=s(154),o=s(302),r=s(405),l=s(261),i=s.n(l),c=s(144),m=s(447),p=s(582),u=s(602),d=s(648),g=s(832);const b=[{name:"securityButtons",id:"securityPanel",icon:s(833)},{name:"troubleshootingButtons",id:"troubleshootingPanel",icon:s(834)},{name:"serviceInstallationsButtons",id:"servicesPanel",icon:s(835)},{name:"toolsAndResourcesButtons",id:"resourcesPanel",icon:s(835)},{name:"generalButtons",id:"generalPanel",icon:s(836)},{name:"serverManagementButtons",id:"serverManagementPanel",icon:s(837)},{name:"statisticsButtons",id:"statisticsPanel",icon:s(838)},{name:"mailButtons",id:"mailPanel",icon:s(839)},{name:"applicationsAndDatabasesButtons",id:"applicationsAndDatabasesPanel",icon:s(840)},{name:"panelButtons",id:"panelPanel",icon:s(841)},{name:"uiButtons",id:"uiPanel",icon:s(842)},{name:"myPleskButtons",id:"myPleskPanel",icon:s(843)},{name:"customButtons",id:"customButtons",title:"additionalServices",icon:s(756)}],f=o.gql`
    mutation RebootServer {
        rebootServer
    }
`,E=o.gql`
    mutation ShutdownServer {
        shutdownServer
    }
`,k="admin-server-tools",y=c.Locale.getTranslate("admin.controllers.server.tools"),h=e=>{const{sections:t,panelAccess:s}=e,[o]=(0,r.useMutation)(f,{errorPolicy:"all"}),[l]=(0,r.useMutation)(E,{errorPolicy:"all"}),i={rebootServer(){const e=c.Locale.getSection("admin.controllers.server.tools"),t=c.Locale.getSection("components.buttons");c.messageBox.show({type:c.messageBox.TYPE_YESNO,subtype:"reboot",text:e.lmsg("buttonServerRebootConfirmationTitle"),description:e.lmsg("buttonServerRebootConfirmationDescription"),async onYesClick(){(0,c.clearStatusMessages)();try{const{errors:e}=await o();(e||[]).forEach((({message:e})=>(0,c.addStatusMessage)("warning",e)))}catch(e){}},buttonTitles:{yes:t.lmsg("yes"),no:t.lmsg("no")}})},shutdownServer(){const e=c.Locale.getSection("admin.controllers.server.tools"),t=c.Locale.getSection("components.buttons");c.messageBox.show({type:c.messageBox.TYPE_YESNO,subtype:"shutdown",text:e.lmsg("buttonShutdownConfirmationTitle"),description:e.lmsg("buttonShutdownConfirmationDescription"),async onYesClick(){(0,c.clearStatusMessages)();try{const{errors:e}=await l();(e||[]).forEach((({message:e})=>(0,c.addStatusMessage)("warning",e)))}catch(e){}},buttonTitles:{yes:t.lmsg("yes"),no:t.lmsg("no")}})},"AdminPanel.ServerTools.showReporterPopup"({props:{supportUrl:e}}){new c.ReporterPopup({supportUrl:e,cls:"popup-panel",locale:c.Locale.getSection("components.issue-reporter")})}},u=t=>i[t]?s=>{s.preventDefault(),i[t]({props:e})}:null,d="true"===m.default.get("debug-testing-mode");return(0,a.createElement)("div",{"data-id":"tools-list"},(0,a.createElement)(n.Paragraph,null,(0,a.createElement)(y,{content:"pageHint"})),(0,a.createElement)(n.Grid,{minColumnWidth:d?0:150,maxColumnsNumber:({width:e})=>e>1800?5:e>1100?4:e>600?3:2,sm:d?3:null,className:`${k}__sections`,gap:"md"},b.filter((({name:e})=>t[e])).map((({name:e,id:s,icon:o,title:r})=>(0,a.createElement)(n.GridCol,{key:s},(0,a.createElement)(n.Item,{id:s,icon:(0,a.createElement)(n.Icon,{src:o,size:"32"}),title:(0,a.createElement)("span",{className:`${k}__section-title`},(0,a.createElement)(y,{content:r||s}))},(0,a.createElement)("ul",{className:`${k}__section-content`,id:`${s}-tools-list`,"data-type":"tools-section-content"},t[e].map((({id:e,description:t,href:s,target:o,title:r,handler:l,attention:i})=>{const c=(0,a.createElement)(p.default,{to:s,target:o,onClick:u(l)},i?(0,a.createElement)("span",{className:"hint-attention"},r):r);return(0,a.createElement)("li",{key:e,id:e,className:`${k}__section-item`},t?(0,a.createElement)(n.Tooltip,{title:t},c):c)})))))))),(0,a.createElement)(g.default,s))};h.propTypes={sections:i().object.isRequired,panelAccess:i().object.isRequired},t.default=(0,u.withPageLayout)((0,d.withPageContent)(h))},830:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n.default});var n=s(831)},840:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/applications-and-databases.png?31b2124ea5175fb574f77cc3c43d9216"},842:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/branding.png?bb7cecce78a80689f82c7572493996fb"},756:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/custom-buttons.png?7cf218aebaf85599ee9d8db8e1a3ee91"},843:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/external-services.png?6b1ed2ce8b6bbdd13558424ab047b5af"},839:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/mail.png?a8efbdef83b8bf575d0b6b9e48a161dd"},835:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/manage.png?9fce3fccefdab269fb4a897f91509b5d"},841:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/panel.png?d1ffcf89a8b0751810a10dcbba2f454a"},836:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/preferences.png?3e21b876f5b895bcb4c400b77821ca53"},833:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/protect.png?f3de9d854c205798732f51dfc82cbdf7"},837:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/server.png?972b6d4fd5488c8de0c79459dfbdd65e"},838:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/statistics.png?ec7232887a24c97fc209fdb24b00140c"},834:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/support.png?9dfb7944b29c37c37efd99bb822079a9"}}]);
//# sourceMappingURL=tools.js.map?1e9ae6fb0d835118e9a8