"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/database/users-list"],{869:(e,a,t)=>{t.r(a);var s=t(210),r=t.n(s),d=t(88),l=t(870);const i={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},o={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},n=(0,l.default)(d.List,Object.keys(i));n.displayName="JswList",n.propTypes=i,n.defaultProps=o,a.default=n},870:(e,a,t)=>{t.r(a);var s=t(208),r=t(88);a.default=(e,a=[],t={})=>d=>{const l=(0,s.useRef)(),i=(0,s.useRef)(),[o,n]=Object.entries(d).reduce(((e,[t,s])=>(e[a.includes(t)?0:1][t]=s,e)),[{},{}]),u=a.map((e=>{const a=o[e];return t[e]?(i.current?.[t[e]](a),null):a}));return(0,s.useLayoutEffect)((()=>(i.current=new e(o),(0,r.render)(l.current,i.current),()=>{i.current.remove(),i.current=null})),[n.key,...u]),(0,s.jsx)("div",{ref:l,...n})}},1179:(e,a,t)=>{t.r(a);var s=t(208),r=t(210),d=t.n(r),l=t(88),i=t(869);const o=l.Locale.getSection("smb.controllers.database.users-list"),n=l.Locale.getSection("smb.components.lists.database.users"),u=({data:e,searchFilters:a,domainId:t,allowCreateUser:r})=>{const d=(0,s.useMemo)((()=>[l.list.COLUMN_SELECTION,{header:n.lmsg("login"),sortable:!0,dataIndex:"login",renderer({id:e,login:a,isDefault:t,isUsedByApp:s,status:r}){const d=t?(0,l.createElement)("b",a):a;return["orphaned"===r?d:(0,l.createElement)("a",{href:`/smb/database/edit-user/id/${e}`},d),s?` (${n.lmsg("disabledSelectHint")})`:"","orphaned"===r?` (${n.lmsg("orphanedHint",{orphanedRepairLink:(0,l.createElement)("a",{href:`/smb/database/repair-orphaned/id/${e}`},n.lmsg("orphanedRepairLink"))})})`:""]}},{header:n.lmsg("database"),sortable:!1,dataIndex:"databaseName",renderer:({globalUser:e,databaseName:a})=>e?(0,l.createElement)("b",a):a},{header:n.lmsg("server"),sortable:!1,dataIndex:"server",renderer:({serverHost:e,serverPort:a,serverTypeTitle:t})=>`${e}${0<a?`:${a}`:""} (${t})`}]),[]),u=(0,s.useMemo)((()=>[r?{componentType:l.SmallButton,title:o.lmsg("buttonAddUser"),description:o.lmsg("buttonAddUserHint"),addCls:"sb-add-user btn-primary",href:`/smb/database/create-user/domainId/${t}`}:null,r?{componentType:l.bar.Separator}:null,{componentType:l.SmallButton,id:"buttonRemoveUser",title:n.lmsg("remove"),description:n.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){const a=(0,l.getComponent)("database-users-list"),t=a.getSelectedItems();a.execGroupOperation({url:"/smb/database/delete-users",subtype:l.messageBox.SUBTYPE_DELETE,mouseEvent:e,text:n.formatMessage("confirmOnDelete",{login:`<b>${(0,l.escapeHtml)(t[0]?.login)}</b>`,count:t.length})})}}]),[r,t]),c=(0,s.useCallback)((({isUsedByApp:e,isDefault:a})=>e||a),[]);return(0,s.jsx)(i.default,{id:"database-users-list",data:e,dataUrl:`/smb/database/users-list-data/domainId/${t}`,searchFilters:a,searchOveral:"name",columns:d,operations:u,isDisabledItem:c})};u.propTypes={data:i.default.propTypes.data.isRequired,searchFilters:i.default.propTypes.searchFilters.isRequired,domainId:d().string.isRequired,allowCreateUser:d().bool.isRequired},a.default=u},1178:(e,a,t)=>{t.r(a);var s=t(697),r=t(1179),d=t(208);a.default=(0,s.withPageLayout)((e=>(0,d.jsx)(r.default,{...e})))},1177:(e,a,t)=>{t.r(a),t.d(a,{default:()=>s.default});var s=t(1178)}}]);
//# sourceMappingURL=users-list.js.map?c2b22bfa3b6da277f624