PageSourceSearch

https://diskvision.com/cp/javascript/components/pages/BrandingPage.js?35d3477a8ea0d366655d

js diskvision.com collected 2026-10-07 01:07:41 UTC 11,557 bytes, 2 lines download raw bytes

1(globalThis.webpackChunkPlesk||=[]).push([["components/pages/BrandingPage"],{2603(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>N});var a=i(341),l=i(811),t=i(785),o=i(342),d=i(95),s=i(815),c=i(909),r=i(798),u=i(797),m=i(718),g=(i(2604),i(849)),b=i.n(g),k=i(2605),v=i.n(k);const F=d.Locale.getTranslate("admin.components.forms.settings-ui.branding"),f=d.Locale.getSection("admin.components.forms.settings-ui.branding.background.fit"),x="#4B4B4B",h="fill",p="center",j="tile",S=[h,"fit",p,j],N=(0,c.withSimplePageLayout)(()=>{const e=(0,s.default)(),{data:{viewer:{type:n,branding:{customTitle:i,logo:d,customFavicon:c,background:g}}}}=(0,t.useQuery)(b()),{file:k,color:N,fit:E}=g||{},[I,B]=(0,a.useState)({customTitleEnabled:!!i,customTitle:i??"",customLogoEnabled:!!d,logoFile:null,logoUrlEnabled:d?.url?"enabled":"disabled",logoUrl:d?.url,customFaviconEnabled:c,faviconFileSvg:null,faviconFileIco:null,enabledBackground:!!k,backgroundFile:null,backgroundColor:N||x,backgroundFit:E}),[w,C]=(0,a.useState)(),T="ADMIN"===n?"/admin/server/tools":"/admin/reseller/tools",[y,D]=(0,a.useState)(),[L,U]=(0,a.useState)(),[z]=(0,l.useMutation)(v()),A=(0,a.useMemo)(()=>!(I.enabledBackground&&(I.backgroundFile||k)),[I,k]);(0,a.useEffect)(()=>{const e=L||(k?`/images/${k}`:null);if(!e)return void C(null);const n=new Image;n.onload=function(){C(n)},n.src=e},[L,k]);const V=(0,a.useMemo)(()=>{let e="cover";switch(I.backgroundFit){case h:e="cover";break;case"fit":e="contain";break;case p:case j:e=w?.height<1080?w?.height/1080*100+"%":"100%"}return{display:!I.enabledBackground&&"none",backgroundColor:I.backgroundColor,inlineSize:300,maxInlineSize:"100%",aspectRatio:"16 / 9",marginBlock:16,backgroundImage:w&&`url(${w.src})`,backgroundSize:e,backgroundRepeat:I.backgroundFit===j?"repeat":"no-repeat",backgroundPosition:"center"}},[I,w]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:(0,a.jsx)(F,{content:"description"})}),(0,a.jsxs)(r.default,{mutation:z,values:I,onFieldChange:(e,n)=>{B(i=>(0,o.setIn)(i,e,n))},submitButton:{id:"buttonid-ok"},applyButton:{id:"buttonid-apply"},cancelButton:{component:u.default,id:"buttonid-cancel",to:T},onSubmit:({customTitleEnabled:e,customTitle:n,customLogoEnabled:i,logoUrlEnabled:a,logoUrl:l,logoFile:t,customFaviconEnabled:o,faviconFileSvg:d,faviconFileIco:s,enabledBackground:c,backgroundFile:r,...u})=>({customTitle:e?n:"",customLogoEnabled:i,logoUrlEnabled:i&&"enabled"===a,logoUrl:i&&"enabled"===a?l:"",logoFile:i?t:null,customFaviconEnabled:o,faviconFileSvg:o?d:null,faviconFileIco:o?s:null,enabledBackground:c,backgroundFile:c?r:null,...u}),onSuccess:({editBranding:{warnings:n}},i)=>{(0,m.addToast)({intent:"success",message:(0,a.jsx)(F,{content:"updateSuccess"})}),n.forEach(e=>{(0,m.addToast)({intent:"warning",message:e})});var l;((0,o.getIn)(I,"customFaviconEnabled")?Boolean((0,o.getIn)(I,"faviconFileSvg")||(0,o.getIn)(I,"faviconFileIco")):c)&&(l=Date.now(),document.querySelectorAll('[rel="icon"]').forEach(e=>{e.href=e.href.replace(/\?\d+/,`?${l}`)}),D(l)),e(i?window.location.pathname:T),B(e=>(0,o.setIn)(e,"backgroundFile",null))},children:[(0,a.jsxs)(o.Section,{title:(0,a.jsx)(F,{content:"sectionTitle"}),children:[(0,a.jsx)(o.FormFieldCheckbox,{name:"customTitleEnabled",label:(0,a.jsx)(F,{content:"enableCustomTitle"})}),(0,a.jsx)(o.FormFieldText,{name:"customTitle",label:(0,a.jsx)(F,{content:"customTitle"}),size:"lg",maxLength:"255",disabled:!(0,o.getIn)(I,"customTitleEnabled")})]}),(0,a.jsxs)(o.Section,{title:(0,a.jsx)(F,{content:"sectionLogo"}),children:[(0,a.jsx)(o.FormFieldCheckbox,{name:"customLogoEnabled",label:(0,a.jsx)(F,{content:"enableCustomLogo"})}),(0,a.jsx)(o.FormField,{name:"logoFile",label:(0,a.jsx)(F,{content:"logo"}),disabled:!(0,o.getIn)(I,"customLogoEnabled"),children:({getId:e,getName:n,setValue:i,isDisabled:l})=>(0,a.jsxs)(a.Fragment,{children:[d?.fake&&(0,a.jsx)("p",{children:(0,a.jsx)("img",{style:{maxWidth:"224px"},src:`/images/logos/${d.fake}`,alt:""})}),(0,a.jsx)(o.InputFile,{id:e(),name:n(),disabled:l(),onChange:e=>i(e)})]})}),(0,a.jsx)(o.FormFieldRadioButtons,{name:"logoUrlEnabled",label:(0,a.jsx)(F,{content:"logoUrl"}),disabled:!(0,o.getIn)(I,"customLogoEnabled"),options:[{value:"disabled",label:(0,a.jsx)(F,{content:"logoUrlDisabled"})},{value:"enabled",label:(0,a.jsx)(F,{content:"logoUrlEnabled"}),indentFields:[(0,a.jsx)(o.FormFieldText,{name:"logoUrl",label:null,size:"lg",maxLength:"245"},"logoUrl")]}]})]}),"ADMIN"===n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.Section,{title:(0,a.jsx)(F,{content:"sectionFavicon"}),children:[(0,a.jsx)(o.FormFieldCheckbox,{name:"customFaviconEnabled",label:(0,a.jsx)(F,{content:"enableCustomFavicon"}),description:(0,a.jsx)(F,{content:"sectionFaviconDesc"})}),(0,a.jsx)(o.FormField,{name:"faviconFileSvg",label:(0,a.jsx)(F,{content:"faviconSvg"}),description:(0,a.jsx)(F,{content:"faviconSvgHint"}),disabled:!(0,o.getIn)(I,"customFaviconEnabled"),required:!0,children:({getId:e,getName:n,setValue:i,isDisabled:l})=>(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Icon,{src:"/images/favicon.svg"+(y?`?${y}`:""),size:"16"})," "]}),(0,a.jsx)(o.InputFile,{id:e(),name:n(),disabled:l(),onChange:e=>i(e)})]})}),(0,a.jsx)(o.FormField,{name:"faviconFileIco",label:(0,a.jsx)(F,{content:"faviconIco"}),description:(0,a.jsx)(F,{content:"faviconIcoHint"}),disabled:!(0,o.getIn)(I,"customFaviconEnabled"),required:!0,children:({getId:e,getName:n,setValue:i,isDisabled:l})=>(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Icon,{src:"/favicon.ico"+(y?`?${y}`:""),size:"16"})," "]}),(0,a.jsx)(o.InputFile,{id:e(),name:n(),disabled:l(),onChange:e=>i(e)})]})})]}),(0,a.jsxs)(o.Section,{title:(0,a.jsxs)("div",{children:[(0,a.jsx)(F,{content:"sectionBackgroun
1d"})," ",(0,a.jsx)("a",{href:"https://support.plesk.com/hc/en-us/articles/20821281229335",target:"_blank",rel:"noreferrer",children:(0,a.jsx)(o.Icon,{name:"info-circle-filled",intent:"info",size:"16",style:{verticalAlign:0}})})]}),children:[(0,a.jsx)(o.FormField,{name:"backgroundColor",label:(0,a.jsx)(F,{content:"backgroundColor"}),children:({getValue:e,setValue:n})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Input,{type:"color",size:"sm",style:{padding:0},className:"background-preview",value:e(),onChange:e=>n(e.target.value)})," ",e()!==x&&(0,a.jsx)(o.Button,{ghost:!0,icon:"reload",onClick:()=>n(x),children:(0,a.jsx)(F,{content:"backgroundResetColor"})})]})}),(0,a.jsx)(o.FormFieldCheckbox,{name:"enabledBackground",label:(0,a.jsx)(F,{content:"enableCustomBackground"})}),(0,a.jsx)("div",{style:V,className:"background-preview"}),(0,a.jsx)(o.FormField,{name:"backgroundFile",label:(0,a.jsx)(F,{content:"backgroundFile"}),disabled:!(0,o.getIn)(I,"enabledBackground"),children:({getId:e,getName:n,setValue:i,isDisabled:l})=>(0,a.jsx)(o.InputFile,{id:e(),name:n(),disabled:l(),onChange:e=>{i(e),(e=>{if(e){const n=new FileReader;n.onload=function(e){const{result:n}=e.target;U(n)},n.readAsDataURL(e)}else U(null)})(e)}})}),(0,a.jsx)(o.FormFieldSelect,{name:"backgroundFit",label:(0,a.jsx)(F,{content:"backgroundFit"}),disabled:A,children:S.map(e=>(0,a.jsx)(o.SelectOption,{value:e,children:f.lmsg(e)},e))})]})]}):null]})]})},({viewer:{type:e}})=>({breadcrumbs:["ADMIN"===e?{title:d.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"}:{title:d.Locale.getSection("admin.controllers.navigation.index").lmsg("reseller-tools"),href:"/admin/reseller/tools"},{title:d.Locale.getSection("admin.controllers.settings-ui.branding").lmsg("title"),href:"/cp/settings-ui/branding"}],helpContext:"ADMIN"===e?"logo":"reseller.logo"}))},2605(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"EditBranding"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"EditBrandingInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"editBranding"},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:"query"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"login"}},{kind:"Field",name:{kind:"Name",value:"customTitle"}},{kind:"Field",name:{kind:"Name",value:"logo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isCustom"}},{kind:"Field",name:{kind:"Name",value:"image"}},{kind:"Field",name:{kind:"Name",value:"imageAlt"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"edition"}}]}},{kind:"Field",name:{kind:"Name",value:"branding"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"customTitle"}},{kind:"Field",name:{kind:"Name",value:"logo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"fake"}}]}},{kind:"Field",name:{kind:"Name",value:"customFavicon"}},{kind:"Field",name:{kind:"Name",value:"background"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"file"}},{kind:"Field",name:{kind:"Name",value:"color"}},{kind:"Field",name:{kind:"Name",value:"fit"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"}}]}}]}}],loc:{start:0,end:758}};n.loc.source={body:"mutation EditBranding($input: EditBrandingInput!) {\n    editBranding(input: $input) {\n        query {\n            viewer {\n                login\n                customTitle\n                logo {\n                    isCustom\n                    image\n                    imageAlt\n                    url\n                    edition\n                }\n                branding {\n                    customTitle\n                    logo {\n                        url\n                        fake\n                    }\n                    customFavicon\n                    background {\n                        file\n                        color\n                        fit\n                    }\n                }\n            }\n        }\n        warnings\n    }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);
1else 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 l(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.EditBranding=function(e,n){var i={kind:e.kind,definitions:[l(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var t=a[n]||new Set,o=new Set,d=new Set;for(t.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach(function(e){d.add(e)}))})}return o.forEach(function(n){var a=l(e,n);a&&i.definitions.push(a)}),i}(n,"EditBranding")},2604(e,n,i){"use strict";i.r(n)}}]);
2//# sourceMappingURL=BrandingPage.js.map?35d3477a8ea0d366655d

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.