D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
cp
/
public
/
javascript
/
views
/
admin
/
server
/
Filename :
tools.js
back
Copy
(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/server/tools"],{1685:(e,s,t)=>{"use strict";t.r(s),t.d(s,{PanelAccess:()=>g,default:()=>x});var n=t(285),o=t(596),a=t.n(o),i=t(286),r=t(89),l=t(620),c=t(536);const d="enabled",u="disabled",m="domain",p=r.Locale.getTranslate("components.forms.panel-access"),g=({getAccessUrl:e,setAccessUrl:s,helpUrl:t,httpsPort:o})=>{const[a,g]=(0,l.useModal)("customize-panel-access"),[h,x]=(0,n.useState)(!0),[b,j]=(0,n.useState)(null),[y,f]=(0,n.useState)(null),[v,S]=(0,n.useState)(null),[P,w]=(0,n.useState)(null);(0,n.useEffect)((()=>{a&&(x(!0),r.api.get(e).then((e=>{j({proxy:B(e),domainName:e.domainName})})).catch((({message:e})=>(0,c.addToast)({intent:"danger",message:e}))).finally((()=>x(!1))))}),[a,e]);const B=e=>e.proxy?e.domainName?m:d:u;return(0,n.jsxs)(i.Drawer,{title:(0,n.jsx)(p,{content:"title"}),size:"sm",isOpen:a,onClose:()=>g(!1),form:{values:b,vertical:!0,state:v,applyButton:!1,hideRequiredLegend:!0,submitButton:{disabled:h},onSubmit:async({proxy:e,domainName:t})=>{if(f(null),S(null),w(null),e===m&&!t)return void f({domainName:{isEmpty:(0,n.jsx)(p,{content:"domainNameIsRequired"})}});S("submit");const o=await r.api.post(s,{proxy:e!==u,domainName:e===m?t:""});if(S(null),!o||"error"!==o.status)return(0,c.addToast)({intent:"success",message:(0,n.jsx)(p,{content:"successMessage"})}),void g(!1);o.formMessages&&Object.keys(o.formMessages).forEach((e=>f({[e]:o.formMessages[e]}))),o.messages&&w(o.messages)},errors:y},"data-type":"customize-panel-access",children:[(0,n.jsx)(i.Paragraph,{children:(0,n.jsx)(p,{content:"hint",params:{httpsPort:o,link:t?(0,n.jsx)("a",{href:t,target:"_blank",id:"linkOpenHelp",rel:"noopener noreferrer",children:(0,n.jsx)(p,{content:"details"})}):""}})}),h?(0,n.jsx)(i.ContentLoader,{}):(0,n.jsxs)(n.Fragment,{children:[P?P.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)(p,{content:"proxyEnabled"})},{value:m,label:(0,n.jsx)(p,{content:"proxyDomain"}),indentFields:[(0,n.jsx)(i.FormFieldText,{name:"domainName",placeholder:"www.example.com",size:"lg"},"domainName")]},{value:u,label:(0,n.jsx)(p,{content:"proxyDisabled",params:{httpsPort:o}})}]})]})]})};g.propTypes={getAccessUrl:a().string.isRequired,setAccessUrl:a().string.isRequired,helpUrl:a().string.isRequired,httpsPort:a().string.isRequired};const h=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)(g,{...e}):null};h.propTypes=g.propTypes;const x=h},1684:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>v});var n=t(596),o=t.n(n),a=t(1120),i=t(628),r=t(286),l=t(89),c=t(646),d=t(603),u=t(1685),m=t(1686),p=t.n(m),g=t(285);const h=[{name:"securityButtons",id:"securityPanel",icon:"protect"},{name:"troubleshootingButtons",id:"troubleshootingPanel",icon:"support"},{name:"serviceInstallationsButtons",id:"servicesPanel",icon:"manage"},{name:"toolsAndResourcesButtons",id:"resourcesPanel",icon:"manage"},{name:"generalButtons",id:"generalPanel",icon:"preferences"},{name:"serverManagementButtons",id:"serverManagementPanel",icon:"server"},{name:"statisticsButtons",id:"statisticsPanel",icon:"statistics"},{name:"mailButtons",id:"mailPanel",icon:"mail"},{name:"applicationsAndDatabasesButtons",id:"applicationsAndDatabasesPanel",icon:"applications-and-databases"},{name:"panelButtons",id:"panelPanel",icon:"panel"},{name:"uiButtons",id:"uiPanel",icon:"branding"},{name:"myPleskButtons",id:"myPleskPanel",icon:"external-services"},{name:"customButtons",id:"customButtons",title:"additionalServices",icon:"custom-buttons"}],x=a.gql` mutation RebootServer { rebootServer } `,b=a.gql` mutation ShutdownServer { shutdownServer } `,j="admin-server-tools",y=l.Locale.getTranslate("admin.controllers.server.tools"),f=e=>{const{sections:s,panelAccess:t}=e,[n]=(0,i.useMutation)(x,{errorPolicy:"all"}),[o]=(0,i.useMutation)(b,{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")})}},d=s=>a[s]?t=>{t.preventDefault(),a[s]({props:e})}:null;return(0,g.jsxs)("div",{"data-id":"tools-list",children:[(0,g.jsx)(r.Paragraph,{children:(0,g.jsx)(y,{content:"pageHint"})}),(0,g.jsx)(r.Grid,{minColumnWidth:150,maxColumnsNumber:({width:e})=>e>1800?5:e>1100?4:e>600?3:2,sm:null,className:`${j}__sections`,gap:"md",children:h.filter((({name:e})=>s[e])).map((({name:e,id:t,icon:n,title:o})=>(0,g.jsx)(r.GridCol,{children:(0,g.jsx)(r.Item,{id:t,icon:(0,g.jsx)(r.Icon,{size:"32",children:(0,g.jsx)("svg",{focusable:"false","aria-hidden":"true",children:(0,g.jsx)("use",{href:`${p()}#${n}`})})}),title:(0,g.jsx)("span",{className:`${j}__section-title`,children:(0,g.jsx)(y,{content:o||t})}),children:(0,g.jsx)("ul",{className:`${j}__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 u=(0,g.jsx)(c.default,{to:t,target:n,onClick:d(a),children:i?(0,g.jsx)("span",{className:"hint-attention",children:o}):o});return(0,g.jsx)("li",{id:e,className:`${j}__section-item`,children:s?(0,g.jsx)(r.Tooltip,{title:s,children:(0,g.jsxs)(g.Fragment,{children:[u,l&&(0,g.jsxs)(g.Fragment,{children:[" ",(0,g.jsx)(r.Label,{intent:"success",children:(0,g.jsx)(y,{content:"isNew"})})]})]})}):u},e)}))})})},t)))}),(0,g.jsx)(u.default,{...t})]})};f.propTypes={sections:o().object.isRequired,panelAccess:o().object.isRequired};const v=(0,d.withPageLayout)(f)},1683:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n.default});var n=t(1684)},1686:e=>{e.exports=Jsw.skinUrl+"/icons/32/colored-icons-sprite.svg?40813ba53ee2156938a4d03eebb2e367"}}]); //# sourceMappingURL=tools.js.map?df14ff74e63aea2c730e