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