Files
server/opt/psa/admin/cp/public/javascript/components/common/ServerMailAntivirusPromo.js
cutemeli 0bfc6c8425 Initial
2025-12-22 10:32:59 +00:00

2 lines
5.3 KiB
JavaScript

(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["components/common/ServerMailAntivirusPromo"],{3135:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>t.default});var t=i(3136)},3136:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>p});var t=i(668),s=i.n(t),r=i(620),o=i(297),a=i(90),l=i(718),c=(i(3137),i(3138)),d=i.n(c),m=i(296);const u=a.Locale.getSection("components.common.ServerMailAntivirusPromo"),v=a.Locale.getTranslate("components.common.ServerMailAntivirusPromo"),f=a.Locale.getTranslate("admin.controllers.server.tools"),h=({isAnchor:e,to:n,children:i})=>e?(0,m.jsx)("a",{href:n,children:i}):(0,m.jsx)(l.default,{to:n,children:i});h.propTypes={isAnchor:s().bool.isRequired,to:s().string.isRequired,children:s().node.isRequired};const k="premium-av",g=({isOnDomainEmailPage:e=!1})=>{const{data:n,loading:i,error:t}=(0,r.useQuery)(d());if(i)return(0,m.jsx)(o.Skeleton,{height:100});if(t)return(0,m.jsx)(o.StatusMessage,{intent:"danger",children:t.message});const{serverMail:{availableAntivirusExtensions:s},os:{isWindows:l}}=n;if(!s.length)return(0,m.jsx)(o.Status,{icon:{size:"24"},intent:"info",children:(0,m.jsx)(v,{content:"noAntivirus"})});const c=s.filter(({isInstalled:e})=>e);if(!c.length)return(0,m.jsxs)(o.Status,{icon:{size:"24"},intent:"info",children:[(0,m.jsx)(v,{content:"noAntivirus"})," ",(0,m.jsx)(v,{content:"warning"}),(0,m.jsx)("br",{}),(0,m.jsx)(v,{content:"promoDescription"}),(0,m.jsx)("ul",{className:"server-mail-antivirus-promo__list",children:s.map(({name:e,isRecommended:n,catalogUrl:i})=>(0,m.jsx)("li",{children:(0,m.jsxs)("a",{href:i,children:[e,n&&` ${u.lmsg("recommended")}`]})},e))})]});const g=c.find(({code:e})=>e===k)||c[0],p=[{key:"purchase",instruction:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(v,{content:"toEnable"})," ",(0,m.jsx)("a",{href:g.catalogUrl,"data-action":"ServerMailAVPromoPurchase",children:(0,m.jsx)(v,{content:"purchase"})})]}),show:g.code!==k},{key:"enableAVComponent",instruction:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(v,{content:"enableAt"})," ",(0,m.jsx)(h,{to:"/cp/server/components",isAnchor:e,children:(0,m.jsx)(f,{content:"serverComponents"})})]}),show:l},{key:"enableServerMailAV",instruction:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(v,{content:"enableAt"})," ",(0,m.jsx)(h,{to:"/cp/server/mail/antivirus",isAnchor:e,children:a.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title")})]}),show:!l&&e}].filter(({show:e=!0})=>e);return(0,m.jsxs)(o.Status,{icon:{size:"24"},intent:"info",children:[(0,m.jsx)(v,{content:"needActivation",params:{name:g.name}})," ",1===p.length?p[0].instruction:(0,m.jsx)("ul",{className:"server-mail-antivirus-promo__list",children:p.map(({key:e,instruction:n})=>(0,m.jsx)("li",{children:n},e))})]})};g.propTypes={isOnDomainEmailPage:s().bool};const p=g},3137:(e,n,i)=>{"use strict";i.r(n)},3138:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ServerMailAntivirusPromo"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"serverMail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"availableAntivirusExtensions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isInstalled"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isRecommended"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"catalogUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"os"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isWindows"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:247}};n.loc.source={body:"query ServerMailAntivirusPromo {\n serverMail {\n availableAntivirusExtensions {\n name\n isInstalled\n isRecommended\n catalogUrl\n code\n }\n }\n os {\n isWindows\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 t=e.type;"NamedType"===t.kind&&n.add(t.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 t={};function s(e,n){for(var i=0;i<e.definitions.length;i++){var t=e.definitions[i];if(t.name&&t.name.value==n)return t}}n.definitions.forEach(function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}}),e.exports=n,e.exports.ServerMailAntivirusPromo=function(e,n){var i={kind:e.kind,definitions:[s(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var r=t[n]||new Set,o=new Set,a=new Set;for(r.forEach(function(e){a.add(e)});a.size>0;){var l=a;a=new Set,l.forEach(function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach(function(e){a.add(e)}))})}return o.forEach(function(n){var t=s(e,n);t&&i.definitions.push(t)}),i}(n,"ServerMailAntivirusPromo")}}]);
//# sourceMappingURL=ServerMailAntivirusPromo.js.map?f6f846e17dd8688efd44