D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
cp
/
public
/
javascript
/
views
/
admin
/
client
/
ip-address
/
Filename :
form.js
back
Copy
(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/client/ip-address/form"],{1406:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>d});var i=t(285),a=t(580),s=t(286);const d=({onClose:e,isOpen:n=!0,closeOnFormSuccess:t=!0,closeUrl:d="..",form:l,...o})=>{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(l&&t){if((0,i.isValidElement)(l))return(0,i.cloneElement)(l,{onSuccess:(...e)=>{l.props.onSuccess?.(...e),m()}});if("object"==typeof l)return{...l,onSuccess:(...e)=>{l.onSuccess?.(...e),m()}}}return l}),[t,m,l]);return(0,i.jsx)(s.Drawer,{...o,form:f,onClose:m,isOpen:c})}},2514:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>b});var i=t(286),a=t(1406),s=t(285),d=t(580),l=t(1289),o=t(89),r=t(586),c=t(628),u=t(536),p=t(1272),m=t.n(p),f=t(2515),v=t.n(f);const S=o.Locale.getTranslate("components.lists.client-ip-address.assign"),h=o.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,r.useQuery)(m(),{variables:{clientId:f,ipAddressId:n.ipAddressId}}),[k,{loading:x}]=(0,c.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)(l.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?o.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)))]})})})}},2513:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>i.default});var i=t(2514)},2511:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>k});var i=t(285),a=t(286),s=t(1406),d=t(580),l=t(1289),o=t(89),r=t(586),c=t(628),u=t(1271),p=t.n(u),m=t(2512),f=t.n(m);const v=o.Locale.getTranslate("components.lists.client-ip-address"),S=o.Locale.getSection("components.lists.client-ip-address"),h=o.Locale.getTranslate("components.lists.client-ip-address.properties"),b=o.Locale.getSection("components.lists.client-ip-address.properties"),k=()=>{const e=(0,d.useParams)(),n=btoa(`Client:${e.clientId}`),{data:{ipAddress:{id:t,ipAddress:o,interface:u,type:m,allocatedType:k,isBroken:x,ftpOverSSL:A,typeChangeableInClientPool:y,domains:j,defaultDomain:I,certificate:E}={},capability:{ftp:{isExplicitSSL:g}={}}={},os:{isWindows:C}={},client:{type:F,certificates:w}={}}={}}=(0,r.useQuery)(p(),{variables:{clientId:n,ipAddressId:e.ipAddressId}}),[N,{loading:D}]=(0,c.useMutation)(f(),{refetchQueries:["ClientIpAddress"]}),L="SHARED"!==k,O=(0,i.useMemo)((()=>({id:t,type:y&&"RESELLER"===F?m:void 0,ftpOverSSL:C?A:void 0,certificateId:E?.id,domainId:I?.id??0})),[]),T=(0,i.useMemo)((()=>{const e=[...w];return e.find((({id:e})=>e===E.id))||e.push(E),e}),[E,w]);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:o,interface:u}},"title-text")],form:L?(0,i.jsxs)(l.default,{"data-type":"client-ip-address-drawer-form","data-testid":"ClientIpAddressForm",values:O,mutation:N,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"}),children:(0,i.jsx)(v,{content:"SHARED"===k?"typeShared":"typeExclusive"})}),y&&"RESELLER"===F?(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)))]}),C&&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"})}),C?(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]})})}},2515: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"}}},directives:[]}],directives:[],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"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ids"},arguments:[],directives:[]}]}}]}}],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,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var o=l;l=new Set,o.forEach((function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return d.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"AddClientIpAddress")},2512: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:"UpdateClientIpAddressInput"}}},directives:[]}],directives:[],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"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],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,l=new Set;for(s.forEach((function(e){l.add(e)}));l.size>0;){var o=l;l=new Set,o.forEach((function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return d.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"UpdateClientIpAddressMutation")}}]); //# sourceMappingURL=form.js.map?ddb4244b356199f81b51