"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/database/users-list"],{897:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var s=a(218),r=a.n(s),d=a(96),o=a(898);const l={id:r().string,dataUrl:r().string,operations:r().array,itemActions:r().object,columns:r().array,data:r().shape({data:r().array,state:r().object,pager:r().object,locale:r().object,additional:r().object,pathbar:r().any}),searchFilters:r().object,searchOveral:r().string,disabledSelectHint:r().string,isDisabledItem:r().func,onRedraw:r().func,emptyViewMode:r().oneOf(["all","items"]),emptyView:r().any},n={id:void 0,dataUrl:void 0,operations:void 0,itemActions:void 0,columns:void 0,data:void 0,searchFilters:void 0,searchOveral:void 0,disabledSelectHint:void 0,isDisabledItem:void 0,onRedraw:void 0,emptyViewMode:void 0,emptyView:void 0},i=(0,o.default)(d.List,Object.keys(l));i.displayName="JswList",i.propTypes=l,i.defaultProps=n;const c=i},898:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var s=a(216),r=a(96);const d=(e,t=[],a={})=>d=>{const o=(0,s.useRef)(),l=(0,s.useRef)(),[n,i]=Object.entries(d).reduce(((e,[a,s])=>(e[t.includes(a)?0:1][a]=s,e)),[{},{}]),c=t.map((e=>{const t=n[e];return a[e]?(l.current?.[a[e]](t),null):t}));return(0,s.useLayoutEffect)((()=>(l.current=new e(n),(0,r.render)(o.current,l.current),()=>{l.current.remove(),l.current=null})),[i.key,...c]),(0,s.jsx)("div",{ref:o,...i})}},1241:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var s=a(216),r=a(218),d=a.n(r),o=a(96),l=a(897);const n=o.Locale.getSection("smb.controllers.database.users-list"),i=o.Locale.getSection("smb.components.lists.database.users"),c=({data:e,searchFilters:t,domainId:a,allowCreateUser:r})=>{const d=(0,s.useMemo)((()=>[o.list.COLUMN_SELECTION,{header:i.lmsg("login"),sortable:!0,dataIndex:"login",renderer({id:e,login:t,isDefault:a,isUsedByApp:s,status:r}){const d=a?(0,o.createElement)("b",t):t;return["orphaned"===r?d:(0,o.createElement)("a",{href:`/smb/database/edit-user/id/${e}`},d),s?` (${i.lmsg("disabledSelectHint")})`:"","orphaned"===r?` (${i.lmsg("orphanedHint",{orphanedRepairLink:(0,o.createElement)("a",{href:`/smb/database/repair-orphaned/id/${e}`},i.lmsg("orphanedRepairLink"))})})`:""]}},{header:i.lmsg("database"),sortable:!1,dataIndex:"databaseName",renderer:({globalUser:e,databaseName:t})=>e?(0,o.createElement)("b",t):t},{header:i.lmsg("server"),sortable:!1,dataIndex:"server",renderer:({serverHost:e,serverPort:t,serverTypeTitle:a})=>`${e}${0<t?`:${t}`:""} (${a})`}]),[]),c=(0,s.useMemo)((()=>[r?{componentType:o.SmallButton,title:n.lmsg("buttonAddUser"),description:n.lmsg("buttonAddUserHint"),addCls:"sb-add-user btn-primary",href:`/smb/database/create-user/domainId/${a}`}:null,r?{componentType:o.bar.Separator}:null,{componentType:o.SmallButton,id:"buttonRemoveUser",title:i.lmsg("remove"),description:i.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){const t=(0,o.getComponent)("database-users-list"),a=t.getSelectedItems();t.execGroupOperation({url:"/smb/database/delete-users",subtype:o.messageBox.SUBTYPE_DELETE,mouseEvent:e,text:i.formatMessage("confirmOnDelete",{login:`<b>${(0,o.escapeHtml)(a[0]?.login)}</b>`,count:a.length})})}}]),[r,a]),u=(0,s.useCallback)((({isUsedByApp:e,isDefault:t})=>e||t),[]);return(0,s.jsx)(l.default,{id:"database-users-list",data:e,dataUrl:`/smb/database/users-list-data/domainId/${a}`,searchFilters:t,searchOveral:"name",columns:d,operations:c,isDisabledItem:u})};c.propTypes={data:l.default.propTypes.data.isRequired,searchFilters:l.default.propTypes.searchFilters.isRequired,domainId:d().string.isRequired,allowCreateUser:d().bool.isRequired};const u=c},1240:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var s=a(765),r=a(1241),d=a(216);const o=(0,s.withPageLayout)((e=>(0,d.jsx)(r.default,{...e})))},1239:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s.default});var s=a(1240)}}]);
//# sourceMappingURL=users-list.js.map?97218c76a8dda0a11e17