D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
cp
/
public
/
javascript
/
components
/
pages
/
Filename :
BandwidthLimitingPage.js
back
Copy
(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/BandwidthLimitingPage"],{2716:(e,n,i)=>{"use strict";i.r(n),i.d(n,{BandwidthLimitingForm:()=>v});var a=i(285),t=i(596),d=i.n(t),s=i(628),o=i(580),r=i(286),c=i(1289),l=i(646),u=i(89),m=i(536),f=i(2717),p=i.n(f);i(2718);const h=u.Locale.getTranslate("components.pages.BandwidthLimiting"),g=({trafficBandwidth:e,maxConnection:n})=>({isTrafficBandwidthEnabled:-1!==e,trafficBandwidth:-1===e?"":e,isMaxConnectionEnabled:-1!==n,maxConnection:-1===n?"":n}),v=({domain:e,capability:n,params:i})=>{const t=(0,o.useNavigate)(),d=`/smb/web/overview/id/${i.domainId}/type/domain`,[u,f]=(0,a.useState)((()=>g(e.hosting.performance))),[v,{loading:b}]=(0,s.useMutation)(p());return(0,a.jsxs)(c.default,{values:u,mutation:v,onFieldChange:(e,n)=>{f((i=>(0,r.setIn)(i,e,n)))},onSubmit:()=>({id:btoa(`Domain:${i.domainId}`),trafficBandwidth:u.isTrafficBandwidthEnabled?u.trafficBandwidth?+u.trafficBandwidth:null:-1,maxConnection:u.isMaxConnectionEnabled?u.maxConnection?+u.maxConnection:null:-1}),state:b?"loading":void 0,onSuccess:({updateHostingPerformance:{domain:e}})=>{(0,m.addToast)({intent:"success",message:(0,a.jsx)(h,{content:"success"})}),f(g(e.hosting.performance)),t(d)},applyButton:!1,cancelButton:{component:l.default,to:d},children:[!n.packages.isQoSStarted&&(0,a.jsx)(r.StatusMessage,{intent:"warning",children:(0,a.jsx)(h,{content:"bandwidthThrottling"})}),(0,a.jsx)(r.FormField,{label:(0,a.jsx)(h,{content:"bandwidthLabel"}),description:(0,a.jsx)(h,{content:"bandwidthHint"}),required:u.isTrafficBandwidthEnabled,name:"trafficBandwidth",children:({getValue:e,setValue:n,isDisabled:i})=>(0,a.jsxs)("div",{className:"bandwidth-limiting-field-complex",children:[(0,a.jsxs)("div",{className:"bandwidth-limiting-input-with-suffix-wrapper bandwidth-limiting-input-complex-wrapper",children:[(0,a.jsx)(r.Input,{onChange:e=>n(e.target.value.replace(/\D/g,"")),maxLength:7,size:8,value:e(),disabled:!u.isTrafficBandwidthEnabled||i()}),(0,a.jsx)(h,{content:"kbps"})]}),(0,a.jsx)(r.FormFieldCheckbox,{name:"isTrafficBandwidthEnabled",label:(0,a.jsx)(h,{content:"unlimited"}),checkedValue:!1,uncheckedValue:!0})]})}),(0,a.jsx)(r.FormField,{label:(0,a.jsx)(h,{content:"maxConnectionLabel"}),description:(0,a.jsx)(h,{content:"maxConnectionHint"}),required:u.isMaxConnectionEnabled,name:"maxConnection",children:({getValue:e,setValue:n,isDisabled:i})=>(0,a.jsxs)("div",{className:"bandwidth-limiting-field-complex",children:[(0,a.jsx)("div",{className:"bandwidth-limiting-input-complex-wrapper",children:(0,a.jsx)(r.Input,{onChange:e=>n(e.target.value.replace(/\D/g,"")),maxLength:10,size:11,value:e(),disabled:!u.isMaxConnectionEnabled||i()})}),(0,a.jsx)(r.FormFieldCheckbox,{name:"isMaxConnectionEnabled",label:(0,a.jsx)(h,{content:"unlimited"}),checkedValue:!1,uncheckedValue:!0})]})})]})};v.propTypes={domain:d().shape({hosting:d().shape({performance:d().shape({trafficBandwidth:d().number.isRequired,maxConnection:d().number.isRequired}).isRequired}).isRequired}).isRequired,capability:d().shape({packages:d().shape({isQoSStarted:d().bool.isRequired}).isRequired}).isRequired,params:d().shape({domainId:d().string.isRequired}).isRequired}},2715:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>u});var a=i(596),t=i.n(a),d=i(286),s=i(89),o=i(2716),r=i(285);const c=s.Locale.getTranslate("components.pages.BandwidthLimiting"),l=e=>e.domain.hosting?(0,r.jsx)(o.BandwidthLimitingForm,{...e}):(0,r.jsx)(d.StatusMessage,{intent:"info",children:(0,r.jsx)(c,{content:"virtualHostingRequired"})});l.propTypes={domain:t().shape({hosting:t().shape({performance:t().shape({trafficBandwidth:t().number.isRequired,maxConnection:t().number.isRequired}).isRequired})}).isRequired,capability:t().shape({packages:t().shape({isQoSStarted:t().bool.isRequired}).isRequired}).isRequired,params:t().shape({domainId:t().string.isRequired}).isRequired};const u=l},2714:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>a.default});var a=i(2715)},2717:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateHostingPerformance"},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:327}};n.loc.source={body:"mutation UpdateHostingPerformance($input: UpdateHostingPerformanceInput!) {\n updateHostingPerformance(input: $input) {\n domain {\n id\n hosting {\n performance {\n trafficBandwidth\n maxConnection\n }\n }\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var a=e.type;"NamedType"===a.kind&&n.add(a.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var a={};function t(e,n){for(var i=0;i<e.definitions.length;i++){var a=e.definitions[i];if(a.name&&a.name.value==n)return a}}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.UpdateHostingPerformance=function(e,n){var i={kind:e.kind,definitions:[t(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var d=a[n]||new Set,s=new Set,o=new Set;for(d.forEach((function(e){o.add(e)}));o.size>0;){var r=o;o=new Set,r.forEach((function(e){s.has(e)||(s.add(e),(a[e]||new Set).forEach((function(e){o.add(e)})))}))}return s.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(n,"UpdateHostingPerformance")},2718:(e,n,i)=>{"use strict";i.r(n)}}]); //# sourceMappingURL=BandwidthLimitingPage.js.map?30729e4955ea2b743ba5