PageSourceSearch

https://snazzi.com/cp/javascript/views/admin/notifications/index.js?48e830128c4b96917fbf

js snazzi.com collected 2026-10-07 00:43:47 UTC 17,725 bytes, 2 lines download raw bytes

1(globalThis.webpackChunkPlesk||=[]).push([["views/admin/notifications/index"],{2595(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>h});var t=i(341),a=i(782),o=i.n(a),l=i(941),d=i(811),s=i(342),r=i(95),c=i(798),m=i(2596),u=i.n(m),f=i(2597),k=i.n(f);const v=r.Locale.getTranslate("components.notifications.drawer"),p=r.Locale.getTranslate("components.buttons"),S=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.FormField,{label:(0,t.jsx)(s.SkeletonText,{lines:1}),children:(0,t.jsx)(s.Skeleton,{height:28})}),(0,t.jsx)(s.FormField,{label:(0,t.jsx)(s.SkeletonText,{lines:1}),children:(0,t.jsx)(s.Skeleton,{height:170})})]}),x=({isOpen:e=!1,onClose:n,previewKey:i=null})=>{const[a,{data:o,loading:r}]=(0,l.useLazyQuery)(u(),{fetchPolicy:"network-only"}),[m]=(0,d.useMutation)(k()),[f,x]=(0,t.useState)({});(0,t.useEffect)(()=>{e&&i&&a({variables:{code:i}})},[i,e,a]);const h=(0,t.useMemo)(()=>o?.notification.emailSettings[0],[o]);(0,t.useEffect)(()=>{h&&x({subject:h.emailSubject,text:h.emailText})},[h]);const g=()=>{n()};return(0,t.jsx)(s.Drawer,{"data-type":"edit-notice-drawer",title:(0,t.jsx)(v,{content:"title"}),size:"md",onClose:g,isOpen:e,form:(0,t.jsx)(c.default,{mutation:m,values:f,applyButton:!1,additionalButtons:[(0,t.jsx)(s.Button,{onClick:()=>{x({subject:h.emailDefaultSubject,text:h.emailDefaultText})},children:(0,t.jsx)(v,{content:"resetButton"})},"reset-button")],onSubmit:e=>({...e,code:i}),onSuccess:g,submitButton:{children:(0,t.jsx)(p,{content:"save"}),"data-action":"submit"},cancelButton:{children:(0,t.jsx)(p,{content:"cancel"}),onClick:g},children:r?(0,t.jsx)(S,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.FormFieldText,{name:"subject",size:"fill",required:!0,label:(0,t.jsx)(v,{content:"subject"}),inputProps:{maxLength:"255"}}),(0,t.jsx)(s.FormFieldText,{name:"text",required:!0,multiline:!0,autoheight:!0,size:"fill",rows:8,label:(0,t.jsx)(v,{content:"text"}),inputProps:{maxLength:"65535"}})]})})})};x.propTypes={onClose:o().func.isRequired,isOpen:o().bool,previewKey:o().string};const h=x},2594(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>x});var t=i(341),a=i(811),o=i(785),l=i(772),d=i(342),s=i(798),r=i(797),c=i(95),m=i(718),u=i(2595),f=i(2598),k=i.n(f),v=i(2599),p=i.n(v);const S=c.Locale.getTranslate("components.lists.notifications"),x=()=>{const e=(0,l.useNavigate)(),{data:n}=(0,o.useQuery)(k()),[i]=(0,a.useMutation)(p()),{config:{notification:{htmlEmail:c}},os:{isWindows:f},mode:{canManageCustomers:v,canManageResellers:x},notification:{expirationWarningTime:h,emailSettings:g}}=n,[N,j]=(0,t.useState)({}),[T,b]=(0,t.useState)({}),[F]=(0,t.useState)({notifications:g.reduce((e,{code:n,...i})=>(e[n]=i,e),{}),expirationWarningTime:h}),y=(0,t.useMemo)(()=>[{key:"event",title:(0,t.jsxs)(d.Columns,{children:[(0,t.jsx)(d.Column,{fill:!0,children:(0,t.jsx)(S,{content:"headerEvent"})}),(0,t.jsx)(d.Column,{children:(0,t.jsx)(S,{content:"headerSendTo"})})]}),type:"title",render:({code:e,title:n})=>n||(0,t.jsx)(S,{content:e})},{key:"sendToAdmin",title:(0,t.jsx)(S,{content:"headerAdmin"}),align:"center",render:({code:e,sendToAdmin:n})=>(0,t.jsx)(d.FormFieldCheckbox,{value:n,name:`notifications[${e}][sendToAdmin]`})},x&&{key:"sendToReseller",title:(0,t.jsx)(S,{content:"headerReseller"}),align:"center",render:({code:e,sendToReseller:n})=>e.startsWith("admin_")?null:(0,t.jsx)(d.FormFieldCheckbox,{value:n,name:`notifications[${e}][sendToReseller]`})},v&&{key:"sendToClient",title:(0,t.jsx)(S,{content:"headerClient"}),align:"center",render:({code:e,sendToClient:n})=>e.startsWith("admin_")||e.startsWith("reseller_")?null:(0,t.jsx)(d.FormFieldCheckbox,{value:n,name:`notifications[${e}][sendToClient]`})},{key:"email",title:(0,t.jsx)(S,{content:"headerEmailAddress"}),type:"controls",render:({code:e})=>(0,t.jsxs)(d.Columns,{children:[(0,t.jsx)(d.Column,{style:{marginTop:"5px"},children:(0,t.jsx)(d.FormFieldCheckbox,{name:`notifications[${e}][sendToEmail]`})}),(0,t.jsx)(d.Column,{children:(0,t.jsx)(d.FormField,{label:null,size:"md",name:`notifications[${e}][email]`,children:({getId:n,getName:i,getValue:a,setValue:o,getValues:l})=>(0,t.jsx)(d.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)(d.ListActions,{children:[(0,t.jsx)(d.ListAction,{"data-action":`edit-notice-${e}`,primary:!0,icon:"pencil",onClick:()=>E({code:e}),children:(0,t.jsx)(S,{content:"editHint"})}),c?(0,t.jsx)(d.ListAction,{primary:!0,icon:"panel-eye",target:"_blank",component:r.default,to:`/admin/notifications/preview?code=${e}`,children:(0,t.jsx)(S,{content:"previewHint"})}):null]})}],[v,x,c]),E=({code:e})=>{j({isOpen:!0,previewKey:e})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.default,{mutation:i,applyButton:!1,values:F,onFieldChange:(e,n)=>{b(i=>(0,d.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)(S,{content:"updated"})}),e("/admin/server/tools/")},children:[(0,t.jsx)(d.Section,{title:(0,t.jsx)(S,{content:"legendNotifications"}),children:(0,t.jsx)(d.List,{columns:y,data:g,rowKey:"code"})}),(0,t.jsxs)(d.Section,{title:(0,t.jsx)(S,{content:"legendSettings"}),children:[(0,t.jsx)(d.FormField,{label:(0,t.jsx)(S,{content:"expirationTime"}),children:(0,t.jsxs)(d.Columns,{gap:"xs",children:[(0,t.jsx)(d.
1Column,{children:(0,t.jsx)(d.FormField,{"data-id":"expirationWarningTime",name:"expirationWarningTime",label:null,children:({getId:e,getName:n,getValue:i,setValue:a})=>(0,t.jsx)(d.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)(d.Column,{style:{alignSelf:"center"},children:(0,t.jsx)(S,{content:"days"})})]})}),f?(0,t.jsx)(S,{content:"smtpSettings",params:{link:(0,t.jsx)(r.default,{to:"/admin/mail-gate",children:(0,t.jsx)(S,{content:"smtpSettingsLink"})})}}):null]})]}),(0,t.jsx)(u.default,{...N,onClose:()=>{j({isOpen:!1})}})]})}},2593(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>r});var t=i(342),a=i(909),o=i(797),l=i(95),d=i(2594),s=i(341);const r=(0,a.withPageLayout)(e=>(0,s.jsxs)(t.Tabs,{children:[(0,s.jsx)(t.Tab,{title:l.Locale.getSection("admin.controllers.notifications.email-settings").lmsg("title"),component:o.default,to:"/cp/notifications/email-settings/",children:(0,s.jsx)(d.default,{...e})}),(0,s.jsx)(t.Tab,{title:l.Locale.getSection("admin.controllers.notifications.panel-settings").lmsg("title"),component:o.default,to:"/cp/notifications/panel-settings/"})]}))},2592(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>t.default});var t=i(2593)},2598(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"NotificationEmailSettings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"os"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isWindows"}}]}},{kind:"Field",name:{kind:"Name",value:"config"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"htmlEmail"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"mode"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"canManageCustomers"}},{kind:"Field",name:{kind:"Name",value:"canManageResellers"}}]}},{kind:"Field",name:{kind:"Name",value:"notification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expirationWarningTime"}},{kind:"Field",name:{kind:"Name",value:"emailSettings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"sendToEmail"}},{kind:"Field",name:{kind:"Name",value:"sendToAdmin"}},{kind:"Field",name:{kind:"Name",value:"sendToReseller"}},{kind:"Field",name:{kind:"Name",value:"sendToClient"}}]}}]}}]}}],loc:{start:0,end:480}};n.loc.source={body:"query NotificationEmailSettings {\r\n    os {\r\n        isWindows\r\n    }\r\n    config {\r\n        notification {\r\n            htmlEmail\r\n        }\r\n    }\r\n    mode {\r\n        canManageCustomers\r\n        canManageResellers\r\n    }\r\n    notification {\r\n        expirationWarningTime\r\n        emailSettings {\r\n            title\r\n            code\r\n            email\r\n            sendToEmail\r\n            sendToAdmin\r\n            sendToReseller\r\n            sendToClient\r\n        }\r\n    }\r\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.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,d=new Set;
1for(o.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){d.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"NotificationEmailSettings")},2596(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"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notification"},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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"emailSubject"}},{kind:"Field",name:{kind:"Name",value:"emailDefaultSubject"}},{kind:"Field",name:{kind:"Name",value:"emailText"}},{kind:"Field",name:{kind:"Name",value:"emailDefaultText"}}]}}]}}]}}],loc:{start:0,end:264}};n.loc.source={body:"query NotificationEmailSettingsNote($code: String!) {\r\n    notification {\r\n        emailSettings(code: $code) {\r\n            code\r\n            emailSubject\r\n            emailDefaultSubject\r\n            emailText\r\n            emailDefaultText\r\n        }\r\n    }\r\n}\r\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,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){d.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"NotificationEmailSettingsNote")},2599(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"}}}}],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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expirationWarningTime"}},{kind:"Field",name:{kind:"Name",value:"emailSettings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"sendToEmail"}},{kind:"Field",name:{kind:"Name",value:"sendToAdmin"}},{kind:"Field",name:{kind:"Name",value:"sendToReseller"}},{kind:"Field",name:{kind:"Name",value:"sendToClient"}}]}}]}}]}}]}}]}}],loc:{start:0,end:534}};n.loc.source={body:"mutation UpdateNotificationEmailSettings($input
1: UpdateNotificationEmailSettingsInput! ) {\r\n    updateNotificationEmailSettings(input: $input) {\r\n        query {\r\n            notification {\r\n                expirationWarningTime\r\n                emailSettings {\r\n                    title\r\n                    code\r\n                    email\r\n                    sendToEmail\r\n                    sendToAdmin\r\n                    sendToReseller\r\n                    sendToClient\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\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,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){d.add(e)}))})}return l.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"UpdateNotificationEmailSettings")},2597(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"}}}}],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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"emailSubject"}},{kind:"Field",name:{kind:"Name",value:"emailDefaultSubject"}},{kind:"Field",name:{kind:"Name",value:"emailText"}},{kind:"Field",name:{kind:"Name",value:"emailDefaultText"}}]}}]}}],loc:{start:0,end:239}};n.loc.source={body:"mutation UpdateNotificationText($input: UpdateNotificationTextInput! ) {\r\n    updateNotificationText(input: $input) {\r\n        code\r\n        emailSubject\r\n        emailDefaultSubject\r\n        emailText\r\n        emailDefaultText\r\n    }\r\n}\r\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,d=new Set;for(o.forEach(function(e){d.add(e)});d.size>0;){var s=d;d=new Set,s.forEach(function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach(function(e){d.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?48e830128c4b96917fbf

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.