(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/server/db"],{1683:(e,t,s)=>{"use strict";s.r(t),s.d(t,{SORT_ASC:()=>d,SORT_DESC:()=>p,default:()=>x});var a=s(241),r=s(243),n=s.n(r),o=s(242),i=s(90);const l=i.Locale.getTranslate("components.list"),c=i.Locale.getSection("components.list"),d="ASC",p="DESC",m="all",u={set(e,t){localStorage.setItem(e,JSON.stringify(t))},get(e){const t=localStorage.getItem(e);return JSON.parse(t)}},b=e=>`list-sort_${e}`,g=e=>`list-page_${e}`,h=({id:e,data:t,columns:s,itemsPerPage:r,itemsPerPageOptions:n,sortColumn:i,sortDirection:p,searchField:h,locale:x,emptyView:v,emptyFilteredView:j,toolbar:S,selection:y,onSelectionChange:w,searchBarInputProps:f,rowKey:P,...T})=>{const{sortColumn:D,sortDirection:C,setSortState:k}=((e,{sortColumn:t,sortDirection:s})=>{const[{sortColumn:r,sortDirection:n},o]=(0,a.useState)({sortColumn:u.get(b(e))?.sortColumn??t,sortDirection:u.get(b(e))?.sortDirection??s});return{sortColumn:r,sortDirection:n,setSortState:t=>{o((e=>({...e,...t}))),u.set(b(e),{...u.get(b(e)),...t})}}})(e,{sortColumn:i??s.find((({sortable:e})=>e))?.key,sortDirection:p}),{page:L,itemsPerPage:R,searchPattern:q,setPageState:F}=((e,{itemsPerPage:t})=>{const[{page:s,itemsPerPage:r,searchPattern:n},o]=(0,a.useState)({page:u.get(g(e))?.page??1,itemsPerPage:u.get(g(e))?.itemsPerPage??t,searchPattern:u.get(g(e))?.searchPattern??""});return{page:s,itemsPerPage:r,searchPattern:n,setPageState:t=>{o((e=>({...e,...t}))),u.set(g(e),{...u.get(g(e)),...t})}}})(e,{itemsPerPage:n.includes(r)?r:n[0]}),I=(0,a.useMemo)((()=>q?j??(0,a.jsx)(o.ListEmptyView,{reason:"filtered",title:(0,a.jsx)(l,{content:"emptyViewFilteredTitle"}),description:(0,a.jsx)(l,{content:"emptyViewFilteredDescription"})}):v??(0,a.jsx)(o.ListEmptyView,{title:(0,a.jsx)(l,{content:"emptyViewTitle"})})),[q,v,j]),M=(0,a.useMemo)((()=>h?t.filter((e=>(Array.isArray(h)?h:[h]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(q.toLowerCase()))))):t),[t,q,h]),U=(0,a.useMemo)((()=>{if(!D)return M;const e=s.find((({key:e})=>e===D))?.sortDataField??D,t=s.find((({key:e})=>e===D))?.sort??((t,s)=>t[e]<s[e]?-1:t[e]>s[e]?1:0);return[...M].sort(((e,s)=>d===C?t(e,s):t(s,e)))}),[M,D,C,s]),$=(0,a.useMemo)((()=>{if(R===m)return U;const e=R*(L-1),t=e+R;return U.slice(e,t)}),[L,U,R]),B=(0,a.useCallback)((e=>{F({searchPattern:e}),e!==q&&F({page:1})}),[q]),E=(0,a.useCallback)((e=>{F({itemsPerPage:e});(e===m?1:Math.ceil(M.length/e))<L&&F({page:1})}),[M.length,L]);return(0,a.useEffect)((()=>{if("function"==typeof w&&y.length){const e=M.map((e=>{return t=e,"function"==typeof(s=P)?s(t):t[s];var t,s})).filter((e=>y.includes(e)));w(e)}}),[M]),(0,a.jsx)(o.List,{pagination:(0,a.jsx)(o.Pagination,{current:L,total:R===m?1:Math.ceil(M.length/R),onSelect:e=>F({page:e}),itemsPerPage:R,itemsPerPageOptions:n,onItemsPerPageChange:E}),toolbar:(S||h)&&(0,a.jsxs)(o.Toolbar,{children:[S,h&&(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:c.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",value:q,...f??{}},onTyping:B})})]})]}),totalRows:M.length,sortColumn:D,sortDirection:C,onSortChange:k,columns:s,data:$,filtered:!!q,locale:{totalRows:({totalRows:e})=>c.formatMessage("recordsTotal",{total:e}),...x},emptyView:I,onSelectionChange:w,selection:y,rowKey:P,...T})};h.propTypes={id:n().string.isRequired,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},h.defaultProps={itemsPerPage:25,itemsPerPageOptions:[10,25,100,m],sortColumn:void 0,sortDirection:d,searchField:void 0,locale:{},emptyView:void 0,emptyFilteredView:void 0,toolbar:void 0,onSelectionChange:void 0,selection:[],searchBarInputProps:void 0,rowKey:"key"};const x=h},1784:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(241),r=s(243),n=s.n(r),o=s(719),i=s(447),l=s(748),c=s(242),d=s(90),p=s(717),m=s(877),u=s(761);const b=d.Locale.getTranslate("components.forms.database-server-create"),g=d.Locale.getSection("components.lists.databaseservers"),h=d.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,d]=(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(836)},e?{query:s(838),variables:{id:e.id}}:null].filter(Boolean),awaitRefetchQueries:!0});return(0,a.jsxs)(m.default,{values:i,mutation:y,onSuccess:S,onFieldChange:(e,t)=>{d((s=>s=(0,c.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)(c.Section,{title:(0,a.jsx)(b,{content:"general"}),children:[e?(0,a.jsx)(c.SectionItem,{title:(0,a.jsx)(b,{content:"type"}),children:j(e.type)}):(0,a.jsx)(c.FormFieldSelect,{name:"type",label:(0,a.jsx)(b,{content:"type"}),children:t.map((e=>(0,a.jsx)(c.SelectOption,{value:e,children:j(e)},e)))}),e&&"localhost"===e.host&&!r?(0,a.jsx)(c.SectionItem,{title:(0,a.jsx)(b,{content:"host"}),children:e.host}):(0,a.jsx)(c.FormFieldText,{name:"host",label:(0,a.jsx)(b,{content:"host"}),required:!0}),e&&"localhost"===e.host&&!r?(0,a.jsx)(c.SectionItem,{title:(0,a.jsx)(b,{content:"port"}),children:(0,a.jsx)(b,{content:"unixSocket"})}):i.type===x?null:(0,a.jsx)(c.FormFieldText,{name:"port",label:(0,a.jsx)(b,{content:"port"}),description:(0,a.jsx)(b,{content:"portDescription"}),size:"sm"}),e?(0,a.jsx)(c.SectionItem,{title:(0,a.jsx)(b,{content:"version"}),children:e.serverVersion}):null,(0,a.jsx)(c.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)(c.FormFieldCheckbox,{name:"externalConnections",label:(0,a.jsx)(b,{content:"externalConnections"}),description:(0,a.jsx)(b,{content:"externalConnectionsDescription"})}):null]}),(0,a.jsxs)(c.Section,{title:(0,a.jsx)(b,{content:"authentication"}),children:[e?e.isUsedForPsaDb?null:e.isAdminCredentialsChangeable?(0,a.jsx)(c.Paragraph,{children:(0,a.jsx)(b,{content:"authenticationChangeDescription"})}):(0,a.jsx)(c.Paragraph,{children:(0,a.jsx)(b,{content:"authenticationEditDescription"})}):(0,a.jsx)(c.Paragraph,{children:(0,a.jsx)(b,{content:"authenticationAddDescription"})}),e&&e.isUsedForPsaDb?(0,a.jsx)(c.SectionItem,{title:(0,a.jsx)(b,{content:"adminLogin"}),children:e.adminLogin}):(0,a.jsx)(c.FormFieldText,{name:"adminLogin",label:(0,a.jsx)(b,{content:"adminLogin"}),required:!0}),e&&e.isUsedForPsaDb?null:(0,a.jsx)(c.FormFieldPassword,{name:"adminPassword",label:(0,a.jsx)(b,{content:"adminPassword"}),required:!0,hideGenerateButton:!0,hidePasswordMeter:!0})]}),e&&null!==e.backupSettings?(0,a.jsxs)(c.Section,{title:(0,a.jsx)(b,{content:"backupSettings"}),children:[(0,a.jsx)(c.FormFieldText,{name:"backupTempDir",label:(0,a.jsx)(b,{content:"backupTempDir"}),description:(0,a.jsx)(b,{content:"backupTempDirDescription"})}),(0,a.jsx)(c.FormFieldText,{name:"backupNetworkTempDir",label:(0,a.jsx)(b,{content:"backupNetworkTempDir"}),description:(0,a.jsx)(b,{content:"backupNetworkTempDirDescription"})}),(0,a.jsx)(c.FormFieldText,{name:"backupNetworkUser",label:(0,a.jsx)(b,{content:"backupNetworkUser"}),description:(0,a.jsx)(b,{content:"backupNetworkUserDescription"})}),(0,a.jsx)(c.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},1788:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var a=s(241),r=s(243),n=s(447),o=s(748),i=s(242),l=s(90),c=s(1738),d=s(717),p=s(761),m=s(1683);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,{id:"database-server-databases-list",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(c.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(839),variables:{id:t}}],awaitRefetchQueries:!0});e.length>0&&((0,d.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,d.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,c.getId)(t))}`,l=(0,a.jsx)(u,{content:"manageDatabase"}),d=(0,a.jsx)(u,{content:"manageDatabaseDescription"});return e||"ADMIN"===n?o=`/admin/subscription/login/id/${encodeURIComponent((0,c.getId)(t))}?pageUrl=${encodeURIComponent(o)}`:"RESELLER"===n?(o=`/admin/reseller/login/id/${encodeURIComponent((0,c.getId)(r))}?pageUrl=${encodeURIComponent(o)}`,l=(0,a.jsx)(u,{content:"manageDatabaseInResellerPanel"}),d=(0,a.jsx)(u,{content:"manageDatabaseInResellerPanelDescription"})):"CLIENT"===n&&(o=`/admin/customer/login/id/${encodeURIComponent((0,c.getId)(r))}?pageUrl=${encodeURIComponent(o)}`,l=(0,a.jsx)(u,{content:"manageDatabaseInCustomerPanel"}),d=(0,a.jsx)(u,{content:"manageDatabaseInCustomerPanelDescription"})),(0,a.jsx)(i.Tooltip,{title:d,children:(0,a.jsx)(i.Action,{component:p.default,to:o,icon:{src:s(1048)},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},1781:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var a=s(241),r=s(243),n=s(447),o=s(748),i=s(242),l=s(90),c=s(717),d=s(1738),p=s(761),m=s(1683);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]),P=(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]),T=(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"})});return(0,a.jsxs)(a.Fragment,{children:[P,(0,a.jsx)(m.default,{id:"database-servers-list",toolbar:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.ToolbarGroup,{title:b.lmsg("addGroup"),children:T}),(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(836)}],awaitRefetchQueries:!0});e.length>0&&((0,c.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,c.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,d.getId)(e))}/properties`,children:(0,a.jsx)(i.Icon,{src:s("NO_ERROR"===t?1782:999)})})})},{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(1660),mssql:s(1663),postgresql:s(1664),mariadb:s(1661),percona:s(1662)}[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,d.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,d.getId)(e))}/databases`,children:t})})},{key:"webadmin",type:"actions",render:({id:e,isWebadminInstalled:s,type:r,lastError:n})=>(0,a.jsx)(i.ListActions,{children:"MYSQL"===r?(0,a.jsx)(i.ListAction,{primary:!0,icon:"phpmyadmin",hidden:!s,component:"a",href:`/cp/server/db/${encodeURIComponent((0,d.getId)(e))}/webadmin`,target:"_blank",disabled:t||"NO_ERROR"!==n,tooltip:(0,a.jsx)(u,{content:"webadminHint"}),children:(0,a.jsx)(u,{content:"webadmin"})}):(0,a.jsx)(i.ListAction,{primary:!0,icon:"my-little-admin",component:"a",href:"/cp/server/db/mssql-client-instruction",target:"_blank",disabled:t||"NO_ERROR"!==n,tooltip:(0,a.jsx)(u,{content:"downloadMsSqlClientHint"}),children:(0,a.jsx)(u,{content:"downloadMsSqlClient"})})})}],rowKey:"id",data:l,searchField:"host",sortColumn:"host",selection:j,onSelectionChange:e=>S(e),loadingRows:y,emptyView:(0,a.jsx)(i.ListEmptyView,{actions:T})})]})};v.propTypes={data:r.PropTypes.array.isRequired,isDemo:r.PropTypes.bool,createDatabaseServerAllowed:r.PropTypes.bool},v.defaultProps={isDemo:!1,createDatabaseServerAllowed:!0};const j=v},1789:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(241),r=s(243),n=s(719),o=s(447),i=s(748),l=s(242),c=s(90),d=s(288),p=s(717),m=s(877),u=s(761),b=s(731),g=s(1786);const h=c.Locale.getTranslate("components.forms.database-server-change-password"),x=c.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,d.default)();return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"db_server_change_password"}},pageSidebar:a,pageContentHeader:{breadcrumbs:[a.isPowerUserPanel?null:{title:c.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home/"},{title:c.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:c.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:c.Locale.getSection("components.pages.database-server-change-password").lmsg("title"),href:`/cp/server/db/${e.databaseServer.id}/change-password/`}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1783:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(243),r=s.n(a),n=s(90),o=s(288),i=s(731),l=s(1784),c=s(241);const d=({server:{allowedByKeyDatabaseServerTypes:e}})=>(0,c.jsx)(l.default,{allowedTypes:e});d.propTypes={server:r().shape({allowedByKeyDatabaseServerTypes:r().array.isRequired}).isRequired};const p=(0,i.withPageLayout)(d,(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)}}}))},1787:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(241),r=s(243),n=s(90),o=s(288),i=s(731),l=s(1788),c=s(1786);const d=({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})};d.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,c.withDatabaseServerOverviewTabs)(d),(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}}}))},1785:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(243),r=s.n(a),n=s(90),o=s(288),i=s(731),l=s(1784),c=s(1786),d=s(241);const p=({databaseServer:e,os:{isWindows:t}})=>(0,d.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,c.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}}}))},1780:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(241),r=s(243),n=s(90),o=s(288),i=s(731),l=s(1781);const c=({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})};c.propTypes={databaseServers:r.PropTypes.array.isRequired,os:r.PropTypes.object.isRequired,mode:r.PropTypes.object.isRequired,primaryKey:r.PropTypes.object.isRequired};const d=(0,i.withPageLayout)(c,(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)}}}))},1786:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u,withDatabaseServerOverviewTabs:()=>m});var a=s(241),r=s(243),n=s(719),o=s(720),i=s(725),l=s(447),c=s(242),d=s(90);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:d.Locale.getSection("components.pages.database-server-properties").lmsg("title"),url:`/cp/server/db/${e.id}/properties`},t.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)(c.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)(c.Tabs,{active:u,children:m.map((({url:e,...t})=>(0,a.jsx)(c.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},1738:(e,t,s)=>{"use strict";s.r(t),s.d(t,{getId:()=>a});const a=e=>e?Number(atob(e).split(":")[1]):null},1048:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/login.png?b68531bba0e522a3a35a90de80b8892a"},1661:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mariadb.png?7bb08a94b753b7fa7d53e994238873ab"},1663:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mssql.png?cef152af421a073477c90aa8001bef49"},1660:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/mysql.png?c5c7e38a14aa2ec76ec4656a58b6dcc7"},999:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},1782:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/ok.png?402e5b49692b25d9d02326339ede77fa"},1662:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/percona.png?c9390f7e0aaad1e448de90386ec84dd6"},1664:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/postgresql.png?ed7a3e52b63253fa542b90e5981bdcaa"}}]);
//# sourceMappingURL=db.js.map?cbb1eaaf6947abd306a0