1(globalThis.webpackChunkPlesk||=[]).push([["views/admin/client/ip-address/form"],{1604(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>d});var i=t(341),a=t(772),s=t(342);const d=({onClose:e,isOpen:n=!0,closeOnFormSuccess:t=!0,closeUrl:d="..",form:o,...l})=>{const r=(0,a.useNavigate)(),[c,u]=(0,i.useState)(n),p=(0,i.useRef)(null),m=(0,i.useCallback)((...n)=>{const t=e??(()=>r(d,{preventScrollReset:!0}));u(!1),p.current=setTimeout(()=>{t(...n),p.current=null},300)},[d,r,e]);(0,i.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]),(0,i.useEffect)(()=>{n?p.current&&clearTimeout(p.current):u(n)},[n]);const f=(0,i.useMemo)(()=>{if(o&&t){if((0,i.isValidElement)(o))return(0,i.cloneElement)(o,{onSuccess:(...e)=>{o.props.onSuccess?.(...e),m()}});if("object"==typeof o)return{...o,onSuccess:(...e)=>{o.onSuccess?.(...e),m()}}}return o},[t,m,o]);return(0,i.jsx)(s.Drawer,{...l,form:f,onClose:m,isOpen:c})}},2766(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>b});var i=t(342),a=t(1604),s=t(341),d=t(772),o=t(798),l=t(95),r=t(811),c=t(785),u=t(718),p=t(887),m=t.n(p),f=t(2767),v=t.n(f);const S=l.Locale.getTranslate("components.lists.client-ip-address.assign"),h=l.Locale.getSection("components.lists.client-ip-address.assign"),b=()=>{const e=(0,d.useNavigate)(),n=(0,d.useParams)(),[t,p]=(0,s.useState)({ipAddresses:[]}),f=btoa(`Client:${n.clientId}`),{data:{client:{availableIpAddress:b}={}}={}}=(0,c.useQuery)(m(),{variables:{clientId:f,ipAddressId:n.ipAddressId}}),[k,{loading:x}]=(0,r.useMutation)(v(),{refetchQueries:["ClientIpAddress"]}),A=0===b.length;return(0,s.jsx)(a.default,{"data-type":"client-ip-address-drawer",title:(0,s.jsx)(S,{content:"title"}),form:(0,s.jsx)(o.default,{"data-type":"client-ip-address-add-form",mutation:k,state:x?"submit":void 0,values:t,onSubmit:A?()=>e(".."):({ipAddresses:e})=>{const n=Object.entries(e).filter(([,e])=>Boolean(e)).map(([e])=>e);return{clientId:f,ids:n}},onSuccess:()=>{const e=Object.entries(t.ipAddresses).filter(([,e])=>Boolean(e)).map(([e])=>e);(0,u.addToast)({intent:"success",message:h.formatMessage("success",{name:(0,s.jsx)("b",{children:b.find(({id:n})=>e[0]===n).ipAddress}),count:e.length})})},onFieldChange:(e,n)=>p(t=>(0,i.setIn)(t,e,n)),submitButton:{name:"send","data-action":"submit"},applyButton:!1,children:(0,s.jsxs)(i.FormField,{label:(0,s.jsx)(S,{content:"description"}),children:[A?l.Locale.getSection("components.lists.client-ip-address").lmsg("noAvailableIps"):null,b.map(({id:e,ipAddress:n})=>(0,s.jsx)(i.FormFieldCheckbox,{name:`ipAddresses[${e}]`,label:n},e))]})})})}},2765(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>i.default});var i=t(2766)},2763(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>k});var i=t(341),a=t(342),s=t(1604),d=t(772),o=t(798),l=t(95),r=t(811),c=t(785),u=t(886),p=t.n(u),m=t(2764),f=t.n(m);const v=l.Locale.getTranslate("components.lists.client-ip-address"),S=l.Locale.getSection("components.lists.client-ip-address"),h=l.Locale.getTranslate("components.lists.client-ip-address.properties"),b=l.Locale.getSection("components.lists.client-ip-address.properties"),k=()=>{const e=(0,d.useParams)(),n=btoa(`Client:${e.clientId}`),{data:{ipAddress:{id:t,ipAddress:l,interface:u,type:m,allocatedType:k,isBroken:x,ftpOverSSL:A,typeChangeableInClientPool:y,domains:j,defaultDomain:I,certificate:E}={},capability:{ftp:{isExplicitSSL:g}={}}={},os:{isWindows:F}={},client:{type:C,certificates:N}={}}={}}=(0,c.useQuery)(p(),{variables:{clientId:n,ipAddressId:e.ipAddressId}}),[w,{loading:D}]=(0,r.useMutation)(f(),{refetchQueries:["ClientIpAddress"]}),L="SHARED"!==k,O=(0,i.useMemo)(()=>({id:t,type:y&&"RESELLER"===C?m:void 0,ftpOverSSL:F?A:void 0,certificateId:E?.id,domainId:I?.id??0}),[]),T=(0,i.useMemo)(()=>{const e=[...N];return e.find(({id:e})=>e===E.id)||e.push(E),e},[E,N]);return(0,i.jsx)(s.default,{"data-type":"client-ip-address-drawer",title:[(0,i.jsx)(a.Status,{style:{marginRight:".5rem"},intent:x?"danger":"success"},"title-status"),(0,i.jsx)(h,{content:"title",params:{address:l,interface:u}},"title-text")],form:L?(0,i.jsxs)(o.default,{"data-type":"client-ip-address-drawer-form","data-testid":"ClientIpAddressForm",values:O,mutation:w,state:D?"submit":void 0,onSubmit:t=>({...t,clientId:n,id:e.ipAddressId}),applyButton:!1,submitButton:{name:"send","data-action":"submit"},children:[(0,i.jsx)(a.FormField,{label:(0,i.jsx)(h,{content:"allocatedType"}
1),children:(0,i.jsx)(v,{content:"SHARED"===k?"typeShared":"typeExclusive"})}),y&&"RESELLER"===C?(0,i.jsx)(a.FormFieldRadioButtons,{label:(0,i.jsx)(h,{content:"distributedType"}),name:"type",options:[{value:"SHARED",label:(0,i.jsx)(v,{content:"typeShared"})},{value:"EXCLUSIVE",label:(0,i.jsx)(v,{content:"typeExclusive"})}]}):null,(0,i.jsx)(a.FormFieldSelect,{name:"certificateId",label:(0,i.jsx)(h,{content:"certificate"}),children:T.map(({id:e,name:n,ownerName:t})=>{const s=t?"domainCertificateRepository":"adminCertificateRepository";return(0,i.jsx)(a.SelectOption,{value:e,children:`${n} (${S.lmsg(s,{owner:t})})`},e)})}),(0,i.jsxs)(a.FormFieldSelect,{name:"domainId",label:(0,i.jsx)(h,{content:"defaultSite"}),children:[(0,i.jsx)(a.SelectOption,{value:0,children:b.lmsg("none")}),j.map(({id:e,name:n})=>(0,i.jsx)(a.SelectOption,{value:e,children:n},e))]}),F&&g?(0,i.jsx)(a.FormField,{label:(0,i.jsx)(v,{content:"ftpOverSSL"}),children:(0,i.jsx)(a.FormFieldCheckbox,{name:"ftpOverSSL",label:(0,i.jsx)(v,{content:"ftpOverSSL-allow"}),checkedValue:"ENABLED",uncheckedValue:"DISABLED"})}):null]}):void 0,children:L?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.FormField,{label:(0,i.jsx)(h,{content:"allocatedType"}),children:(0,i.jsx)(v,{content:"SHARED"===k?"typeShared":"typeExclusive"})}),(0,i.jsx)(a.FormField,{label:(0,i.jsx)(h,{content:"distributedType"}),children:(0,i.jsx)(v,{content:"SHARED"===m?"typeShared":"typeExclusive"})}),(0,i.jsx)(a.FormField,{label:(0,i.jsx)(h,{content:"certificate"}),children:()=>{const e=E.ownerName?"domainCertificateRepository":"adminCertificateRepository";return`${E.name} (${S.lmsg(e,{owner:E.ownerName})})`}}),(0,i.jsx)(a.FormField,{label:(0,i.jsx)(h,{content:"defaultSite"}),children:I?.id?I.name:(0,i.jsx)(h,{content:"none"})}),F?(0,i.jsx)(a.FormField,{label:(0,i.jsx)(v,{content:"ftpOverSSL"}),children:(0,i.jsx)(v,{content:"ftpOverSSL-"+(g?"ENABLED"===A?"yes":"no":"notAllowed")})}):null]})})}},2767(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddClientIpAddress"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddClientIpAddressInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addClientIpAddress"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ids"}}]}}]}}],loc:{start:0,end:124}};n.loc.source={body:"mutation AddClientIpAddress($input: AddClientIpAddressInput!) {\n addClientIpAddress(input: $input) {\n ids\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){t(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){t(e,n)}),e.definitions&&e.definitions.forEach(function(e){t(e,n)})}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach(function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.AddClientIpAddress=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,d=new Set,o=new Set;for(s.forEach(function(e){o.add(e)});o.size>0;){var l=o;o=new Set,l.forEach(function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach(function(e){o.add(e)}))})}return d.forEach(function(n){var i=a(e,n);i&&t.definitions.push(i)}),t}(n,"AddClientIpAddress")},2764(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateClientIpAddressMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Update
1ClientIpAddressInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateClientIpAddress"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}],loc:{start:0,end:140}};n.loc.source={body:"mutation UpdateClientIpAddressMutation($input: UpdateClientIpAddressInput!) {\n updateClientIpAddress(input: $input) {\n id\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){t(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){t(e,n)}),e.definitions&&e.definitions.forEach(function(e){t(e,n)})}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach(function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}}),e.exports=n,e.exports.UpdateClientIpAddressMutation=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,d=new Set,o=new Set;for(s.forEach(function(e){o.add(e)});o.size>0;){var l=o;o=new Set,l.forEach(function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach(function(e){o.add(e)}))})}return d.forEach(function(n){var i=a(e,n);i&&t.definitions.push(i)}),t}(n,"UpdateClientIpAddressMutation")}}]); 2//# sourceMappingURL=form.js.map?7dbd9cc4aebf55a9c050
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.