(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/server/tools"],{1008:(e,s,t)=>{"use strict";t.r(s),t.d(s,{PanelAccess:()=>b,default:()=>x});var n=t(216),o=t(218),a=t.n(o),i=t(217),r=t(96),l=t(727),c=t(731);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},1007:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>k});var n=t(218),o=t.n(n),a=t(267),i=t(373),r=t(217),l=t(96),c=t(416),d=t(502),p=t(765),u=t(1008),m=t(216);const b=[{name:"securityButtons",id:"securityPanel",icon:t(1009)},{name:"troubleshootingButtons",id:"troubleshootingPanel",icon:t(1010)},{name:"serviceInstallationsButtons",id:"servicesPanel",icon:t(1011)},{name:"toolsAndResourcesButtons",id:"resourcesPanel",icon:t(1011)},{name:"generalButtons",id:"generalPanel",icon:t(1012)},{name:"serverManagementButtons",id:"serverManagementPanel",icon:t(1013)},{name:"statisticsButtons",id:"statisticsPanel",icon:t(1014)},{name:"mailButtons",id:"mailPanel",icon:t(1015)},{name:"applicationsAndDatabasesButtons",id:"applicationsAndDatabasesPanel",icon:t(1016)},{name:"panelButtons",id:"panelPanel",icon:t(1017)},{name:"uiButtons",id:"uiPanel",icon:t(1018)},{name:"myPleskButtons",id:"myPleskPanel",icon:t(1019)},{name:"customButtons",id:"customButtons",title:"additionalServices",icon:t(890)}],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)},1006:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n.default});var n=t(1007)},1016:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/applications-and-databases.png?31b2124ea5175fb574f77cc3c43d9216"},1018:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/branding.png?bb7cecce78a80689f82c7572493996fb"},890:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/custom-buttons.png?7cf218aebaf85599ee9d8db8e1a3ee91"},1019:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/external-services.png?6b1ed2ce8b6bbdd13558424ab047b5af"},1015:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/mail.png?a8efbdef83b8bf575d0b6b9e48a161dd"},1011:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/manage.png?9fce3fccefdab269fb4a897f91509b5d"},1017:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/panel.png?d1ffcf89a8b0751810a10dcbba2f454a"},1012:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/preferences.png?3e21b876f5b895bcb4c400b77821ca53"},1009:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/protect.png?f3de9d854c205798732f51dfc82cbdf7"},1013:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/server.png?972b6d4fd5488c8de0c79459dfbdd65e"},1014:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/statistics.png?ec7232887a24c97fc209fdb24b00140c"},1010:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/support.png?9dfb7944b29c37c37efd99bb822079a9"}}]);
//# sourceMappingURL=tools.js.map?a7c9955fbdb364987ecf