(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/server/db"],{1659:(e,t,s)=>{"use strict";s.r(t),s.d(t,{SORT_ASC:()=>c,SORT_DESC:()=>p,default:()=>b});var a=s(231),r=s(233),n=s.n(r),o=s(232),i=s(85);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,searchPlaceholder:u,locale:b,emptyView:g,toolbar:h,selection:x,onSelectionChange:v,rowKey:j,...S})=>{const[y,w]=(0,a.useState)(1),[f,T]=(0,a.useState)(n??t.find((({sortable:e})=>e))?.key),[P,D]=(0,a.useState)(i),[k,C]=(0,a.useState)(s??r[0]),[L,R]=(0,a.useState)(""),q=(0,a.useMemo)((()=>p?e.filter((e=>(Array.isArray(p)?p:[p]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(L.toLowerCase()))))):e),[e,L,p]),F=(0,a.useMemo)((()=>{if(!f)return q;const e=t.find((({key:e})=>e===f))?.sort??((e,t)=>e[f]<t[f]?-1:e[f]>t[f]?1:0);return[...q].sort(((t,s)=>c===P?e(t,s):e(s,t)))}),[q,f,P,t]),I=(0,a.useMemo)((()=>{if(k===m)return F;const e=k*(y-1),t=e+k;return F.slice(e,t)}),[y,F,k]),M=(0,a.useCallback)((e=>{R(e),e!==L&&w(1)}),[L]),U=(0,a.useCallback)((e=>{C(e);(e===m?1:Math.ceil(q.length/e))<y&&w(1)}),[q.length,y]);return(0,a.useEffect)((()=>{if("function"==typeof v&&x.length){const e=q.map((e=>{return t=e,"function"==typeof(s=j)?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:y,total:k===m?1:Math.ceil(q.length/k),onSelect:e=>w(e),itemsPerPage:k,itemsPerPageOptions:r,onItemsPerPageChange:U}),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:u??d.lmsg("searchPlaceholder"),"data-testid":"list-searchbar"},onTyping:M})})]})]}),totalRows:q.length,sortColumn:f,sortDirection:P,onSortChange:({sortColumn:e,sortDirection:t})=>{T(e),D(t)},columns:t,data:I,filtered:!!L,locale:{totalRows:({totalRows:e})=>d.formatMessage("recordsTotal",{total:e}),...b},emptyView:L?(0,a.jsx)(o.ListEmptyView,{title:(0,a.jsx)(l,{content:"emptyViewFilteredTitle"}),description:(0,a.jsx)(l,{content:"emptyViewFilteredDescription"})}):g??(0,a.jsx)(o.ListEmptyView,{title:(0,a.jsx)(l,{content:"emptyViewTitle"})}),onSelectionChange:v,selection:x,rowKey:j,...S})};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)]),searchPlaceholder:n().string,locale:n().object,emptyView:n().node,toolbar:n().node,onSelectionChange:n().func,selection:n().array,rowKey:n().oneOfType([n().string,n().func])},u.defaultProps={itemsPerPage:void 0,itemsPerPageOptions:[10,25,100,m],sortColumn:void 0,sortDirection:c,searchField:void 0,searchPlaceholder:void 0,locale:{},emptyView:void 0,toolbar:void 0,onSelectionChange:void 0,selection:[],rowKey:"key"};const b=u},1740:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(231),r=s(233),n=s.n(r),o=s(712),i=s(283),l=s(389),d=s(232),c=s(85),p=s(756),m=s(880),u=s(518);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(718)},e?{query:s(720),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},1744:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var a=s(231),r=s(233),n=s(283),o=s(389),i=s(232),l=s(85),d=s(1667),c=s(756),p=s(518),m=s(1659);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(721),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(1028)},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},1737:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var a=s(231),r=s(233),n=s(283),o=s(389),i=s(232),l=s(85),d=s(756),c=s(1667),p=s(518),m=s(1659);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(718)}],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?1738:973)})})})},{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(1637),mssql:s(1640),postgresql:s(1641),mariadb:s(1638),percona:s(1639)}[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},1745:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(231),r=s(233),n=s(712),o=s(283),i=s(389),l=s(232),d=s(85),c=s(282),p=s(756),m=s(880),u=s(518),b=s(790),g=s(1742);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{logo:t,showFrames:s,pageHeader:a,pageSidebar:r}=(0,c.default)(),n=`<b>${e.databaseServer.name}</b>`;return{...e,logo:t,showFrames:s,pageHeader:{...a,helpMenu:{...a.helpMenu,helpContext:"db_server_change_password"}},pageSidebar:r,pageContentHeader:{pageTitle:n,breadcrumbs:[r.isPowerUserPanel?null:{title:d.Locale.getSection("admin.controllers.home.admin").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:d.Locale.getSection("components.pages.database-server-change-password").lmsg("title"),href:"/cp/server/db/"}].filter(Boolean)},pageTitle:n}}))},1739:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(233),r=s.n(a),n=s(85),o=s(282),i=s(790),l=s(1740),d=s(231);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{logo:t,showFrames:s,pageHeader:a,pageSidebar:r}=(0,o.default)(),i=n.Locale.getSection("components.pages.database-server-create").lmsg("title");return{...e,logo:t,showFrames:s,pageHeader:{...a,helpMenu:{...a.helpMenu,helpContext:"db_server_edit"}},pageSidebar:r,pageContentHeader:{pageTitle:i,breadcrumbs:[r.isPowerUserPanel?null:{title:n.Locale.getSection("admin.controllers.home.admin").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:i,href:"/cp/server/db/create/"}].filter(Boolean)},pageTitle:i}}))},1743:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(231),r=s(233),n=s(85),o=s(282),i=s(790),l=s(1744),d=s(1742);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{logo:t,showFrames:s,pageHeader:a,pageSidebar:r}=(0,o.default)(),i=`<b>${e.databaseServer.name}</b>`;return{...e,logo:t,showFrames:s,pageHeader:{...a,helpMenu:{...a.helpMenu,helpContext:"db_server_databases"}},pageSidebar:r,pageContentHeader:{pageTitle:i,breadcrumbs:[r.isPowerUserPanel?null:{title:n.Locale.getSection("admin.controllers.home.admin").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:n.Locale.getSection("components.pages.database-server-databases").lmsg("title"),href:`/cp/server/db/${e.databaseServer.id}/databases/`}].filter(Boolean)},pageTitle:i}}))},1741:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(233),r=s.n(a),n=s(85),o=s(282),i=s(790),l=s(1740),d=s(1742),c=s(231);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{logo:t,showFrames:s,pageHeader:a,pageSidebar:r}=(0,o.default)(),i=`<b>${e.databaseServer.name}</b>`;return{...e,logo:t,showFrames:s,pageHeader:{...a,helpMenu:{...a.helpMenu,helpContext:"db_server_edit"}},pageSidebar:r,pageContentHeader:{pageTitle:i,breadcrumbs:[r.isPowerUserPanel?null:{title:n.Locale.getSection("admin.controllers.home.admin").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:n.Locale.getSection("components.pages.database-server-properties").lmsg("title"),href:`/cp/server/db/${e.databaseServer.id}/properties/`}].filter(Boolean)},pageTitle:i}}))},1736:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(231),r=s(233),n=s(85),o=s(282),i=s(790),l=s(1737);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{logo:t,showFrames:s,pageHeader:a,pageSidebar:r}=(0,o.default)(),i=n.Locale.getSection("components.pages.database-servers").lmsg("title");return{...e,logo:t,showFrames:s,pageHeader:{...a,helpMenu:{...a.helpMenu,helpContext:"db_servers"}},pageSidebar:r,pageContentHeader:{pageTitle:i,breadcrumbs:[r.isPowerUserPanel?null:{title:n.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home/"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:i,href:"/cp/server/db/"}].filter(Boolean)},pageTitle:i}}))},1742:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m,withDatabaseServerOverviewTabs:()=>p});var a=s(231),r=s(233),n=s(712),o=s(389),i=s(283),l=s(232),d=s(85);const c=({params:e,pathname:t,os:s})=>{const r=(0,n.useNavigate)(),{data:{databaseServer:c}={}}=(0,o.useQuery)(i.gql`
        query DatabaseServerOverviewTabs($id: ID!) {
            databaseServer: node(id: $id) {
                id
                ... on DatabaseServer {
                    databasesCount
                }
            }
        }
    `,{variables:{id:btoa(`DatabaseServer:${e.id}`)}}),p=(0,a.useMemo)((()=>[{title:d.Locale.getSection("components.pages.database-server-properties").lmsg("title"),url:`/cp/server/db/${e.id}/properties`},s.isWindows?{title:d.Locale.getSection("components.pages.database-server-change-password").lmsg("title"),url:`/cp/server/db/${e.id}/change-password`}:null,{title:d.Locale.getSection("components.pages.database-server-databases").lmsg("title"),url:`/cp/server/db/${e.id}/databases`,label:(0,a.jsx)(l.Label,{intent:"info",children:c.databasesCount})}].filter(Boolean)),[e,s,c]),m=(0,a.useMemo)((()=>p.findIndex((({url:e})=>e===t))+1),[p,t]);return(0,a.jsx)(l.Tabs,{active:m,children:p.map((({url:e,...t})=>(0,a.jsx)(l.Tab,{onActivate:()=>r(e),...t},e)))})};c.propTypes={params:r.PropTypes.shape({id:r.PropTypes.string.isRequired}).isRequired,pathname:r.PropTypes.string.isRequired,os:r.PropTypes.shape({isWindows:r.PropTypes.bool.isRequired}).isRequired};const p=e=>{const t=t=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{...t}),(0,a.jsx)(e,{...t})]});return t.displayName=`withDatabaseServerOverviewTabs(${e.displayName||e.name||"Component"})`,t.WrappedComponent=e,t},m=c},1667:(e,t,s)=>{"use strict";s.r(t),s.d(t,{getId:()=>a});const a=e=>e?Number(atob(e).split(":")[1]):null},1028:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/login.png?b68531bba0e522a3a35a90de80b8892a"},1638:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mariadb.png?7bb08a94b753b7fa7d53e994238873ab"},1640:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mssql.png?cef152af421a073477c90aa8001bef49"},1637:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mysql.png?c5c7e38a14aa2ec76ec4656a58b6dcc7"},973:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},1738:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/ok.png?402e5b49692b25d9d02326339ede77fa"},1639:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/percona.png?c9390f7e0aaad1e448de90386ec84dd6"},1641:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/postgresql.png?ed7a3e52b63253fa542b90e5981bdcaa"}}]);
//# sourceMappingURL=db.js.map?e31cde3b9eba483e693e