(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/server/db"],{1642:(e,t,s)=>{"use strict";s.r(t),s.d(t,{SORT_ASC:()=>c,SORT_DESC:()=>p,default:()=>b});var a=s(236),r=s(238),n=s.n(r),o=s(237),i=s(87);const l=i.Locale.getTranslate("components.list"),d=i.Locale.getSection("components.list"),c="ASC",p="DESC",m="all",u=({data:e,columns:t,itemsPerPage:s,itemsPerPageOptions:r,sortColumn:n,sortDirection:i,searchField:p,locale:u,emptyView:b,emptyFilteredView:g,toolbar:h,selection:x,onSelectionChange:v,searchBarInputProps:j,rowKey:S,...y})=>{const[w,f]=(0,a.useState)(1),[T,P]=(0,a.useState)(n??t.find((({sortable:e})=>e))?.key),[D,k]=(0,a.useState)(i),[C,L]=(0,a.useState)(r.includes(s)?s:r[0]),[R,F]=(0,a.useState)(""),I=(0,a.useMemo)((()=>R?g??(0,a.jsx)(o.ListEmptyView,{reason:"filtered",title:(0,a.jsx)(l,{content:"emptyViewFilteredTitle"}),description:(0,a.jsx)(l,{content:"emptyViewFilteredDescription"})}):b??(0,a.jsx)(o.ListEmptyView,{title:(0,a.jsx)(l,{content:"emptyViewTitle"})})),[R,b,g]),q=(0,a.useMemo)((()=>p?e.filter((e=>(Array.isArray(p)?p:[p]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(R.toLowerCase()))))):e),[e,R,p]),M=(0,a.useMemo)((()=>{if(!T)return q;const e=t.find((({key:e})=>e===T))?.sortDataField??T,s=t.find((({key:e})=>e===T))?.sort??((t,s)=>t[e]<s[e]?-1:t[e]>s[e]?1:0);return[...q].sort(((e,t)=>c===D?s(e,t):s(t,e)))}),[q,T,D,t]),U=(0,a.useMemo)((()=>{if(C===m)return M;const e=C*(w-1),t=e+C;return M.slice(e,t)}),[w,M,C]),$=(0,a.useCallback)((e=>{F(e),e!==R&&f(1)}),[R]),B=(0,a.useCallback)((e=>{L(e);(e===m?1:Math.ceil(q.length/e))<w&&f(1)}),[q.length,w]);return(0,a.useEffect)((()=>{if("function"==typeof v&&x.length){const e=q.map((e=>{return t=e,"function"==typeof(s=S)?s(t):t[s];var t,s})).filter((e=>x.includes(e)));v(e)}}),[q]),(0,a.jsx)(o.List,{pagination:(0,a.jsx)(o.Pagination,{current:w,total:C===m?1:Math.ceil(q.length/C),onSelect:e=>f(e),itemsPerPage:C,itemsPerPageOptions:r,onItemsPerPageChange:B}),toolbar:(h||p)&&(0,a.jsxs)(o.Toolbar,{children:[h,p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.ToolbarExpander,{}),(0,a.jsx)(o.ToolbarGroup,{title:"",children:(0,a.jsx)(o.SearchBar,{inputProps:{placeholder:d.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",...j??{}},onTyping:$})})]})]}),totalRows:q.length,sortColumn:T,sortDirection:D,onSortChange:({sortColumn:e,sortDirection:t})=>{P(e),k(t)},columns:t,data:U,filtered:!!R,locale:{totalRows:({totalRows:e})=>d.formatMessage("recordsTotal",{total:e}),...u},emptyView:I,onSelectionChange:v,selection:x,rowKey:S,...y})};u.propTypes={data:n().array.isRequired,columns:n().array.isRequired,itemsPerPage:n().number,itemsPerPageOptions:n().array,sortColumn:n().string,sortDirection:n().string,searchField:n().oneOfType([n().string,n().arrayOf(n().string.isRequired)]),locale:n().object,emptyView:n().node,emptyFilteredView:n().node,toolbar:n().node,onSelectionChange:n().func,selection:n().array,rowKey:n().oneOfType([n().string,n().func]),searchBarInputProps:n().object},u.defaultProps={itemsPerPage:25,itemsPerPageOptions:[10,25,100,m],sortColumn:void 0,sortDirection:c,searchField:void 0,locale:{},emptyView:void 0,emptyFilteredView:void 0,toolbar:void 0,onSelectionChange:void 0,selection:[],searchBarInputProps:void 0,rowKey:"key"};const b=u},1734:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(236),r=s(238),n=s.n(r),o=s(679),i=s(443),l=s(709),d=s(237),c=s(87),p=s(684),m=s(819),u=s(722);const b=c.Locale.getTranslate("components.forms.database-server-create"),g=c.Locale.getSection("components.lists.databaseservers"),h=c.Locale.getTranslate("components.buttons"),x="MSSQL",v=i.gql`
    mutation UpdateDatabaseServer($input: UpdateDatabaseServerInput!) {
        updateDatabaseServer(input: $input) {
            error
            databaseServer {
                id
            }
        }
    }
`,j=e=>"MYSQL"===e?["mysql","mariadb","percona"].map((e=>g.lmsg(e.toLowerCase()))).join(" / "):g.lmsg(e.toLowerCase()),S=({databaseServer:e,allowedTypes:t,isWindows:r})=>{const n=(0,o.useNavigate)(),[i,c]=(0,a.useState)(e?{id:e.id,type:e.type,host:e.host,port:String(e.port),default:e.isDefaultServer,adminLogin:e.adminLogin,adminPassword:"",externalConnections:e.externalConnections,backupTempDir:e.backupSettings?.tempDir,backupNetworkTempDir:e.backupSettings?.networkTempDir,backupNetworkUser:e.backupSettings?.networkUser,backupNetworkPassword:e.backupSettings?.networkPassword}:{id:null,type:t[0],host:"",port:"",default:!1,adminLogin:"",adminPassword:""}),S=(0,a.useCallback)((({updateDatabaseServer:{error:t}})=>{(0,p.addToast)({intent:t?"warning":"success",message:e?t?(0,a.jsx)(b,{content:"updateError",params:{error:t}}):(0,a.jsx)(b,{content:"updateSuccess"}):t?(0,a.jsx)(b,{content:"createError",params:{error:t}}):(0,a.jsx)(b,{content:"createSuccess"})}),n("/cp/server/db/")}),[e,n]),[y]=(0,l.useMutation)(v,{refetchQueries:[{query:s(788)},e?{query:s(790),variables:{id:e.id}}:null].filter(Boolean),awaitRefetchQueries:!0});return(0,a.jsxs)(m.default,{values:i,mutation:y,onSuccess:S,onFieldChange:(e,t)=>{c((s=>s=(0,d.setIn)(s,e,t)))},submitButton:{id:"btn-send",children:(0,a.jsx)(h,{content:"ok"})},applyButton:!1,cancelButton:{id:"btn-cancel",children:(0,a.jsx)(h,{content:"cancel"}),component:u.default,to:"/cp/server/db/"},children:[(0,a.jsxs)(d.Section,{title:(0,a.jsx)(b,{content:"general"}),children:[e?(0,a.jsx)(d.SectionItem,{title:(0,a.jsx)(b,{content:"type"}),children:j(e.type)}):(0,a.jsx)(d.FormFieldSelect,{name:"type",label:(0,a.jsx)(b,{content:"type"}),children:t.map((e=>(0,a.jsx)(d.SelectOption,{value:e,children:j(e)},e)))}),e&&"localhost"===e.host&&!r?(0,a.jsx)(d.SectionItem,{title:(0,a.jsx)(b,{content:"host"}),children:e.host}):(0,a.jsx)(d.FormFieldText,{name:"host",label:(0,a.jsx)(b,{content:"host"}),required:!0}),e&&"localhost"===e.host&&!r?(0,a.jsx)(d.SectionItem,{title:(0,a.jsx)(b,{content:"port"}),children:(0,a.jsx)(b,{content:"unixSocket"})}):i.type===x?null:(0,a.jsx)(d.FormFieldText,{name:"port",label:(0,a.jsx)(b,{content:"port"}),description:(0,a.jsx)(b,{content:"portDescription"}),size:"sm"}),e?(0,a.jsx)(d.SectionItem,{title:(0,a.jsx)(b,{content:"version"}),children:e.serverVersion}):null,(0,a.jsx)(d.FormFieldCheckbox,{name:"default",label:(0,a.jsx)(b,{content:"default",params:{type:g.lmsg(i.type.toLowerCase())}}),disabled:e&&e.isDefaultServer}),e&&null!==e.externalConnections?(0,a.jsx)(d.FormFieldCheckbox,{name:"externalConnections",label:(0,a.jsx)(b,{content:"externalConnections"}),description:(0,a.jsx)(b,{content:"externalConnectionsDescription"})}):null]}),(0,a.jsxs)(d.Section,{title:(0,a.jsx)(b,{content:"authentication"}),children:[e?e.isUsedForPsaDb?null:e.isAdminCredentialsChangeable?(0,a.jsx)(d.Paragraph,{children:(0,a.jsx)(b,{content:"authenticationChangeDescription"})}):(0,a.jsx)(d.Paragraph,{children:(0,a.jsx)(b,{content:"authenticationEditDescription"})}):(0,a.jsx)(d.Paragraph,{children:(0,a.jsx)(b,{content:"authenticationAddDescription"})}),e&&e.isUsedForPsaDb?(0,a.jsx)(d.SectionItem,{title:(0,a.jsx)(b,{content:"adminLogin"}),children:e.adminLogin}):(0,a.jsx)(d.FormFieldText,{name:"adminLogin",label:(0,a.jsx)(b,{content:"adminLogin"}),required:!0}),e&&e.isUsedForPsaDb?null:(0,a.jsx)(d.FormFieldPassword,{name:"adminPassword",label:(0,a.jsx)(b,{content:"adminPassword"}),required:!0,hideGenerateButton:!0,hidePasswordMeter:!0})]}),e&&null!==e.backupSettings?(0,a.jsxs)(d.Section,{title:(0,a.jsx)(b,{content:"backupSettings"}),children:[(0,a.jsx)(d.FormFieldText,{name:"backupTempDir",label:(0,a.jsx)(b,{content:"backupTempDir"}),description:(0,a.jsx)(b,{content:"backupTempDirDescription"})}),(0,a.jsx)(d.FormFieldText,{name:"backupNetworkTempDir",label:(0,a.jsx)(b,{content:"backupNetworkTempDir"}),description:(0,a.jsx)(b,{content:"backupNetworkTempDirDescription"})}),(0,a.jsx)(d.FormFieldText,{name:"backupNetworkUser",label:(0,a.jsx)(b,{content:"backupNetworkUser"}),description:(0,a.jsx)(b,{content:"backupNetworkUserDescription"})}),(0,a.jsx)(d.FormFieldPassword,{name:"backupNetworkPassword",label:(0,a.jsx)(b,{content:"backupNetworkPassword"}),hideGenerateButton:!0,hidePasswordMeter:!0})]}):null]})};S.propTypes={databaseServer:n().object,allowedTypes:n().array,isWindows:n().bool},S.defaultProps={databaseServer:void 0,allowedTypes:["MYSQL","POSTGRESQL",x],isWindows:!1};const y=S},1738:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var a=s(236),r=s(238),n=s(443),o=s(709),i=s(237),l=s(87),d=s(1705),c=s(684),p=s(722),m=s(1642);const u=l.Locale.getTranslate("components.lists.databaseserverdatabases"),b=l.Locale.getSection("components.lists.databaseserverdatabases"),g=l.Locale.getTranslate("components.buttons"),h=n.gql`
    mutation DeleteDatabase($ids: [ID!]!) {
        deleteDatabase(input: { ids: $ids }) {
            ids
        }
    }
`,x=({isClassicPanel:e,serverId:t,data:r})=>{const[n]=(0,o.useMutation)(h),[l,x]=(0,a.useState)(r),[v,j]=(0,a.useState)([]),[S,y]=(0,a.useState)([]),w=(0,a.useMemo)((()=>l.filter((({id:e})=>v.includes(e)))),[l,v]);return(0,a.jsx)(m.default,{toolbar:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.ToolbarGroup,{title:b.lmsg("actionsGroup"),children:(0,a.jsx)(i.ListOperation,{noSelectionText:(0,a.jsx)(u,{content:"emptySelection"}),children:(0,a.jsx)(i.Button,{"data-id":"assignToSubscription",onClick:async()=>{new(await Plesk.require("app/database/assign-to-subscription"))({ids:v.map(d.getId)})},tooltip:(0,a.jsx)(u,{content:"assignToSubscriptionDescription"}),children:(0,a.jsx)(u,{content:"assignToSubscription"})})})}),(0,a.jsx)(i.ToolbarGroup,{title:b.lmsg("removeGroup"),children:(0,a.jsx)(i.ListOperation,{critical:!0,noSelectionText:(0,a.jsx)(u,{content:"emptySelection"}),confirmationText:b.formatMessage("removeConfirmation",{name:(0,a.jsx)("b",{children:w[0]?.name}),count:w.length}),actionButtonText:(0,a.jsx)(g,{content:"yesRemove"}),cancelButtonText:(0,a.jsx)(g,{content:"cancel"}),children:(0,a.jsx)(i.Button,{"data-id":"remove",onClick:async()=>{y(v);try{const{data:{deleteDatabase:{ids:e}}}=await n({variables:{ids:v},refetchQueries:[{query:s(791),variables:{id:t}}],awaitRefetchQueries:!0});e.length>0&&((0,c.addToast)({intent:"success",message:(0,a.jsx)(u,{content:"removeSuccess"})}),x(l.filter((({id:t})=>!e.includes(t)))))}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{j([]),y([])}},tooltip:(0,a.jsx)(u,{content:"removeDescription"}),children:(0,a.jsx)(u,{content:"remove"})})})})]}),columns:[{key:"name",title:(0,a.jsx)(u,{content:"name"}),sortable:!0,type:"title",width:"40%"},{key:"domain",title:(0,a.jsx)(u,{content:"subscription"}),sortable:!0,width:"20%"},{key:"client",title:(0,a.jsx)(u,{content:"client"}),sortable:!0,width:"20%"},{key:"controlPanel",width:"20%",render:({domainId:t,clientId:r,clientType:n})=>{let o=`/smb/database/list/domainId/${encodeURIComponent((0,d.getId)(t))}`,l=(0,a.jsx)(u,{content:"manageDatabase"}),c=(0,a.jsx)(u,{content:"manageDatabaseDescription"});return e||"ADMIN"===n?o=`/admin/subscription/login/id/${encodeURIComponent((0,d.getId)(t))}?pageUrl=${encodeURIComponent(o)}`:"RESELLER"===n?(o=`/admin/reseller/login/id/${encodeURIComponent((0,d.getId)(r))}?pageUrl=${encodeURIComponent(o)}`,l=(0,a.jsx)(u,{content:"manageDatabaseInResellerPanel"}),c=(0,a.jsx)(u,{content:"manageDatabaseInResellerPanelDescription"})):"CLIENT"===n&&(o=`/admin/customer/login/id/${encodeURIComponent((0,d.getId)(r))}?pageUrl=${encodeURIComponent(o)}`,l=(0,a.jsx)(u,{content:"manageDatabaseInCustomerPanel"}),c=(0,a.jsx)(u,{content:"manageDatabaseInCustomerPanelDescription"})),(0,a.jsx)(i.Tooltip,{title:c,children:(0,a.jsx)(i.Action,{component:p.default,to:o,icon:{src:s(1018)},children:l})})}}],rowKey:"id",data:l,searchField:"name",sortColumn:"name",selection:v,onSelectionChange:e=>j(e),loadingRows:S})};x.propTypes={isClassicPanel:r.PropTypes.bool.isRequired,serverId:r.PropTypes.string.isRequired,data:r.PropTypes.array.isRequired};const v=x},1731:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var a=s(236),r=s(238),n=s(443),o=s(709),i=s(237),l=s(87),d=s(684),c=s(1705),p=s(722),m=s(1642);const u=l.Locale.getTranslate("components.lists.databaseservers"),b=l.Locale.getSection("components.lists.databaseservers"),g=l.Locale.getTranslate("components.status"),h=l.Locale.getTranslate("components.buttons"),x=n.gql`
    mutation DeleteDatabaseServer($ids: [ID!]!) {
        deleteDatabaseServer(input: { ids: $ids }) {
            ids
        }
    }
`,v=({data:e,isDemo:t,createDatabaseServerAllowed:r})=>{const[n]=(0,o.useMutation)(x),[l,v]=(0,a.useState)(e),[j,S]=(0,a.useState)([]),[y,w]=(0,a.useState)([]),f=(0,a.useMemo)((()=>l.filter((({id:e})=>j.includes(e)))),[l,j]),T=(0,a.useMemo)((()=>l.filter((({isLocal:e,isDynamicPort:t})=>e&&t)).map((({host:e})=>(0,a.jsxs)(i.StatusMessage,{intent:"warning",children:[(0,a.jsxs)("b",{children:[(0,a.jsx)(g,{content:"warning"}),": "]}),(0,a.jsx)(u,{content:"mssqlServerPortUndefined",params:{host:e}}),(0,a.jsx)("br",{}),(0,a.jsx)(u,{content:"mssqlServerPortUndefinedHint"})]},e)))),[l]);return(0,a.jsxs)(a.Fragment,{children:[T,(0,a.jsx)(m.default,{toolbar:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.ToolbarGroup,{title:b.lmsg("addGroup"),children:(0,a.jsx)(i.Button,{"data-id":"addDatabaseServer",intent:"primary",icon:"plus",component:p.default,to:"/cp/server/db/create",disabled:!r,tooltip:r?(0,a.jsx)(u,{content:"addDatabaseServerDescription"}):(0,a.jsx)(u,{content:"addDatabaseServerDescriptionDisabledByKey"}),children:(0,a.jsx)(u,{content:"addDatabaseServer"})})}),(0,a.jsxs)(i.ToolbarGroup,{title:b.lmsg("actionsGroup"),children:[(0,a.jsx)(i.Button,{"data-id":"hostingSettings",component:p.default,to:"/admin/database/settings",tooltip:(0,a.jsx)(u,{content:"hostingSettingsDescription"}),children:(0,a.jsx)(u,{content:"hostingSettings"})}),(0,a.jsx)(i.Button,{"data-id":"refresh",component:"a",href:"/admin/database/refresh",tooltip:(0,a.jsx)(u,{content:"refreshDescription"}),children:(0,a.jsx)(u,{content:"refresh"})})]}),(0,a.jsx)(i.ToolbarGroup,{title:b.lmsg("removeGroup"),children:(0,a.jsx)(i.ListOperation,{critical:!0,noSelectionText:(0,a.jsx)(u,{content:"removeEmptySelection"}),confirmationText:b.formatMessage("removeConfirmation",{name:(0,a.jsx)("b",{children:f[0]?.name}),count:f.length}),actionButtonText:(0,a.jsx)(h,{content:"yesRemove"}),cancelButtonText:(0,a.jsx)(h,{content:"cancel"}),children:(0,a.jsx)(i.Button,{"data-id":"remove",onClick:async()=>{w(j);try{const{data:{deleteDatabaseServer:{ids:e}}}=await n({variables:{ids:j},refetchQueries:[{query:s(788)}],awaitRefetchQueries:!0});e.length>0&&((0,d.addToast)({intent:"success",message:(0,a.jsx)(u,{content:"removeSuccess"})}),v(l.filter((({id:t})=>!e.includes(t)))))}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,d.addToast)({intent:"danger",message:t||e})}))}finally{S([]),w([])}},tooltip:(0,a.jsx)(u,{content:"removeDescription"}),children:(0,a.jsx)(u,{content:"remove"})})})})]}),columns:[{key:"lastError",title:(0,a.jsx)(u,{content:"lastError"}),sortable:!0,render:({id:e,lastError:t})=>(0,a.jsx)(i.Tooltip,{title:(0,a.jsx)(u,{content:`status_${t.toLowerCase()}`}),children:(0,a.jsx)(p.default,{to:`/cp/server/db/${encodeURIComponent((0,c.getId)(e))}/properties`,children:(0,a.jsx)(i.Icon,{src:s("NO_ERROR"===t?1732:965)})})})},{key:"type",title:(0,a.jsx)(u,{content:"type"}),width:"20%",sortable:!0,render:({type:e,fork:t})=>{const r=(t||e).toLowerCase(),n={mysql:s(1619),mssql:s(1622),postgresql:s(1623),mariadb:s(1620),percona:s(1621)}[r];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Icon,{src:n})," ",(0,a.jsx)(u,{content:r})]})}},{key:"host",title:(0,a.jsx)(u,{content:"host"}),type:"title",width:"50%",sortable:!0,render:({id:e,type:t,fork:s,host:r,isDefaultServer:n})=>{const o=(s||t).toLowerCase();return(0,a.jsxs)(i.Text,{bold:n,children:[(0,a.jsx)(i.Tooltip,{title:(0,a.jsx)(u,{content:"hostLink"}),children:(0,a.jsx)(p.default,{to:`/cp/server/db/${encodeURIComponent((0,c.getId)(e))}/properties`,children:r})}),n?(0,a.jsxs)(a.Fragment,{children:[" ","(",(0,a.jsx)(u,{content:`default_for_${o}`}),")"]}):null]})}},{key:"port",title:(0,a.jsx)(u,{content:"port"}),width:"10%",align:"right",sortable:!0},{key:"serverVersion",title:(0,a.jsx)(u,{content:"version"}),width:"10%",align:"right",sortable:!0},{key:"databasesCount",title:(0,a.jsx)(u,{content:"databasesCount"}),width:"10%",align:"right",sortable:!0,render:({id:e,databasesCount:t})=>(0,a.jsx)(i.Tooltip,{title:(0,a.jsx)(u,{content:"databasesCountLink"}),children:(0,a.jsx)(p.default,{to:`/cp/server/db/${encodeURIComponent((0,c.getId)(e))}/databases`,children:t})})},{key:"webadmin",type:"actions",render:({id:e,isWebadminInstalled:s,type:r,lastError:n})=>(0,a.jsx)(i.ListActions,{children:(0,a.jsx)(i.ListAction,{primary:!0,icon:{MYSQL:"phpmyadmin",MSSQL:"my-little-admin"}[r],hidden:!s,component:"a",href:`/cp/server/db/${encodeURIComponent((0,c.getId)(e))}/webadmin`,target:"_blank",disabled:t||"NO_ERROR"!==n,tooltip:(0,a.jsx)(u,{content:"webadminHint"}),children:(0,a.jsx)(u,{content:"webadmin"})})})}],rowKey:"id",data:l,searchField:"host",sortColumn:"host",selection:j,onSelectionChange:e=>S(e),loadingRows:y})]})};v.propTypes={data:r.PropTypes.array.isRequired,isDemo:r.PropTypes.bool,createDatabaseServerAllowed:r.PropTypes.bool},v.defaultProps={isDemo:!1,createDatabaseServerAllowed:!0};const j=v},1739:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(236),r=s(238),n=s(679),o=s(443),i=s(709),l=s(237),d=s(87),c=s(282),p=s(684),m=s(819),u=s(722),b=s(692),g=s(1736);const h=d.Locale.getTranslate("components.forms.database-server-change-password"),x=d.Locale.getTranslate("components.buttons"),v=o.gql`
    mutation ChangeDatabaseServerPassword($input: ChangeDatabaseServerPasswordInput!) {
        changeDatabaseServerPassword(input: $input) {
            databaseServer {
                id
                lastError
            }
        }
    }
`,j=({databaseServer:e})=>{const t=(0,n.useNavigate)(),[s]=(0,i.useMutation)(v),[r]=(0,a.useState)({id:e.id,password:""});return(0,a.jsx)(m.default,{values:r,mutation:s,onSuccess:()=>{(0,p.addToast)({intent:"success",message:(0,a.jsx)(h,{content:"success"})}),t("/cp/server/db/")},submitButton:{id:"btn-send",children:(0,a.jsx)(x,{content:"save"})},applyButton:!1,cancelButton:{id:"btn-cancel",children:(0,a.jsx)(x,{content:"cancel"}),component:u.default,to:"/cp/server/db/"},children:(0,a.jsx)(l.FormFieldPassword,{name:"password",label:(0,a.jsx)(h,{content:"adminPassword"}),required:!0})})};j.propTypes={databaseServer:r.PropTypes.shape({id:r.PropTypes.string.isRequired,name:r.PropTypes.string.isRequired}).isRequired};const S=(0,b.withPageLayout)((0,g.withDatabaseServerOverviewTabs)(j),(e=>{const{showFrames:t,pageHeader:s,pageSidebar:a}=(0,c.default)();return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"db_server_change_password"}},pageSidebar:a,pageContentHeader:{breadcrumbs:[a.isPowerUserPanel?null:{title:d.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:d.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:d.Locale.getSection("components.pages.database-servers").lmsg("title"),href:"/cp/server/db/"},{title:`<b>${e.databaseServer.name}</b>`,href:`/cp/server/db/${e.databaseServer.id}/`},{title:d.Locale.getSection("components.pages.database-server-change-password").lmsg("title"),href:`/cp/server/db/${e.databaseServer.id}/change-password/`}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1733:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(238),r=s.n(a),n=s(87),o=s(282),i=s(692),l=s(1734),d=s(236);const c=({server:{allowedByKeyDatabaseServerTypes:e}})=>(0,d.jsx)(l.default,{allowedTypes:e});c.propTypes={server:r().shape({allowedByKeyDatabaseServerTypes:r().array.isRequired}).isRequired};const p=(0,i.withPageLayout)(c,(e=>{const{showFrames:t,pageHeader:s,pageSidebar:a}=(0,o.default)(),r=n.Locale.getSection("components.pages.database-server-create").lmsg("title");return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"db_server_edit"}},pageSidebar:a,pageContentHeader:{pageTitle:r,breadcrumbs:[a.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:n.Locale.getSection("components.pages.database-servers").lmsg("title"),href:"/cp/server/db/"},{title:r,href:"/cp/server/db/create/"}].filter(Boolean)}}}))},1737:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(236),r=s(238),n=s(87),o=s(282),i=s(692),l=s(1738),d=s(1736);const c=({databaseServer:{id:e,databases:t},mode:{isClassicPanel:s}})=>{const r=(0,a.useMemo)((()=>t.map((e=>({id:e.id,name:e.name,domain:e.domain.name,domainId:e.domain.id,client:e.domain.owner.name,clientId:e.domain.owner.id,clientType:e.domain.owner.type})))),[t]);return(0,a.jsx)(l.default,{isClassicPanel:s,serverId:e,data:r})};c.propTypes={mode:r.PropTypes.shape({isClassicPanel:r.PropTypes.bool.isRequired}).isRequired,databaseServer:r.PropTypes.shape({id:r.PropTypes.string.isRequired,name:r.PropTypes.string.isRequired,databases:r.PropTypes.array.isRequired}).isRequired};const p=(0,i.withPageLayout)((0,d.withDatabaseServerOverviewTabs)(c),(e=>{const{showFrames:t,pageHeader:s,pageSidebar:a}=(0,o.default)();return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"db_server_databases"}},pageSidebar:a,pageContentHeader:{breadcrumbs:[a.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:n.Locale.getSection("components.pages.database-servers").lmsg("title"),href:"/cp/server/db/"},{title:`<b>${e.databaseServer.name}</b>`,href:`/cp/server/db/${e.databaseServer.id}/`},{title:n.Locale.getSection("components.pages.database-server-databases").lmsg("title"),href:`/cp/server/db/${e.databaseServer.id}/databases/`}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1735:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(238),r=s.n(a),n=s(87),o=s(282),i=s(692),l=s(1734),d=s(1736),c=s(236);const p=({databaseServer:e,os:{isWindows:t}})=>(0,c.jsx)(l.default,{databaseServer:e,isWindows:t});p.propTypes={databaseServer:r().object.isRequired,os:r().shape({isWindows:r().bool.isRequired}).isRequired};const m=(0,i.withPageLayout)((0,d.withDatabaseServerOverviewTabs)(p),(e=>{const{showFrames:t,pageHeader:s,pageSidebar:a}=(0,o.default)();return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"db_server_edit"}},pageSidebar:a,pageContentHeader:{breadcrumbs:[a.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:n.Locale.getSection("components.pages.database-servers").lmsg("title"),href:"/cp/server/db/"},{title:`<b>${e.databaseServer.name}</b>`,href:`/cp/server/db/${e.databaseServer.id}/`},{title:n.Locale.getSection("components.pages.database-server-properties").lmsg("title"),href:`/cp/server/db/${e.databaseServer.id}/properties/`}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1730:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(236),r=s(238),n=s(87),o=s(282),i=s(692),l=s(1731);const d=({databaseServers:e,os:{isWindows:t},mode:{isDemo:s},primaryKey:{keyRemoteDb:r}})=>{const n=(0,a.useMemo)((()=>{const t=e.reduce(((e,t)=>({...e,[t.type]:(e[t.type]||0)+1})),{});return e.map((({isUsedForPsaDb:e,...s})=>({...s,disabled:e||s.isDefaultServer&&t[s.type]>1})))}),[e]);return(0,a.jsx)(l.default,{data:n,isDemo:s,isWindows:t,createDatabaseServerAllowed:t||r})};d.propTypes={databaseServers:r.PropTypes.array.isRequired,os:r.PropTypes.object.isRequired,mode:r.PropTypes.object.isRequired,primaryKey:r.PropTypes.object.isRequired};const c=(0,i.withPageLayout)(d,(e=>{const{showFrames:t,pageHeader:s,pageSidebar:a}=(0,o.default)(),r=n.Locale.getSection("components.pages.database-servers").lmsg("title");return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"db_servers"}},pageSidebar:a,pageContentHeader:{pageTitle:r,breadcrumbs:[a.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:r,href:"/cp/server/db/"}].filter(Boolean)}}}))},1736:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u,withDatabaseServerOverviewTabs:()=>m});var a=s(236),r=s(238),n=s(679),o=s(680),i=s(686),l=s(443),d=s(237),c=s(87);const p=({params:e,os:t})=>{const{pathname:s}=(0,n.useLocation)(),r=(0,n.useNavigate)(),{data:{databaseServer:p}={}}=(0,i.useQuery)(l.gql`
        query DatabaseServerOverviewTabs($id: ID!) {
            databaseServer: node(id: $id) {
                id
                ... on DatabaseServer {
                    databasesCount
                }
            }
        }
    `,{variables:{id:btoa(`DatabaseServer:${e.id}`)}}),m=(0,a.useMemo)((()=>[{title:c.Locale.getSection("components.pages.database-server-properties").lmsg("title"),url:`/cp/server/db/${e.id}/properties`},t.isWindows?{title:c.Locale.getSection("components.pages.database-server-change-password").lmsg("title"),url:`/cp/server/db/${e.id}/change-password`}:null,{title:c.Locale.getSection("components.pages.database-server-databases").lmsg("title"),url:`/cp/server/db/${e.id}/databases`,label:(0,a.jsx)(d.Label,{intent:"info",children:p.databasesCount})}].filter(Boolean)),[e,t,p]),u=(0,a.useMemo)((()=>m.findIndex((({url:e})=>(0,o.matchPath)(e,s)))+1),[m,s]);return(0,a.jsx)(d.Tabs,{active:u,children:m.map((({url:e,...t})=>(0,a.jsx)(d.Tab,{onActivate:()=>r(e),...t},e)))})};p.propTypes={params:r.PropTypes.shape({id:r.PropTypes.string.isRequired}).isRequired,os:r.PropTypes.shape({isWindows:r.PropTypes.bool.isRequired}).isRequired};const m=e=>{const t=t=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{...t}),(0,a.jsx)(e,{...t})]});return t.displayName=`withDatabaseServerOverviewTabs(${e.displayName||e.name||"Component"})`,t.WrappedComponent=e,t},u=p},1705:(e,t,s)=>{"use strict";s.r(t),s.d(t,{getId:()=>a});const a=e=>e?Number(atob(e).split(":")[1]):null},1018:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/login.png?b68531bba0e522a3a35a90de80b8892a"},1620:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mariadb.png?7bb08a94b753b7fa7d53e994238873ab"},1622:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mssql.png?cef152af421a073477c90aa8001bef49"},1619:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mysql.png?c5c7e38a14aa2ec76ec4656a58b6dcc7"},965:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},1732:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/ok.png?402e5b49692b25d9d02326339ede77fa"},1621:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/percona.png?c9390f7e0aaad1e448de90386ec84dd6"},1623:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/postgresql.png?ed7a3e52b63253fa542b90e5981bdcaa"}}]);
//# sourceMappingURL=db.js.map?e05988d0af3ec6fb1bda