1(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/BandwidthLimitingPage"],{1790:(e,i,n)=>{"use strict";n.r(i),n.d(i,{BandwidthLimitingForm:()=>b});var t=n(242),a=n(244),o=n.n(a),s=n(762),d=n(728),r=n(243),l=n(927),c=n(775),m=n(90),u=n(679),p=n(1791),h=n.n(p);n(1792);const f=m.Locale.getTranslate("components.pages.BandwidthLimiting"),g=({trafficBandwidth:e,maxConnection:i})=>({isTrafficBandwidthEnabled:-1!==e,trafficBandwidth:-1===e?"":e,isMaxConnectionEnabled:-1!==i,maxConnection:-1===i?"":i}),b=({domain:e,capability:i,params:n})=>{const a=(0,d.useNavigate)(),o=`/smb/web/overview/id/${n.domainId}/type/domain`,[m,p]=(0,t.useState)((()=>g(e.hosting.performance))),[b,{loading:v}]=(0,s.useMutation)(h());return(0,t.jsxs)(l.default,{values:m,mutation:b,onFieldChange:(e,i)=>{p((n=>(0,r.setIn)(n,e,i)))},onSubmit:()=>({id:btoa(`Domain:${n.domainId}`),trafficBandwidth:m.isTrafficBandwidthEnabled?m.trafficBandwidth?+m.trafficBandwidth:null:-1,maxConnection:m.isMaxConnectionEnabled?m.maxConnection?+m.maxConnection:null:-1}),state:v?"loading":void 0,onSuccess:({updateHostingPerformance:{domain:e}})=>{(0,u.addToast)({intent:"success",message:(0,t.jsx)(f,{content:"success"})}),p(g(e.hosting.performance)),a(o)},applyButton:!1,cancelButton:{component:c.default,to:o},children:[!i.packages.isQoSStarted&&(0,t.jsx)(r.StatusMessage,{intent:"warning",children:(0,t.jsx)(f,{content:"bandwidthThrottling"})}),(0,t.jsx)(r.FormField,{label:(0,t.jsx)(f,{content:"bandwidthLabel"}),description:(0,t.jsx)(f,{content:"bandwidthHint"}),required:m.isTrafficBandwidthEnabled,name:"trafficBandwidth",children:({getValue:e,setValue:i,isDisabled:n})=>(0,t.jsxs)("div",{className:"bandwidth-limiting-field-complex",children:[(0,t.jsxs)("div",{className:"bandwidth-limiting-input-with-suffix-wrapper bandwidth-limiting-input-complex-wrapper",children:[(0,t.jsx)(r.Input,{onChange:e=>i(e.target.value.replace(/\D/g,"")),maxLength:7,size:8,value:e(),disabled:!m.isTrafficBandwidthEnabled||n()}),(0,t.jsx)(f,{content:"kbps"})]}),(0,t.jsx)(r.FormFieldCheckbox,{name:"isTrafficBandwidthEnabled",label:(0,t.jsx)(f,{content:"unlimited"}),checkedValue:!1,uncheckedValue:!0})]})}),(0,t.jsx)(r.FormField,{label:(0,t.jsx)(f,{content:"maxConnectionLabel"}),description:(0,t.jsx)(f,{content:"maxConnectionHint"}),required:m.isMaxConnectionEnabled,name:"maxConnection",children:({getValue:e,setValue:i,isDisabled:n})=>(0,t.jsxs)("div",{className:"bandwidth-limiting-field-complex",children:[(0,t.jsx)("div",{className:"bandwidth-limiting-input-complex-wrapper",children:(0,t.jsx)(r.Input,{onChange:e=>i(e.target.value.replace(/\D/g,"")),maxLength:10,size:11,value:e(),disabled:!m.isMaxConnectionEnabled||n()})}),(0,t.jsx)(r.FormFieldCheckbox,{name:"isMaxConnectionEnabled",label:(0,t.jsx)(f,{content:"unlimited"}),checkedValue:!1,uncheckedValue:!0})]})})]})};b.propTypes={domain:o().shape({hosting:o().shape({performance:o().shape({trafficBandwidth:o().number.isRequired,maxConnection:o().number.isRequired}).isRequired}).isRequired}).isRequired,capability:o().shape({packages:o().shape({isQoSStarted:o().bool.isRequired}).isRequired}).isRequired,params:o().shape({domainId:o().string.isRequired}).isRequired}},1788:(e,i,n)=>{"use strict";n.r(i),n.d(i,{default:()=>f});var t=n(244),a=n.n(t),o=n(243),s=n(90),d=n(739),r=n(290),l=n(1789),c=n(1790),m=n(242);const u=s.Locale.getSection("components.pages.BandwidthLimiting"),p=s.Locale.getTranslate("components.pages.BandwidthLimiting"),h=e=>e.domain.hosting?(0,m.jsx)(c.BandwidthLimitingForm,{...e}):(0,m.jsx)(o.StatusMessage,{intent:"info",children:(0,m.jsx)(p,{content:"virtualHostingRequired"})});h.propTypes={domain:a().shape({hosting:a().shape({performance:a().shape({trafficBandwidth:a().number.isRequired,maxConnection:a().number.isRequired}).isRequired})}).isRequired,capability:a().shape({packages:a().shape({isQoSStarted:a().bool.isRequired}).isRequired}).isRequired,params:a().shape({domainId:a().string.isRequired}).isRequired};const f=(0,d.withPageLayout)(h,(({domain:e,params:i})=>{const{showFrames:n,pageHeader:t,pageSidebar:a}=(0,r.default)(),o=e.baseDomain||e,s=u.lmsg("title",{domainName:`<b>${e.name}</b>`}),d=[...(0,l.getDomainPageCommonBreadcrumbs)({domain:e,baseDomain:o}),{title:s,href:`/cp/domains/${i.domainId}/bandwidth-limiting`}];return{key:i.domainId,showFrames:n,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"client.domain.hosting.performance"}},pageSidebar:a,pageContentHeader:{pageTitle:s,breadcrumbs:d}}}))},1787:(e,i,n)=>{"use strict";n.r(i),n.d(i,{default:()=>t.default});var t=n(1788)},1789:(e,i,n)=>{"use strict";n.r(i),n.d(i,{getDomainPageCommonBreadcrumbs:()=>d});var t=n(90),a=n(290),o=n(1344),s=n(1343);const d=({baseDomain:e,domain:i})=>{const{pageSidebar:n}=(0,a.default)(),{isPowerUserPanel:d,navigationContext:r}=n,l=(0,o.getId)(i.id),c=(0,o.getId)(e.id);return[{title:t.Locale.getSection("admin.controllers.home.index").lmsg("title"),href:"/admin/home",show:!d},{title:t.Locale.getSection("admin.controllers.subscription.list").lmsg("title"),href:"/admin/subscription/list",show:!d&&"subscriptions"===r},{title:t.Locale.getSection("admin.controllers.subscription.overview").lmsg("title",{name:`<b>${e.name}</b>`}),href:`/admin/subscription/overview/id/${c}`,show:!d&&"subscriptions"===r},{title:t.Locale.getSection("admin.controllers.domain.list").lmsg("title"),href:"/admin/domain/list",show:!d&&"domains"===r},{title:t.Locale.getSection("smb.controllers.web.index").lmsg("title"),href:(0,s.getContextUrl)(c,"/smb/web/view"),show:d||"subscriptions"===r},{title:i.name,href:(0,s.getContextUrl)(c,`/smb/web/overview/id/${l}/type/domain`)}].filter((({show:e=!0})=>e))}},1343:(e,i,n)=>{"use strict";n.r(i),n.d(i,{getContextUrl:()=>a});var t=n(290);const a=(e,i)=>{const{pageSidebar:n}=(0,t.default)(),a=encodeURIComponent(i);return n?.isPowerUserPanel?`/smb/account/switch/id/${e}?hideNotice=1&returnUrl=${a}`:`/admin/subscription/login/id/${e}?pageUrl=${a}`}},1344:(e,i,n)=>{"use strict";n.r(i),n.d(i,{getId:()=>t});const t=e=>e?Number(atob(e).split(":")[1]):null},1791:e=>{var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateHostingPerformance"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateHostingPerformanceInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateHostingPerformance"},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:"domain"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hosting"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"performance"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"trafficBandwidth"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"maxConnection"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:340}};i.loc.source={body:"mutation UpdateHostingPerformance($input: UpdateHostingPerformanceInput!) {\r\n updateHostingPerformance(input: $input) {\r\n domain {\r\n id\r\n hosting {\r\n performance {\r\n trafficBandwidth\r\n maxConnection\r\n }\r\n }\r\n }\r\n }\r\n}\r\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,i){if("FragmentSpread"===e.kind)i.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&i.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,i)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,i)})),e.definitions&&e.definitions.forEach((function(e){n(e,i)}))}var t={};function a(e,i){for(var n=0;n<e.definitions.length;n++){var t=e.definitions[n];if(t.name&&t.name.value==i)return t}}i.definitions.forEach((function(e){if(e.name){var i=new Set;n(e,i),t[e.name.value]=i}})),e.exports=i,e.exports.UpdateHostingPerformance=function(e,i){var n={kind:e.kind,definitions:[a(e,i)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var o=t[i]||new Set,s=new Set,d=new Set;for(o.forEach((function(e){d.add(e)}));d.size>0;){var r=d;d=new Set,r.forEach((function(e){s.has(e)||(s.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return s.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(i,"UpdateHostingPerformance")},1792:(e,i,n)=>{"use strict";n.r(i)}}]); 2//# sourceMappingURL=BandwidthLimitingPage.js.map?7c596028efb59c70e7b1
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.