PageSourceSearch

https://diariodecuba.net/cp/javascript/components/pages/VirtualDir…/Protection.js?7631ad0800bf99620b00

js diariodecuba.net collected 2026-10-03 22:39:53 UTC 18,168 bytes, 2 lines download raw bytes

1(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["components/pages/VirtualDirectoryPage/Protection"],{2940(e,t,i){"use strict";i.r(t),i.d(t,{evictDomainHostingFieldCache:()=>n});const n=(e,t,i)=>{e.modify({id:e.identify({__typename:"Domain",id:btoa(`Domain:${t}`)}),fields:{hosting(e){const t={};for(const n in e)n===i||n.startsWith(`${i}(`)||(t[n]=e[n]);return t}}})}},2941(e,t,i){"use strict";i.r(t),i.d(t,{evictDomainVirtualDirectoryFieldsCache:()=>n});const n=(e,{domainId:t,fields:i})=>{Object.values(e.extract()).filter(({__typename:e})=>"VirtualDirectory"===e).filter(({key:e})=>atob(e).split(":")[1]===t).forEach(t=>{const n=e.identify(t);i.forEach(t=>e.evict({id:n,fieldName:t}))})}},2942(e,t,i){"use strict";i.r(t),i.d(t,{evictDomainVirtualDirectoryMimeTypesCache:()=>r});var n=i(2939);const r=(e,t)=>{(0,n.evictDomainVirtualDirectoryFieldsCache)(e,{domainId:t,fields:["mimeType","mimeTypes"]})}},2943(e,t,i){"use strict";i.r(t),i.d(t,{evictDomainVirtualDirectoryProtectionCache:()=>r});var n=i(2939);const r=(e,t)=>{(0,n.evictDomainVirtualDirectoryFieldsCache)(e,{domainId:t,fields:["content","protectedDirectory"]})}},2939(e,t,i){"use strict";i.r(t),i.d(t,{evictDomainHostingFieldCache:()=>n.evictDomainHostingFieldCache,evictDomainVirtualDirectoryFieldsCache:()=>r.evictDomainVirtualDirectoryFieldsCache,evictDomainVirtualDirectoryMimeTypesCache:()=>o.evictDomainVirtualDirectoryMimeTypesCache,evictDomainVirtualDirectoryProtectionCache:()=>a.evictDomainVirtualDirectoryProtectionCache,modifyCacheOnProtectedDirectoryAddOrDelete:()=>d.modifyCacheOnProtectedDirectoryAddOrDelete});var n=i(2940),r=i(2941),o=i(2942),a=i(2943),d=i(2944)},2944(e,t,i){"use strict";i.r(t),i.d(t,{modifyCacheOnProtectedDirectoryAddOrDelete:()=>r});var n=i(2939);const r=(e,t)=>{(0,n.evictDomainHostingFieldCache)(e,t,"protectedDirectories"),(0,n.evictDomainVirtualDirectoryProtectionCache)(e,t)}},2957(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>N});var n=i(396),r=i(787),o=i.n(r),a=i(715),d=i(810),s=i(95),c=i(397),l=i(1241),u=i(785),m=i(663),p=i(1540),y=i(1305),f=i.n(y),v=i(2958),D=i.n(v);const k=s.Locale.getSection("components.lists.ProtectedDirectoryUser"),h=s.Locale.getTranslate("components.lists.ProtectedDirectoryUser"),g=s.Locale.getTranslate("components.buttons"),b=({directoryId:e,protectedDirectory:t,listKey:i,userCreationLink:r,emptyListViewAddon:o=null,toolbarAddon:s=null})=>{const y=(0,a.useLocation)(),v=btoa(`ProtectedDirectory:${e}`),[b,N]=(0,n.useState)([]),[x,S]=(0,n.useState)([]),{queryResult:{refetch:P},listData:j,listProps:T,listInput:I}=(0,l.useGraphQlList)({key:i,onListInputChange:()=>N([]),query:f(),variables:{id:v},extractList:e=>e.protectedDirectory.users}),[L]=(0,d.useMutation)(D(),{refetchQueries:[f()],update:e=>(0,p.evictEntitiesCache)({cache:e,typename:"ProtectedDirectory",ids:[v],fields:["users"]}),awaitRefetchQueries:!0,onCompleted(){(0,m.addToast)({intent:"success",message:k.lmsg("removeSuccess")})},onError({message:e}){(0,m.addToast)({intent:"danger",message:e}),P()}}),V=(0,n.jsx)(c.Button,{icon:"plus",intent:"primary",component:a.Link,to:r,tooltip:(0,n.jsx)(h,{content:"addTooltip",params:{directory:`/${t.path}`}}),"data-type":"protected-directory-user-add",children:(0,n.jsx)(h,{content:"add"})}),w=!!I.searchFilters?.login;return(0,n.jsx)(l.GraphQlList,{"data-id":"protected-directory-users-list",rowKey:"id",filtered:w,loadingRows:x,selection:b,onSelectionChange:N,columns:[{key:"login",title:(0,n.jsx)(h,{content:"login"}),sortable:!0,type:"title"},{key:"actions",type:"actions",render:({id:e})=>(0,n.jsx)(c.ListActions,{children:(0,n.jsx)(c.ListAction,{primary:!0,icon:"key",component:a.Link,to:{...y,pathname:`${(0,u.getId)(e)}/password`},tooltipAsLabel:!0,children:k.lmsg("changePassword")})})}],toolbar:(0,n.jsxs)(c.Toolbar,{children:[(0,n.jsx)(c.ToolbarGroup,{title:"",children:V}),(0,n.jsx)(c.ToolbarGroup,{title:"",children:(0,n.jsx)(c.ListOperation,{critical:!0,noSelectionText:k.lmsg("noSelectionText"),confirmationText:()=>k.formatMessage("removeConfirmation",{login:(0,n.jsx)("b",{children:j.nodes.find(({id:e})=>b[0]===e).login}),count:b.length}),actionButtonText:(0,n.jsx)(g,{content:"yesRemove"}),cancelButtonText:(0,n.jsx)(g,{content:"cancel"}),children:(0,n.jsx)(c.Button,{"data-type":"protected-directory-user-remove",onClick:async()=>{S(b),await L({variables:{ids:b}}),S([])},tooltip:(0,n.jsx)(h,{content:"removeTooltip"}),children:(0,n.jsx)(h,{content:"remove"})})})}),s,(0,n.jsx)(c.ToolbarExpander,{}),(0,n.jsx)(c.ToolbarGroup,{groupable:!1,title:"",children:(0,n.jsx)(l.GraphQlList.SearchBar,{name:"login"})})]}),emptyView:(0,n.jsxs)(n.Fragment,{children:[o,(0,n.jsx)(c.ListEmptyView,{title:(0,n.jsx)(h,{content:"emptyViewTitle"}),actions:V})]}),...T})};b.propTypes={directoryId:o().string.isRequired,protectedDirectory:o().shape({path:o().string.isRequired}).isRequired,listKey:o().string.isRequired,userCreationLink:o().oneOfType([o().string,o().object]).isRequired,toolbarAddon:o().node,emptyListViewAddon:o().node};const N=b},2956(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>n.default});var n=i(2957)},3013(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>g});var n=i(787),r=i.n(n),o=i(810),a=i(715),d=i(397),s=i(95),c=i(663),l=i(785),u=i(2939),m=i(1241),p=i(1316),y=i.n(p),f=i(3014),v=i.n(f),D=i(396);const k=s.Locale.getTranslate("components.pages.VirtualDirectory.Protection.NoProtectionView"),h=({domainId:e,webDirName:t,onProtectError:i,userListKey:n})=>{const r=(0,a.useLocation)(),s=(0,a.useNavigate)(),[p,{loading:f}]=(0,o.useMutation)(v(),{refetchQueries:[y()],awaitRefetchQueries:!0,onCompleted({addProtectedDirectory:{protectedDirectory:e}},{variables:{input:{path:t}}}){(0,c.addToast)({intent:"success",message:(0,D.jsx)(k,{content:"successProtection",params:{path:(0,D.jsx)("b",{children:t})}})}),s({...r,pathname:`./${(0,l.getId)(e.id)}/add-user`})},onError({message:e}){(0,c.addToast)({intent:"danger",message:e}),i()},update(t){(0,u.modifyCacheOnProtectedDirectoryAddOrDelete)(t,e)}});return(0,D.jsx)(d.ListEmptyView,{title:(0,D.jsx)(k,{content:"title"}),actions:(0,D.jsx)(d.Button,{intent:"primary",state:f?"loading":void 0,onClick:()=>p({variables:{domainId:e,input:{path:t||"/",realm:""},protectedDirectoryUserListInput:(0,m.readGraphQlListInputFromStorage)({key:n})}}),"data-cy":"protect",children:(0,D.jsx)(k,{content:"protect"})})})};
1h.propTypes={domainId:r().number.isRequired,webDirName:r().string.isRequired,onProtectError:r().func.isRequired,userListKey:r().string.isRequired};const g=h},3012(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>D});var n=i(787),r=i.n(n),o=i(715),a=i(739),d=i(397),s=i(95),c=i(785),l=i(3013),u=i(3015),m=i(1316),p=i.n(m),y=i(396);const f=s.Locale.getTranslate("components.pages.VirtualDirectory.Protection"),v=({params:{domainId:e},userListKey:t})=>{const[i]=(0,o.useSearchParams)(),n=i.get("path")||"/",{data:{domain:{hosting:{virtualDirectory:{webDirName:r,protectedDirectory:s,isValidForProtection:m}}}},refetch:v}=(0,a.useQuery)(p(),{variables:{domainId:btoa(`Domain:${e}`),path:n}});return m?s?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u.default,{domainId:e,directoryId:(0,c.getId)(s.id),protectedDirectory:s,listKey:t}),(0,y.jsx)(o.Outlet,{})]}):(0,y.jsx)(l.default,{domainId:e,webDirName:r,onProtectError:v,userListKey:t}):(0,y.jsx)(d.StatusMessage,{intent:"info",children:(0,y.jsx)(f,{content:"notSupported"})})};v.propTypes={params:r().object.isRequired,userListKey:r().string.isRequired};const D=v},3015(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>u});var n=i(787),r=i.n(n),o=i(715),a=i(397),d=i(3016),s=i(2956),c=(i(3017),i(396));const l=({domainId:e,directoryId:t,protectedDirectory:i,listKey:n})=>{const r=(0,o.useLocation)(),l=(0,c.jsx)(d.default,{domainId:e,directoryId:t});return(0,c.jsx)(s.default,{directoryId:t,protectedDirectory:i,listKey:n,userCreationLink:{...r,pathname:`./${t}/add-user`},toolbarAddon:l,emptyListViewAddon:(0,c.jsx)(a.Toolbar,{className:"virtual-directory-page-protection-users-toolbar",children:l})})};l.propTypes={domainId:r().string.isRequired,directoryId:r().string.isRequired,protectedDirectory:r().shape({path:r().string.isRequired}).isRequired,listKey:r().string.isRequired};const u=l},3016(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>h});var n=i(396),r=i(787),o=i.n(r),a=i(715),d=i(810),s=i(397),c=i(95),l=i(663),u=i(2939),m=i(1316),p=i.n(m),y=i(2945),f=i.n(y);const v=c.Locale.getTranslate("components.pages.VirtualDirectory.Protection"),D=c.Locale.getSection("components.pages.VirtualDirectory.Protection"),k=({domainId:e,directoryId:t})=>{const i=(0,a.useLocation)(),r=(0,a.useNavigate)(),[o,c]=(0,n.useState)(!1),[m,{loading:y}]=(0,d.useMutation)(f(),{refetchQueries:[p()],awaitRefetchQueries:!0,onCompleted(){c(!1)},onError({message:e}){(0,l.addToast)({intent:"danger",message:e})},update(t){(0,u.modifyCacheOnProtectedDirectoryAddOrDelete)(t,e)}});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.ToolbarGroup,{title:D.lmsg("tools"),children:[(0,n.jsx)(s.Button,{icon:"lock-open-cross",onClick:()=>c(!0),tooltip:(0,n.jsx)(v,{content:"removeProtectionTooltip"}),"data-cy":"remove-protection",children:(0,n.jsx)(v,{content:"removeProtection"})}),(0,n.jsx)(s.Button,{onClick:()=>r({...i,pathname:`${t}/edit`}),tooltip:(0,n.jsx)(v,{content:"settingsTooltip"}),"data-cy":"protection-settings",children:(0,n.jsx)(v,{content:"settings"})})]}),(0,n.jsx)(s.Dialog,{isOpen:o,onClose:()=>c(!1),size:"xs",buttons:(0,n.jsx)(s.Button,{intent:"danger",onClick:()=>{m({variables:{ids:[btoa(`ProtectedDirectory:${t}`)]}})},state:y?"loading":void 0,"data-cy":"remove-protection-confirm",children:(0,n.jsx)(v,{content:"removeProtection"})}),children:(0,n.jsx)(v,{content:"removeProtectionConfirmation"})})]})};k.propTypes={domainId:o().string.isRequired,directoryId:o().string.isRequired};const h=k},3011(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>n.default});var n=i(3012)},1540(e,t,i){"use strict";i.r(t),i.d(t,{evictEntitiesCache:()=>n});const n=({cache:e,typename:t,ids:i=[],fields:n=[]})=>{Object.values(e.extract()).filter(({__typename:e,id:n})=>e===t&&(0===i.length||i.includes(n))).forEach(t=>{n.forEach(i=>e.evict({id:e.identify(t),fieldName:i}))})}},2958(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteProtectedDirectoryUser"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteProtectedDirectoryUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"ids"},value:{kind:"Variable",name:{kind:"Name",value:"ids"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ids"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:131}};t.loc.source={body:"mutation DeleteProtectedDirectoryUser($ids: [ID!]!) {\n    deleteProtectedDirectoryUser(input: { ids: $ids} ) {\n        ids\n    }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);
1else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,t)}),e.definitions&&e.definitions.forEach(function(e){i(e,t)})}var n={};function r(e,t){for(var i=0;i<e.definitions.length;i++){var n=e.definitions[i];if(n.name&&n.name.value==t)return n}}t.definitions.forEach(function(e){if(e.name){var t=new Set;i(e,t),n[e.name.value]=t}}),e.exports=t,e.exports.DeleteProtectedDirectoryUser=function(e,t){var i={kind:e.kind,definitions:[r(e,t)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var o=n[t]||new Set,a=new Set,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){a.has(e)||(a.add(e),(n[e]||new Set).forEach(function(e){d.add(e)}))})}return a.forEach(function(t){var n=r(e,t);n&&i.definitions.push(n)}),i}(t,"DeleteProtectedDirectoryUser")},3014(e,t,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProtectVirtualDirectory"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"domainId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProtectedDirectoryInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"protectedDirectoryUserListInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProtectedDirectoryUserListInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addProtectedDirectory"},arguments:[{kind:"Argument",name:{kind:"Name",value:"domainId"},value:{kind:"Variable",name:{kind:"Name",value:"domainId"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"protectedDirectory"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"path"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"users"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"protectedDirectoryUserListInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ProtectedDirectoryUserListFragment"},directives:[]}]}}]}}]}}]}}],loc:{start:0,end:502}};n.loc.source={body:'#import "queries/ProtectedDirectoryUserListFragment.graphql"\n\nmutation ProtectVirtualDirectory(\n    $domainId: ID!,\n    $input: ProtectedDirectoryInput!, \n    $protectedDirectoryUserListInput: ProtectedDirectoryUserListInput!\n) {\n    addProtectedDirectory(domainId: $domainId, input: $input) {\n        protectedDirectory {\n            id\n            path\n            users(input: $protectedDirectoryUserListInput) {\n                ...ProtectedDirectoryUserListFragment\n            }\n        }\n    }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var r={};function o(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){o(e,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){o(e,t)}),e.definitions&&e.definitions.forEach(function(e){o(e,t)})}n.definitions=n.definitions.concat(i(1306).definitions.filter(function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!r[t]&&(r[t]=!0,!0)}));var a={};function d(e,t){for(var i=0;i<e.definitions.length;i++){var n=e.definitions[i];if(n.name&&n.name.value==t)return n}}n.definitions.forEach(function(e){if(e.name){var t=new Set;o(e,t),a[e.name.value]=t}}),e.exports=n,e.exports.ProtectVirtualDirectory=function(e,t){var i={kind:e.kind,definitions:[d(e,t)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var n=a[t]||new Set,r=new Set,o=new Set;for(n.forEach(function(e){o.add(e)});o.size>0;){var s=o;
1o=new Set,s.forEach(function(e){r.has(e)||(r.add(e),(a[e]||new Set).forEach(function(e){o.add(e)}))})}return r.forEach(function(t){var n=d(e,t);n&&i.definitions.push(n)}),i}(n,"ProtectVirtualDirectory")},2945(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteProtectedDirectory"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteProtectedDirectory"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"ids"},value:{kind:"Variable",name:{kind:"Name",value:"ids"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ids"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:123}};t.loc.source={body:"mutation DeleteProtectedDirectory($ids: [ID!]!) {\n    deleteProtectedDirectory(input: { ids: $ids} ) {\n        ids\n    }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,t)}),e.definitions&&e.definitions.forEach(function(e){i(e,t)})}var n={};function r(e,t){for(var i=0;i<e.definitions.length;i++){var n=e.definitions[i];if(n.name&&n.name.value==t)return n}}t.definitions.forEach(function(e){if(e.name){var t=new Set;i(e,t),n[e.name.value]=t}}),e.exports=t,e.exports.DeleteProtectedDirectory=function(e,t){var i={kind:e.kind,definitions:[r(e,t)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var o=n[t]||new Set,a=new Set,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){a.has(e)||(a.add(e),(n[e]||new Set).forEach(function(e){d.add(e)}))})}return a.forEach(function(t){var n=r(e,t);n&&i.definitions.push(n)}),i}(t,"DeleteProtectedDirectory")},3017(e,t,i){"use strict";i.r(t)}}]);
2//# sourceMappingURL=Protection.js.map?7631ad0800bf99620b00

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.