PageSourceSearch

https://diariodecuba.net/cp/javascript/views/admin/ip-address/list.js?2e3bc9862d6f579ee6c2

js diariodecuba.net collected 2026-10-03 22:38:18 UTC 16,493 bytes, 110 lines download raw bytes

1"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/admin/ip-address/list"],{2677(e,t,s){s.r(t),s.d(t,{default:()=>C});var n=s(396),i=s(787),r=s.n(i),a=s(397),d=s(1371),l=s(95),o=s(2678),c=s(715),p=s(663),u=s(861),m=s(810),x=s(700);const g=l.Locale.getTranslate("admin.components.forms.ip-address"),j=l.Locale.getSection("admin.components.forms.ip-address"),h=l.Locale.getTranslate("admin.components.forms.security-policy"),f=x.gql`
2    fragment generalFields on Query {
3        certificates(fromServerRepository: true) {
4            id
5            name
6            repositoryName
7        }
8        server {
9            settings {
10                ftpOverSSL
11            }
12            ipAddresses {
13                interfaces
14            }
15        }
16        os {
17            isIPv6Supported
18            isWindows
19        }
20        capability {
21            panel {
22                accessDriver {
23                    isHttpsProxyEnabled
24                    isDefaultAccessDomain
25                }
26            }
27            ftp {
28                isExplicitSSL
29            }
30        }
31    }
32`,b=x.gql`
33    ${f}
34    query UpdateIpAddressValues($id: ID!) {
35        ...generalFields
36        ipAddress: node(id: $id) {
37            ... on IpAddress {
38                id
39                type
40                onRepairMode
41                ipAddress
42                publicIpAddress
43                ftpOverSSL
44                isIPv6
45                interface
46                certificate {
47                    id
48                    name
49                    repositoryName
50                }
51                defaultDomain {
52                    id
53                }
54                domains {
55                    id
56                    name(idn: false)
57                    owner {
58                        name
59                    }
60                }
61            }
62        }
63    }
64`,v=x.gql`
65    ${f}
66    query CreateIpAddressValues{
67        ...generalFields
68    }
69`,S=x.gql`
70    mutation UpdateIpAddress($input: UpdateIpAddressInput!){
71        updateIpAddress(input: $input) {
72            ipAddress {
73                id
74                ipAddress
75            }
76            task {
77                id
78            }
79        }
80    }
81`,y=({children:e})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{}),(0,n.jsx)(a.Text,{bold:!0,style:{fontSize:"1.2rem"},children:(0,n.jsx)(h,{content:"secureFtpSection"})}),e]}),A="/cp/ip-address",I=({onSuccess:e=()=>{}})=>{const t=(0,c.useNavigate)(),s=(0,c.useMatch)(`${A}/add`),i=(0,c.useMatch)(`${A}/:id/edit`),r=!(!s&&!i),[x,f]=(0,n.useState)(null),[I,C]=(0,n.useState)(null),P=(e,t)=>{const{ipAddress:s={},server:n={}}=e;f(()=>{const i={ftpOverSSL:"CUSTOM"===n.settings.ftpOverSSL?s.ftpOverSSL:n.settings.ftpOverSSL,ipAddress:s.ipAddress,publicIpAddress:s.publicIpAddress??"",type:s.type??"EXCLUSIVE",certificateId:s.certificate?.id??e.certificates?.[0]?.id,interface:s.interface};return t?i.interface=s.interface??e.server.ipAddresses.interfaces?.[0]:i.defaultDomainId=s.defaultDomain?.id??0,i}),C(e)},k=({message:e})=>{(0,p.addToast)({intent:"danger",message:e}),F()},[T,{loading:w}]=(0,m.useMutation)(S),[D]=(0,u.useLazyQuery)(v,{onCompleted:e=>P(e,!0),onError:k}),[L]=(0,u.useLazyQuery)(b,{onCompleted:e=>P(e,!1),onError:k});(0,n.useEffect)(()=>{f(null),C(null),s?D():i&&L({variables:{id:i.params.id}})},[D,L,s,i,r]);const F=()=>{t(A)},O=(0,n.useMemo)(()=>{if(!I||!I?.os.isWindows)return null;const e=I?.capability.ftp.isExplicitSSL;if(!e||i&&!I.os.isIPv6Supported&&I.ipAddress.isIPv6)return(0,n.jsx)(y,{children:(0,n.jsx)(a.FormField,{label:(0,n.jsx)(h,{content:"ftpOverSsl"}),children:(0,n.jsx)(g,{content:e?"ftpOverSslIpv6NotSupportedByServer":"ftpOverSslNotSupportedByServer"})})});const t="CUSTOM"===I?.server.settings.ftpOverSSL,s=[t?null:{value:"REQUIRED",label:(0,n.jsx)(h,{content:"ftpOverSslOptionRequired"})},{value:"ENABLED",label:(0,n.jsx)(h,{content:"ftpOverSslOptionEnabled"})},{value:"DISABLED",label:(0,n.jsx)(h,{content:"ftpOverSslOptionDisabled"})}].filter(e=>e);return(0,n.jsx)(y,{children:(0,n.jsx)(a.FormFieldRadioButtons,{label:(0,n.jsx)(h,{content:"ftpOverSsl"}),name:"ftpOverSSL",disabled:!t,options:s,description:(0,n.jsx)(h,{content:t?"ftpOverSslCustomHint":"ftpOverSslCustomDisabledHint"})})})},[I,i]),E=i&&I?.os.isWindows&&I?.capability.panel.accessDriver.isHttpsProxyEnabled&&I?.capability.panel.accessDriver.isDefaultAccessDomain,R=(0,n.useMemo)(()=>
81{if(I){const e=[...I.certificates||[]],t=I.ipAddress?.certificate;return i&&t&&!e.find(e=>e.id===t.id)&&e.push(t),e}return[]},[I,i]);return(0,n.jsx)(a.Drawer,{"data-type":"ip-address-drawer",isOpen:r,onClose:F,title:i?(0,n.jsx)(g,{content:"editTitle",params:{address:(0,n.jsx)(a.Text,{bold:!0,children:I?.ipAddress.ipAddress||""}),interface:(0,n.jsx)(a.Text,{bold:!0,children:I?.ipAddress.interface||""})}}):(0,n.jsx)(g,{content:"addTitle"}),form:(0,n.jsx)(d.default,{"data-type":"ip-address-drawer-form",values:x,mutation:T,onSubmit:e=>(i&&(e.id=i.params.id),e),onSuccess:({updateIpAddress:{ipAddress:{id:s,ipAddress:n},task:i}={}})=>{i||(0,p.addToast)({intent:"success",message:l.Locale.getSection("admin.controllers.ip-address.add").lmsg("ipAddressAdded",{address:n})}),t(A),e({task:i,query:{query:b,variables:{id:s}}})},submitButton:{name:"send","data-action":"submit"},state:w?"loading":void 0,applyButton:!1,children:I?(0,n.jsxs)(n.Fragment,{children:[I.ipAddress?.onRepairMode?(0,n.jsx)(a.StatusMessage,{intent:"warning",children:(0,n.jsx)(g,{content:"ipAddressInterfaceNotAvailableWarning",params:{interface:I.ipAddress.interface}})}):null,s||I.ipAddress?.onRepairMode?(0,n.jsx)(a.FormFieldSelect,{name:"interface",label:(0,n.jsx)(g,{content:"interface"}),children:I.server.ipAddresses.interfaces.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}):null,s?(0,n.jsx)(a.FormFieldText,{name:"ipAddress",size:"lg",description:(0,n.jsx)(g,{content:I.isIPv6Supported?"addressHintIPv6":"addressHintIPv4"}),label:(0,n.jsx)(g,{content:"addressAndSubnetPrefixLength"}),inputProps:{maxLength:255}}):null,(0,n.jsx)(a.FormFieldText,{name:"publicIpAddress",label:(0,n.jsx)(g,{content:"publicIp"}),inputProps:{maxLength:255}}),(0,n.jsx)(a.FormFieldRadioButtons,{name:"type",label:(0,n.jsx)(g,{content:"distributionType"}),options:[{value:"SHARED",label:(0,n.jsx)(g,{content:"distributionTypeShared"})},{value:"EXCLUSIVE",label:(0,n.jsx)(g,{content:"distributionTypeExclusive"})}]}),(0,n.jsx)(a.FormFieldSelect,{name:"certificateId",label:(0,n.jsx)(g,{content:"certificate"}),children:R.map(({id:e,name:t})=>(0,n.jsx)("option",{value:e,children:t},e))}),i?(0,n.jsxs)(a.FormFieldSelect,{name:"defaultDomainId","data-testid":"defaultSite",label:(0,n.jsx)(g,{content:"defaultSite"}),children:[(0,n.jsx)("option",{value:0,children:j.lmsg("none")}),I.ipAddress.domains?.map(({id:e,name:t,owner:{name:s}})=>(0,n.jsx)("option",{value:e,children:`${t} (${s})`},e))]}):null,O,E?(0,n.jsx)("div",{style:{marginTop:"2rem"},children:(0,n.jsx)(a.Status,{intent:"warning",children:(0,n.jsx)(g,{content:"accessDomainOnAnyDomainWinWarning",params:{ip:I.ipAddress.ipAddress}})})}):null]}):(0,n.jsx)(o.default,{})})})};I.propTypes={onSuccess:r().func};const C=I},2678(e,t,s){s.r(t),s.d(t,{default:()=>r});var n=s(397),i=s(396);const r=()=>Array.from({length:6}).map((e,t)=>(0,i.jsx)(n.FormField,{label:(0,i.jsx)(n.SkeletonText,{lines:1}),children:(0,i.jsx)(n.Skeleton,{maxWidth:300})},t))},2675(e,t,s){s.r(t),s.d(t,{default:()=>S});var n=s(396),i=s(397),r=s(832),a=s(95),d=s(663),l=(s(2676),s(810)),o=s(739),c=s(700),p=s(770),u=s.n(p);const m=c.gql`
82    mutation RereadIpAddresses {
83        rereadIpAddresses {
84            result
85        }
86    }
87`,x=c.gql`
88    mutation ReloadPublicIpAddresses {
89        reloadPublicIpAddresses {
90            task {
91                id
92            }
93        }
94    }
95`,g=c.gql`
96    mutation DeleteIpAddress($ids: [ID!]!) {
97        deleteIpAddress(input: { ids: $ids} ) {
98            ids
99        }
100    }
101`,j=c.gql`
102    mutation RepairIpAddress($id: ID!) {
103        repairIpAddress(input: { id: $id }) {
104            ipAddress {
105                ipAddress
106            }
107        }
108    }
109`,h=a.Locale.getTranslate("admin.components.lists.ipaddresses"),f=a.Locale.getSection("admin.components.lists.ipaddresses"),b=a.Locale.getTranslate("components.buttons"),v={page:1,itemsPerPage:25},S=()=>{const[e,t]=(0,n.useState)({search:null,type:null}),[s,c]=(0,n.useState)({sortColumn:null,sortDirection:null}),[p,S]=(0,n.useState)(v),y=e=>e.sortColumn?{orderBy:{[e.sortColumn]:e.sortDirection}}:{},A={...p,...e,...y(s)},[I,{loading:C}]=(0,l.useMutation)(m,{refetchQueries:[{query:u(),variables:A}]}),[P,{loading:k}]=(0,l.useMutation)(x,{onCompleted({reloadPublicIpAddresses:{task:e}}){const t=({id:s,status:n})=>{e?.id===s&&"done"===n&&(_(),a.Observer.remove(t,"plesk:taskComplete"))};a.Observer.append(t,"plesk:taskComplete")}}),[T]=(0,l.useMutation)(g,{refetchQueries:[{query:u(),variables:A}],onCompleted(){(0,d.addToast)({intent:"success",message:f.lmsg("removeSuccess")})},onError({message:e}){(0,d.addToast)({intent:"danger",message:e}),_()}}),[w]=(0,l.useMutation)(j,{refetchQueries:[{query:u(),variables:A}],onCompleted({repairIpAddress:{ipAddress:{ipAddress:e}={}}={}}){(0,d.addToast)({intent:"success",message:f.lmsg("repairSuccess",{address:e})})},onError({message:e}){(0,d.addToast)({intent:"danger",message:e})}}),{data:D,previousData:L,loading:F,refetch:O}=(0,o.useQuery)(u(),{variables:v,notifyOnNetworkStatusChange:!0,onCompleted(e){const t=Math.ceil(e.server.ipAddresses.pageInfo.total/p.itemsPerPage);p.page>t&&S(e=>({...e,page:t})),c(e.server.ipAddresses.sortInfo)}}),{mode:{isDemo:E,isPowerUserPanel:R,canManageResellers:M}={},serverInfo:{isVirtuozzo:B}={},server:{firewall:q,ipAddresses:{nodes:H,pageInfo:{total:$},canReloadPublic:N,hasPublicIp:U}={}}={}}
109=D||L,[Q,V]=(0,n.useState)([]),[W,z]=(0,n.useState)([]),[G,X]=(0,n.useState)(!1),K=!(E||B),J=!R&&M,Y=e.search||e.type,Z="all"===p.itemsPerPage?1:Math.ceil($/p.itemsPerPage),_=async t=>{await O({...p,...e,...y(s),...t})},ee=(0,n.jsx)(i.Panel,{children:(0,n.jsxs)(i.ToolbarGroup,{title:"",className:"ip-address-page-filter",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(i.Hint,{children:(0,n.jsx)(h,{content:"address"})}),(0,n.jsx)(i.Input,{"aria-label":f.lmsg("address"),value:e.search,onChange:({target:e})=>t(t=>({...t,search:e.value}))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(i.Hint,{children:(0,n.jsx)(h,{content:"type"})}),(0,n.jsxs)(i.Select,{"aria-label":f.lmsg("type"),size:"sm",value:e.type??"",onChange:e=>t(t=>({...t,type:e||void 0})),children:[(0,n.jsx)("option",{value:"",children:f.lmsg("typeAny")}),(0,n.jsx)("option",{value:"SHARED",children:f.lmsg("typeShared")}),(0,n.jsx)("option",{value:"EXCLUSIVE",children:f.lmsg("typeExclusive")})]})]}),(0,n.jsx)(i.Button,{onClick:()=>{S(e=>({...e,page:1})),_({...e,page:1})},children:(0,n.jsx)(h,{content:"buttonSearch"})}),(0,n.jsx)(i.Button,{onClick:()=>{S(e=>({...e,page:1}));const e={search:null,type:null};t(e),_({...e,page:1})},children:(0,n.jsx)(h,{content:"buttonResetSearch"})})]})}),te=K?(0,n.jsx)(i.Button,{component:r.default,to:"/cp/ip-address/add","data-type":"ip-add-address",icon:"plus",intent:"primary",tooltip:(0,n.jsx)(h,{content:"buttonAddNewIpAddressDescription"}),children:(0,n.jsx)(h,{content:"buttonAddNewIpAddress"})}
109):null,se=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.Toolbar,{children:[(0,n.jsxs)(i.ToolbarGroup,{title:"",children:[te,(0,n.jsx)(i.Button,{"data-type":"ip-reread-configuration",icon:"refresh",onClick:I,state:C?"loading":void 0,tooltip:(0,n.jsx)(h,{content:"buttonRereadConfigurationDescription"}),children:(0,n.jsx)(h,{content:"buttonRereadConfiguration"})}),N?(0,n.jsx)(i.Button,{"data-type":"ip-button-reload-public",onClick:P,state:k?"loading":void 0,tooltip:(0,n.jsx)(h,{content:"buttonReloadPublicDescription"}),children:(0,n.jsx)(h,{content:"buttonReloadPublic"})}):null,q?.isEnabled?(0,n.jsx)(i.Button,{to:"/cp/firewall/",component:r.default,"data-type":"ip-button-firewall",tooltip:(0,n.jsx)(h,{content:"buttonFirewallDescription"}),children:(0,n.jsx)(h,{content:"buttonFirewall"})}):null]}),(0,n.jsx)(i.ToolbarGroup,{title:"",children:(0,n.jsx)(i.ListOperation,{critical:!0,confirmationText:()=>f.formatMessage("removeConfirmation",{name:(0,n.jsx)("b",{children:H.find(({id:e})=>Q[0]===e).ipAddress}),count:Q.length}),actionButtonText:(0,n.jsx)(b,{content:"yesRemove"}),cancelButtonText:(0,n.jsx)(b,{content:"cancel"}),children:(0,n.jsx)(i.Button,{"data-type":"ip-remove",disabled:!Q.length,onClick:async()=>{z(Q),await T({variables:{ids:Q}}),z([])},icon:"recycle",children:(0,n.jsx)(h,{content:"buttonRemove"})})})}),(0,n.jsx)(i.ToolbarExpander,{}),(0,n.jsx)(i.ToolbarGroup,{title:"",groupable:!1,children:(0,n.jsx)(i.Button,{"data-cy":"filter-button",icon:"chevron-"+(G?"up":"down"),state:G?"active":void 0,onClick:()=>X(e=>!e),tooltip:f.lmsg("buttonFilter"),tooltipAsLabel:!0})})]}),G&&ee]}),ne=(0,n.useMemo)(()=>[{key:"ipAddress",title:(0,n.jsx)(h,{content:"address"}),type:"title",sortable:!0,render:({isMain:e,ipAddress:t,id:s,mask:a,isBroken:d,isBlacklisted:l,isMissing:o})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Text,{bold:e,children:(0,n.jsx)(r.default,{"data-type":"ip-address-edit",to:`/cp/ip-address/${s}/edit`,children:t})}),(0,n.jsxs)(i.Hint,{children:[" ","/"," ",a]}),d?(0,n.jsx)("div",{style:{marginTop:"5px"},children:(0,n.jsxs)(i.Status,{intent:"warning",children:[(0,n.jsx)(h,{content:l?"ipAddressBlacklisted":"ipAddressBroken"})," ",o&&!l?(0,n.jsx)(i.Link,{onClick:()=>w({variables:{id:s}}),children:(0,n.jsx)(h,{content:"repair"})}):null]})}):null]})},U?{key:"publicIpAddress",title:(0,n.jsx)(h,{content:"publicAddress"}),sortable:!0,render:({isMain:e,publicIpAddress:t})=>(0,n.jsx)(i.Text,{bold:e,children:t})}:null,{width:"160px",key:"interface",title:(0,n.jsx)(h,{content:"interface"}),sortable:!0,render:({interface:e})=>e},{width:"150px",key:"type",title:(0,n.jsx)(h,{content:"type"}),sortable:!0,render:({type:e})=>(0,n.jsx)(h,{content:"SHARED"===e?"typeSharedHint":"typeExclusiveHint"})},J?{width:"60px",key:"resellersCount",title:(0,n.jsx)(h,{content:"resellerCount"}),sortable:!0,render:({id:e,resellersCount:t})=>(0,n.jsx)(r.default,{to:`${e}/clients`,children:t})}:null,R?null:{width:"60px",key:"subscriptionsCount",title:(0,n.jsx)(h,{content:"subscriptionCount"}),sortable:!0,render:({id:e,subscriptionsCount:t})=>(0,n.jsx)(r.default,{to:`${e}/domains`,children:t})}].filter(e=>e),[U,J,R,w]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Paragraph,{children:(0,n.jsx)(h,{content:J?"hintWithResellers":"hint"})}),(0,n.jsx)(i.List,{loadingRows:W,"data-type":"ip-address-list",loading:F,rowKey:"id",sortColumn:s.sortColumn,sortDirection:s.sortDirection,onSortChange:e=>{c(e),_(y(e))},columns:ne,selection:Q,onSelectionChange:e=>V(e),data:H,toolbar:se,totalRows:$,pagination:(0,n.jsx)(i.Pagination,{current:p.page,total:Z,onSelect:e=>{S(t=>({...t,page:e})),_({page:e})},itemsPerPage:p.itemsPerPage,onItemsPerPageChange:e=>{const t={page:1,itemsPerPage:"all"===e?1e4:e};S(t),_(t)},itemsPerPageOptions:[10,25,100,"all"]}),emptyView:(0,n.jsxs)(n.Fragment,{children:[Y&&se,(0,n.jsx)(i.ListEmptyView,{actions:!Y&&te})]})})]})}},2674(e,t,s){s.r(t),s.d(t,{default:()=>p});var n=s(396),i=s(801),r=s(462),a=s(95),d=s(741),l=s(2675),o=s(715),c=s(2677);const p=(0,i.withPageLayout)(()=>{const e=(0,d.useApolloClient)(),t=(0,n.useCallback)(({task:t,query:s})=>{const n=()=>e.refetchQueries({include:["IpAddressPage",s]});if(t){const e=({id:s,status:i})=>{t?.id===s&&"done"===i&&(n(),a.Observer.remove(e,"plesk:taskComplete"))};a.Observer.append(e,"plesk:taskComplete")}else n()},[e]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.default,{}),(0,n.jsx)(c.default,{onSuccess:t}),(0,n.jsx)(o.Outlet,{})]})},e=>{const{showFrames:t,pageHeader:s,pageSidebar:n}=(0,r.default)(),i=a.Locale.getSection("admin.controllers.ip-address.list").lmsg("title");return{...e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"ip-address.list"}},pageSidebar:n,pageContentHeader:{pageTitle:i,breadcrumbs:[n.isPowerUserPanel?null:{title:a.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home/"},{title:a.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools/"},{title:i,href:"/cp/ip-address/"}
109].filter(Boolean)},pageTitle:i}})},2673(e,t,s){s.r(t),s.d(t,{default:()=>n.default});var n=s(2674)},2676(e,t,s){s.r(t)}}]);
110//# sourceMappingURL=list.js.map?2e3bc9862d6f579ee6c2

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.