(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/server/tools"],{1085:(e,s,t)=>{"use strict";t.r(s),t.d(s,{PanelAccess:()=>b,default:()=>x});var n=t(242),o=t(244),a=t.n(o),i=t(243),r=t(90),l=t(745),c=t(668);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},1084:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>k});var n=t(244),o=t.n(n),a=t(449),i=t(751),r=t(243),l=t(90),c=t(318),d=t(764),p=t(727),u=t(1085),m=t(242);const b=[{name:"securityButtons",id:"securityPanel",icon:t(1086)},{name:"troubleshootingButtons",id:"troubleshootingPanel",icon:t(1087)},{name:"serviceInstallationsButtons",id:"servicesPanel",icon:t(1088)},{name:"toolsAndResourcesButtons",id:"resourcesPanel",icon:t(1088)},{name:"generalButtons",id:"generalPanel",icon:t(1089)},{name:"serverManagementButtons",id:"serverManagementPanel",icon:t(1090)},{name:"statisticsButtons",id:"statisticsPanel",icon:t(1091)},{name:"mailButtons",id:"mailPanel",icon:t(1092)},{name:"applicationsAndDatabasesButtons",id:"applicationsAndDatabasesPanel",icon:t(1093)},{name:"panelButtons",id:"panelPanel",icon:t(1094)},{name:"uiButtons",id:"uiPanel",icon:t(1095)},{name:"myPleskButtons",id:"myPleskPanel",icon:t(1096)},{name:"customButtons",id:"customButtons",title:"additionalServices",icon:t(969)}],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)},1083:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n.default});var n=t(1084)},1093:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/applications-and-databases.png?31b2124ea5175fb574f77cc3c43d9216"},1095:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/branding.png?bb7cecce78a80689f82c7572493996fb"},969:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/custom-buttons.png?7cf218aebaf85599ee9d8db8e1a3ee91"},1096:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/external-services.png?6b1ed2ce8b6bbdd13558424ab047b5af"},1092:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/mail.png?a8efbdef83b8bf575d0b6b9e48a161dd"},1088:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/manage.png?9fce3fccefdab269fb4a897f91509b5d"},1094:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/panel.png?d1ffcf89a8b0751810a10dcbba2f454a"},1089:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/preferences.png?3e21b876f5b895bcb4c400b77821ca53"},1086:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/protect.png?f3de9d854c205798732f51dfc82cbdf7"},1090:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/server.png?972b6d4fd5488c8de0c79459dfbdd65e"},1091:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/statistics.png?ec7232887a24c97fc209fdb24b00140c"},1087:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/support.png?9dfb7944b29c37c37efd99bb822079a9"}}]);
//# sourceMappingURL=tools.js.map?865680493458c5e79ffd