(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/server/tools"],{991:(e,s,t)=>{"use strict";t.r(s),t.d(s,{PanelAccess:()=>b});var n=t(208),o=t(210),a=t.n(o),i=t(209),r=t(88),l=t(710),c=t(714);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,f]=(0,n.useState)(!0),[x,h]=(0,n.useState)(null),[k,y]=(0,n.useState)(null),[w,j]=(0,n.useState)(null),[v,S]=(0,n.useState)(null);(0,n.useEffect)((()=>{a&&(f(!0),r.api.get(e).then((e=>{h({proxy:P(e),domainName:e.domainName}),f(!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:x,vertical:!0,state:w,applyButton:!1,hideRequiredLegend:!0,submitButton:{disabled:g},onSubmit:async({proxy:e,domainName:t})=>{if(y(null),j(null),S(null),e===u&&!t)return void y({domainName:{isEmpty:(0,n.jsx)(m,{content:"domainNameIsRequired"})}});j("submit");const o=await r.api.post(s,{proxy:e!==p,domainName:e===u?t:""});if(j(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=>y({[e]:o.formMessages[e]}))),o.messages&&S(o.messages)},errors:k},"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,s.default=g},990:(e,s,t)=>{"use strict";t.r(s);var n=t(210),o=t.n(n),a=t(255),i=t(361),r=t(209),l=t(88),c=t(403),d=t(489),p=t(748),u=t(991),m=t(208);const b=[{name:"securityButtons",id:"securityPanel",icon:t(992)},{name:"troubleshootingButtons",id:"troubleshootingPanel",icon:t(993)},{name:"serviceInstallationsButtons",id:"servicesPanel",icon:t(994)},{name:"toolsAndResourcesButtons",id:"resourcesPanel",icon:t(994)},{name:"generalButtons",id:"generalPanel",icon:t(995)},{name:"serverManagementButtons",id:"serverManagementPanel",icon:t(996)},{name:"statisticsButtons",id:"statisticsPanel",icon:t(997)},{name:"mailButtons",id:"mailPanel",icon:t(998)},{name:"applicationsAndDatabasesButtons",id:"applicationsAndDatabasesPanel",icon:t(999)},{name:"panelButtons",id:"panelPanel",icon:t(1e3)},{name:"uiButtons",id:"uiPanel",icon:t(1001)},{name:"myPleskButtons",id:"myPleskPanel",icon:t(1002)},{name:"customButtons",id:"customButtons",title:"additionalServices",icon:t(872)}],g=a.gql`
    mutation RebootServer {
        rebootServer
    }
`,f=a.gql`
    mutation ShutdownServer {
        shutdownServer
    }
`,x="admin-server-tools",h=l.Locale.getTranslate("admin.controllers.server.tools"),k=e=>{const{sections:s,panelAccess:t}=e,[n]=(0,i.useMutation)(g,{errorPolicy:"all"}),[o]=(0,i.useMutation)(f,{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,k="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:k?0:150,maxColumnsNumber:({width:e})=>e>1800?5:e>1100?4:e>600?3:2,sm:k?3:null,className:`${x}__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:`${x}__section-title`,children:(0,m.jsx)(h,{content:o||t})}),children:(0,m.jsx)("ul",{className:`${x}__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})=>{const l=(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:`${x}__section-item`,children:s?(0,m.jsx)(r.Tooltip,{title:s,children:l}):l},e)}))})})},t)))}),(0,m.jsx)(u.default,{...t})]})};k.propTypes={sections:o().object.isRequired,panelAccess:o().object.isRequired},s.default=(0,p.withPageLayout)(k)},989:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n.default});var n=t(990)},999:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/applications-and-databases.png?31b2124ea5175fb574f77cc3c43d9216"},1001:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/branding.png?bb7cecce78a80689f82c7572493996fb"},872:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/custom-buttons.png?7cf218aebaf85599ee9d8db8e1a3ee91"},1002:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/external-services.png?6b1ed2ce8b6bbdd13558424ab047b5af"},998:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/mail.png?a8efbdef83b8bf575d0b6b9e48a161dd"},994:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/manage.png?9fce3fccefdab269fb4a897f91509b5d"},1e3:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/panel.png?d1ffcf89a8b0751810a10dcbba2f454a"},995:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/preferences.png?3e21b876f5b895bcb4c400b77821ca53"},992:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/protect.png?f3de9d854c205798732f51dfc82cbdf7"},996:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/server.png?972b6d4fd5488c8de0c79459dfbdd65e"},997:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/statistics.png?ec7232887a24c97fc209fdb24b00140c"},993:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/support.png?9dfb7944b29c37c37efd99bb822079a9"}}]);
//# sourceMappingURL=tools.js.map?7d109d49960b6cabaf43