PageSourceSearch

https://aestheticveintraining.com/cp/javascript/components/pages/V…/Protection.js?a7c12c40ea1a608e0718

js aestheticveintraining.com collected 2026-10-04 13:54:50 UTC 18,160 bytes, 2 lines download raw bytes

1(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/VirtualDirectoryPage/Protection"],{1435:(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}))})}},2742:(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(2743),r=i(2744),o=i(2745),a=i(2746),d=i(2747)},2743:(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}}})}},2744:(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}))})}},2745:(e,t,i)=>{"use strict";i.r(t),i.d(t,{evictDomainVirtualDirectoryMimeTypesCache:()=>r});var n=i(2742);const r=(e,t)=>{(0,n.evictDomainVirtualDirectoryFieldsCache)(e,{domainId:t,fields:["mimeType","mimeTypes"]})}},2746:(e,t,i)=>{"use strict";i.r(t),i.d(t,{evictDomainVirtualDirectoryProtectionCache:()=>r});var n=i(2742);const r=(e,t)=>{(0,n.evictDomainVirtualDirectoryFieldsCache)(e,{domainId:t,fields:["content","protectedDirectory"]})}},2747:(e,t,i)=>{"use strict";i.r(t),i.d(t,{modifyCacheOnProtectedDirectoryAddOrDelete:()=>r});var n=i(2742);const r=(e,t)=>{(0,n.evictDomainHostingFieldCache)(e,t,"protectedDirectories"),(0,n.evictDomainVirtualDirectoryProtectionCache)(e,t)}},2748: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;
1d=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")},2759:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>n.default});var n=i(2760)},2760:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>x});var n=i(295),r=i(667),o=i.n(r),a=i(598),d=i(695),s=i(90),c=i(296),l=i(1169),u=i(665),m=i(545),p=i(1435),f=i(1226),y=i.n(f),v=i(2761),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 f=(0,a.useLocation)(),v=btoa(`ProtectedDirectory:${e}`),[b,x]=(0,n.useState)([]),[N,S]=(0,n.useState)([]),{queryResult:{refetch:P},listData:j,listProps:T,listInput:I}=(0,l.useGraphQlList)({key:i,onListInputChange:()=>x([]),query:y(),variables:{id:v},extractList:e=>e.protectedDirectory.users}),[V]=(0,d.useMutation)(D(),{refetchQueries:[y()],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()}}),L=(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,{rowKey:"id",filtered:w,loadingRows:N,selection:b,onSelectionChange:x,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:{...f,pathname:`${(0,u.getId)(e)}/password`},children:(0,n.jsx)(h,{content:"changePassword"})})})}],toolbar:(0,n.jsxs)(c.Toolbar,{children:[(0,n.jsx)(c.ToolbarGroup,{title:"",children:L}),(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 V({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:L})]}),...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 x=b},2761: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")},2814:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>n.default});var n=i(2815)},2815:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>D});var n=i(667),r=i.n(n),o=i(598),a=i(619),d=i(296),s=i(90),c=i(665),l=i(2816),u=i(2818),m=i(1237),p=i.n(m),f=i(295);const y=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,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u.default,{domainId:e,directoryId:(0,c.getId)(s.id),protectedDirectory:s,listKey:t}),(0,f.jsx)(o.Outlet,{})]}):(0,f.jsx)(l.default,{domainId:e,webDirName:r,onProtectError:v,userListKey:t}):(0,f.jsx)(d.StatusMessage,{intent:"info",children:(0,f.jsx)(y,{content:"notSupported"})})};v.propTypes={params:r().object.isRequired,userListKey:r().string.isRequired};const D=v},2816:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>g});var n=i(667),r=i.n(n),o=i(695),a=i(598),d=i(296),s=i(90),c=i(545),l=i(665),u=i(2742),m=i(1169),p=i(1237),f=i.n(p),y=i(2817),v=i.n(y),D=i(295);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:y}]=(0,o.useMutation)(v(),{refetchQueries:[f()],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:y?"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"})})})};h.propTypes={domainId:r().number.isRequired,webDirName:r().string.isRequired,onProtectError:r().func.isRequired,userListKey:r().string.isRequired};const g=h},2817:(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);
1else 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(1227).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;o=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")},2818:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>u});var n=i(667),r=i.n(n),o=i(598),a=i(296),d=i(2819),s=i(2759),c=(i(2820),i(295));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},2819:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>h});var n=i(295),r=i(667),o=i.n(r),a=i(598),d=i(695),s=i(296),c=i(90),l=i(545),u=i(2742),m=i(1237),p=i.n(m),f=i(2748),y=i.n(f);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:f}]=(0,d.useMutation)(y(),{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:f?"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},2820:(e,t,i)=>{"use strict";i.r(t)}}]);
2//# sourceMappingURL=Protection.js.map?a7c12c40ea1a608e0718

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.