PageSourceSearch

https://diariodecuba.net/cp/javascript/views/admin/notifications/index.js?18a83c672d77f6ebfb4e

js diariodecuba.net collected 2026-10-03 22:37:56 UTC 18,877 bytes, 2 lines download raw bytes

1(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/admin/notifications/index"],{2521(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>x});var t=i(396),a=i(787),o=i.n(a),l=i(861),s=i(810),d=i(397),c=i(95),r=i(1371),m=i(2522),u=i.n(m),f=i(2523),v=i.n(f);const k=c.Locale.getTranslate("components.notifications.drawer"),g=c.Locale.getTranslate("components.buttons"),p=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.FormField,{label:(0,t.jsx)(d.SkeletonText,{lines:1}),children:(0,t.jsx)(d.Skeleton,{height:28})}),(0,t.jsx)(d.FormField,{label:(0,t.jsx)(d.SkeletonText,{lines:1}),children:(0,t.jsx)(d.Skeleton,{height:170})})]}),S=({isOpen:e=!1,onClose:n,previewKey:i=null})=>{const[a,{data:o,loading:c}]=(0,l.useLazyQuery)(u(),{fetchPolicy:"network-only",variables:{code:i}}),[m]=(0,s.useMutation)(v()),[f,S]=(0,t.useState)({});(0,t.useEffect)(()=>{e&&i&&a({variables:{code:i}})},[i,e,a]);const x=(0,t.useMemo)(()=>o?.notification.emailSettings[0],[o]);(0,t.useEffect)(()=>{x&&S({subject:x.emailSubject,text:x.emailText})},[x]);const h=()=>{n()};return(0,t.jsx)(d.Drawer,{"data-type":"edit-notice-drawer",title:(0,t.jsx)(k,{content:"title"}),size:"md",onClose:h,isOpen:e,form:(0,t.jsx)(r.default,{mutation:m,values:f,applyButton:!1,additionalButtons:[(0,t.jsx)(d.Button,{onClick:()=>{S({subject:x.emailDefaultSubject,text:x.emailDefaultText})},children:(0,t.jsx)(k,{content:"resetButton"})},"reset-button")],onSubmit:e=>({...e,code:i}),onSuccess:h,submitButton:{children:(0,t.jsx)(g,{content:"save"}),"data-action":"submit"},cancelButton:{children:(0,t.jsx)(g,{content:"cancel"}),onClick:h},children:c?(0,t.jsx)(p,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.FormFieldText,{name:"subject",size:"fill",required:!0,label:(0,t.jsx)(k,{content:"subject"}),inputProps:{maxLength:"255"}}),(0,t.jsx)(d.FormFieldText,{name:"text",required:!0,multiline:!0,autoheight:!0,size:"fill",rows:8,label:(0,t.jsx)(k,{content:"text"}),inputProps:{maxLength:"65535"}})]})})})};S.propTypes={onClose:o().func.isRequired,isOpen:o().bool,previewKey:o().string};const x=S},2520(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>S});var t=i(396),a=i(810),o=i(739),l=i(715),s=i(397),d=i(1371),c=i(832),r=i(95),m=i(663),u=i(2521),f=i(2524),v=i.n(f),k=i(2525),g=i.n(k);const p=r.Locale.getTranslate("components.lists.notifications"),S=()=>{const e=(0,l.useNavigate)(),{data:n}=(0,o.useQuery)(v()),[i]=(0,a.useMutation)(g()),{config:{notification:{htmlEmail:r}},os:{isWindows:f},mode:{canManageCustomers:k,canManageResellers:S},notification:{expirationWarningTime:x,emailSettings:h}}=n,[N,j]=(0,t.useState)({}),[T,b]=(0,t.useState)({}),[F]=(0,t.useState)({notifications:h.reduce((e,{code:n,...i})=>(e[n]=i,e),{}),expirationWarningTime:x}),y=(0,t.useMemo)(()=>[{key:"event",title:(0,t.jsxs)(s.Columns,{children:[(0,t.jsx)(s.Column,{fill:!0,children:(0,t.jsx)(p,{content:"headerEvent"})}),(0,t.jsx)(s.Column,{children:(0,t.jsx)(p,{content:"headerSendTo"})})]}),type:"title",render:({code:e,title:n})=>n||(0,t.jsx)(p,{content:e})},{key:"sendToAdmin",title:(0,t.jsx)(p,{content:"headerAdmin"}),align:"center",render:({code:e,sendToAdmin:n})=>(0,t.jsx)(s.FormFieldCheckbox,{value:n,name:`notifications[${e}][sendToAdmin]`})},S&&{key:"sendToReseller",title:(0,t.jsx)(p,{content:"headerReseller"}),align:"center",render:({code:e,sendToReseller:n})=>e.startsWith("admin_")?null:(0,t.jsx)(s.FormFieldCheckbox,{value:n,name:`notifications[${e}][sendToReseller]`})},k&&{key:"sendToClient",title:(0,t.jsx)(p,{content:"headerClient"}),align:"center",render:({code:e,sendToClient:n})=>e.startsWith("admin_")||e.startsWith("reseller_")?null:(0,t.jsx)(s.FormFieldCheckbox,{value:n,name:`notifications[${e}][sendToClient]`})},{key:"email",title:(0,t.jsx)(p,{content:"headerEmailAddress"}),type:"controls",render:({code:e})=>(0,t.jsxs)(s.Columns,{children:[(0,t.jsx)(s.Column,{style:{marginTop:"5px"},children:(0,t.jsx)(s.FormFieldCheckbox,{name:`notifications[${e}][sendToEmail]`})}),(0,t.jsx)(s.Column,{children:(0,t.jsx)(s.FormField,{label:null,size:"md",name:`notifications[${e}][email]`,children:({getId:n,getName:i,getValue:a,setValue:o,getValues:l})=>(0,t.jsx)(s.Input,{id:n(),name:i(),value:a(),onChange:({target:e})=>o(e.value),disabled:!l().notifications[e].sendToEmail})})})]})},{key:"actions",type:"actions",render:({code:e})=>(0,t.jsxs)(s.ListActions,{children:[(0,t.jsx)(s.ListAction,{"data-action":`edit-notice-${e}`,primary:!0,icon:"pencil",onClick:()=>E({code:e}),children:(0,t.jsx)(p,{content:"editHint"})}
1),r?(0,t.jsx)(s.ListAction,{primary:!0,icon:"panel-eye",target:"_blank",component:c.default,to:`/admin/notifications/preview?code=${e}`,children:(0,t.jsx)(p,{content:"previewHint"})}):null]})}],[k,S,r]),E=({code:e})=>{j({isOpen:!0,previewKey:e})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d.default,{mutation:i,applyButton:!1,values:F,onFieldChange:(e,n)=>{b(i=>(0,s.setIn)(i,e,n))},onSubmit:()=>{if(T.notifications){const e=Object.entries(T.notifications).map(([e,n])=>({code:e,...n}));return{...T,notifications:e}}return T},cancelButton:{onClick:()=>e("/admin/server/tools/")},onSuccess:()=>{(0,m.addToast)({intent:"success",message:(0,t.jsx)(p,{content:"updated"})}),e("/admin/server/tools/")},children:[(0,t.jsx)(s.Section,{title:(0,t.jsx)(p,{content:"legendNotifications"}),children:(0,t.jsx)(s.List,{columns:y,data:h})}),(0,t.jsxs)(s.Section,{title:(0,t.jsx)(p,{content:"legendSettings"}),children:[(0,t.jsx)(s.FormField,{label:(0,t.jsx)(p,{content:"expirationTime"}),children:(0,t.jsxs)(s.Columns,{gap:"xs",children:[(0,t.jsx)(s.Column,{children:(0,t.jsx)(s.FormField,{"data-id":"expirationWarningTime",name:"expirationWarningTime",label:null,children:({getId:e,getName:n,getValue:i,setValue:a})=>(0,t.jsx)(s.Input,{min:0,defaultValue:10,type:"number",id:e(),name:n(),value:i(),onChange:({target:e})=>a(+e.value),size:null,style:{width:60,paddingRight:0}})})}),(0,t.jsx)(s.Column,{style:{alignSelf:"center"},children:(0,t.jsx)(p,{content:"days"})})]})}),f?(0,t.jsx)(p,{content:"smtpSettings",params:{link:(0,t.jsx)(c.default,{to:"/admin/mail-gate",children:(0,t.jsx)(p,{content:"smtpSettingsLink"})})}}):null]})]}),(0,t.jsx)(u.default,{...N,onClose:()=>{j({isOpen:!1})}})]})}},2519(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>c});var t=i(397),a=i(801),o=i(832),l=i(95),s=i(2520),d=i(396);const c=(0,a.withPageLayout)(e=>(0,d.jsxs)(t.Tabs,{children:[(0,d.jsx)(t.Tab,{title:l.Locale.getSection("admin.controllers.notifications.email-settings").lmsg("title"),component:o.default,to:"/cp/notifications/email-settings/",children:(0,d.jsx)(s.default,{...e})}),(0,d.jsx)(t.Tab,{title:l.Locale.getSection("admin.controllers.notifications.panel-settings").lmsg("title"),component:o.default,to:"/cp/notifications/panel-settings/"})]}))},2518(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>t.default});var t=i(2519)},2524(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"NotificationEmailSettings"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"os"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isWindows"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"config"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"htmlEmail"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"mode"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"canManageCustomers"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"canManageResellers"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"notification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expirationWarningTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailSettings"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToEmail"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToAdmin"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToReseller"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToClient"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:455}};n.loc.source={body:"query NotificationEmailSettings {\n    os {\n        isWindows\n    }\n    config {\n        notification {\n            htmlEmail\n        }\n    }\n    mode {\n        canManageCustomers\n        canManageResellers\n    }\n    notification {\n        expirationWarningTime\n        emailSettings {\n            title\n            code\n            email\n            sendToEmail\n            sendToAdmin\n            sendToReseller\n            sendToClient\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 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 a(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.NotificationEmailSettings=function(e,n){var i={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var o=t[n]||new Set,l=new Set,s=new Set;for(o.forEach(function(e){s.add(e)});s.size>0;){var d=s;s=new Set,d.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){s.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"NotificationEmailSettings")},2522(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"NotificationEmailSettingsNote"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"code"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emailSettings"},arguments:[{kind:"Argument",name:{kind:"Name",value:"code"},value:{kind:"Variable",name:{kind:"Name",value:"code"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailSubject"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailDefaultSubject"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailDefaultText"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:253}};n.loc.source={body:"query NotificationEmailSettingsNote($code: String!) {\n    notification {\n        emailSettings(code: $code) {\n            code\n            emailSubject\n            emailDefaultSubject\n            emailText\n            emailDefaultText\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 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 a(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.NotificationEmailSettingsNote=function(e,n){var i={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var o=t[n]||new Set,l=new Set,s=new Set;for(o.forEach(function(e){s.add(e)});s.size>0;){var d=s;s=new Set,d.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){s.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"NotificationEmailSettingsNote")},2525(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateNotificationEmailSettings"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateNotificationEmailSettingsInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateNotificationEmailSettings"},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:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expirationWarningTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailSettings"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToEmail"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToAdmin"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToReseller"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sendToClient"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:516}};n.loc.source={body:"mutation UpdateNotificationEmailSettings($input
1: UpdateNotificationEmailSettingsInput! ) {\n    updateNotificationEmailSettings(input: $input) {\n        query {\n            notification {\n                expirationWarningTime\n                emailSettings {\n                    title\n                    code\n                    email\n                    sendToEmail\n                    sendToAdmin\n                    sendToReseller\n                    sendToClient\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 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 a(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.UpdateNotificationEmailSettings=function(e,n){var i={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var o=t[n]||new Set,l=new Set,s=new Set;for(o.forEach(function(e){s.add(e)});s.size>0;){var d=s;s=new Set,d.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){s.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"UpdateNotificationEmailSettings")},2523(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateNotificationText"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateNotificationTextInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateNotificationText"},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:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailSubject"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailDefaultSubject"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"emailDefaultText"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:230}};n.loc.source={body:"mutation UpdateNotificationText($input: UpdateNotificationTextInput! ) {\n    updateNotificationText(input: $input) {\n        code\n        emailSubject\n        emailDefaultSubject\n        emailText\n        emailDefaultText\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 a(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.UpdateNotificationText=function(e,n){var i={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var o=t[n]||new Set,l=new Set,s=new Set;for(o.forEach(function(e){s.add(e)});s.size>0;){var d=s;s=new Set,d.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){s.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"UpdateNotificationText")}}]);
2//# sourceMappingURL=index.js.map?18a83c672d77f6ebfb4e

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.