PageSourceSearch

https://acscontrol.com/cp/javascript/components/pages/PanelNotificationsSettings.js?f8145306fdbb792ccfc8

js acscontrol.com collected 2026-10-06 05:29:27 UTC 8,872 bytes, 33 lines download raw bytes

1"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/PanelNotificationsSettings"],{1063:(e,t,n)=>{n.r(t),n.d(t,{SORT_ASC:()=>d,SORT_DESC:()=>g,default:()=>h});var o=n(242),i=n(244),a=n.n(i),s=n(243),r=n(90);const l=r.Locale.getTranslate("components.list"),c=r.Locale.getSection("components.list"),d="ASC",g="DESC",m="all",p={set(e,t){localStorage.setItem(e,JSON.stringify(t))},get(e){const t=localStorage.getItem(e);return JSON.parse(t)}},u=e=>`list-sort_${e}`,f=e=>`list-page_${e}`,P=({id:e,data:t,columns:n,itemsPerPage:i,itemsPerPageOptions:a,sortColumn:r,sortDirection:g,searchField:P,locale:h,emptyView:y,emptyFilteredView:S,toolbar:x,selection:b,onSelectionChange:j,searchBarInputProps:T,rowKey:C,...w})=>{const{sortColumn:v,sortDirection:D,setSortState:F}=((e,{sortColumn:t,sortDirection:n})=>{const[{sortColumn:i,sortDirection:a},s]=(0,o.useState)({sortColumn:p.get(u(e))?.sortColumn??t,sortDirection:p.get(u(e))?.sortDirection??n});return{sortColumn:i,sortDirection:a,setSortState:t=>{s((e=>({...e,...t}))),p.set(u(e),{...p.get(u(e)),...t})}}})(e,{sortColumn:r??n.find((({sortable:e})=>e))?.key,sortDirection:g}),{page:L,itemsPerPage:k,searchPattern:N,setPageState:V}=((e,{itemsPerPage:t})=>{const[{page:n,itemsPerPage:i,searchPattern:a},s]=(0,o.useState)({page:p.get(f(e))?.page??1,itemsPerPage:p.get(f(e))?.itemsPerPage??t,searchPattern:p.get(f(e))?.searchPattern??""});return{page:n,itemsPerPage:i,searchPattern:a,setPageState:t=>{s((e=>({...e,...t}))),p.set(f(e),{...p.get(f(e)),...t})}}})(e,{itemsPerPage:a.includes(i)?i:a[0]}),M=(0,o.useMemo)((()=>N?S??(0,o.jsx)(s.ListEmptyView,{reason:"filtered",title:(0,o.jsx)(l,{content:"emptyViewFilteredTitle"}),description:(0,o.jsx)(l,{content:"emptyViewFilteredDescription"})}):y??(0,o.jsx)(s.ListEmptyView,{title:(0,o.jsx)(l,{content:"emptyViewTitle"})})),[N,y,S]),O=(0,o.useMemo)((()=>P?t.filter((e=>(Array.isArray(P)?P:[P]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(N.toLowerCase()))))):t),[t,N,P]),R=(0,o.useMemo)((()=>{if(!v)return O;const e=n.find((({key:e})=>e===v))?.sortDataField??v,t=n.find((({key:e})=>e===v))?.sort??((t,n)=>t[e]<n[e]?-1:t[e]>n[e]?1:0);return[...O].sort(((e,n)=>d===D?t(e,n):t(n,e)))}),[O,v,D,n]),q=(0,o.useMemo)((()=>{if(k===m)return R;const e=k*(L-1),t=e+k;return R.slice(e,t)}),[L,R,k]),A=(0,o.useCallback)((e=>{V({searchPattern:e}),e!==N&&V({page:1})}),[N]),I=(0,o.useCallback)((e=>{V({itemsPerPage:e});(e===m?1:Math.ceil(O.length/e))<L&&V({page:1})}),[O.length,L]);return(0,o.useEffect)((()=>{if("function"==typeof j&&b.length){const e=O.map((e=>{return t=e,"function"==typeof(n=C)?n(t):t[n];var t,n})).filter((e=>b.includes(e)));j(e)}}),[O]),(0,o.jsx)(s.List,{pagination:(0,o.jsx)(s.Pagination,{current:L,total:k===m?1:Math.ceil(O.length/k),onSelect:e=>V({page:e}),itemsPerPage:k,itemsPerPageOptions:a,onItemsPerPageChange:I}),toolbar:(x||P)&&(0,o.jsxs)(s.Toolbar,{children:[x,P&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.ToolbarExpander,{}),(0,o.jsx)(s.ToolbarGroup,{title:"",children:(0,o.jsx)(s.SearchBar,{inputProps:{placeholder:c.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",value:N,...T??{}},onTyping:A})})]})]}),totalRows:O.length,sortColumn:v,sortDirection:D,onSortChange:F,columns:n,data:q,filtered:!!N,locale:{totalRows:({totalRows:e})=>c.formatMessage("recordsTotal",{total:e}),...h},emptyView:M,onSelectionChange:j,selection:b,rowKey:C,...w})};P.propTypes={id:a().string.isRequired,data:a().array.isRequired,columns:a().array.isRequired,itemsPerPage:a().number,itemsPerPageOptions:a().array,sortColumn:a().string,sortDirection:a().string,searchField:a().oneOfType([a().string,a().arrayOf(a().string.isRequired)]),locale:a().object,emptyView:a().node,emptyFilteredView:a().node,toolbar:a().node,onSelectionChange:a().func,selection:a().array,rowKey:a().oneOfType([a().string,a().func]),searchBarInputProps:a().object},P.defaultProps={itemsPerPage:25,itemsPerPageOptions:[10,25,100,m],sortColumn:void 0,sortDirection:d,searchField:void 0,locale:{},emptyView:void 0,emptyFilteredView:void 0,toolbar:void 0,onSelectionChange:void 0,selection:[],searchBarInputProps:void 0,rowKey:"key"};const h=P}
1,1828:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c,withNotificationTabs:()=>l});var o=n(243),i=n(90),a=n(775),s=n(242);const r=()=>(0,s.jsxs)(o.Tabs,{active:2,children:[(0,s.jsx)(o.Tab,{title:i.Locale.getSection("admin.controllers.notifications.email-settings").lmsg("title"),component:a.default,to:"/admin/notifications/email-settings/"}),(0,s.jsx)(o.Tab,{title:i.Locale.getSection("admin.controllers.notifications.panel-settings").lmsg("title"),component:a.default,to:"/admin/notifications/panel-settings/"})]}),l=e=>{const t=t=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r,{}),(0,s.jsx)(e,{...t})]});return t.displayName=`withNotificationTabs(${e.displayName||e.name||"Component"})`,t.WrappedComponent=e,t},c=l},1827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>T});var o=n(739),i=n(90),a=n(290),s=n(1063),r=n(243),l=n(927),c=n(1828),d=n(242),g=n(455),m=n(762),p=n(775),u=n(244),f=n(728),P=n(679);const h=i.Locale.getTranslate("admin.controllers.notifications.panel-notifications-toggle"),y=i.Locale.getTranslate("admin.controllers.notifications.template-settings-list"),S=i.Locale.getTranslate("admin.controllers.notifications.template-settings-form"),x=g.gql`
2    mutation UpdatePanelNotificationTemplate($input: UpdateNotificationPanelTemplateInput!){
3        updateNotificationPanelTemplate (input: $input){
4            query {
5                notification {
6                    panel {
7                        templates {
8                            code
9                            context
10                            title
11                            sendToAdmin
12                        }
13                    }
14                }
15            }
16        }
17    }
18`,b=g.gql`
19    mutation updateNotificationPanelSettingsStoragePeriod ($input: UpdateNotificationPanelSettingsInput!) {
20        updateNotificationPanelSettings (input: $input) {
21            query {
22                notification {
23                    panel {
24                        settings {
25                            storagePeriod
26                        }
27                    }
28                }
29            }
30        }
31    }
32`,j=({notification:e})=>{const{panel:{settings:{storagePeriod:t},templates:n}}=e,[o]=(0,d.useState)({storagePeriod:t}),[i]=(0,m.useMutation)(x),[a]=(0,m.useMutation)(b),[c,g]=(0,d.useState)(n.map((e=>({...e,loading:!1})))),u=(0,f.useNavigate)(),j="/admin/server/tools",T=(e,t)=>{g((n=>n.map((n=>(n.code===e&&(n={...n,...t}),n)))))};return(0,d.jsxs)(l.default,{applyButton:!1,values:o,mutation:a,onSuccess:()=>{u(j)},cancelButton:{component:p.default,to:j},children:[(0,d.jsx)(y,{content:"hint"}),(0,d.jsx)(s.default,{id:"notifications-list",data:c,columns:[{key:"title",sortable:!0,title:(0,d.jsx)(y,{content:"name"})},{key:"context",sortable:!0,title:(0,d.jsx)(y,{content:"context"})},{key:"sendToAdmin",title:(0,d.jsx)(y,{content:"sendToAdmin"}),align:"right",render:({sendToAdmin:e,code:t,loading:n,title:o})=>(0,d.jsx)(r.Switch,{checked:e,onChange:e=>(async(e,t,n)=>{T(e,{loading:!0});try{await i({variables:{input:{code:e,sendToAdmin:n}}}),n?(0,P.addToast)({intent:"success",message:(0,d.jsx)(h,{content:"successfullyEnabled",params:{title:t}})}):(0,P.addToast)({intent:"success",message:(0,d.jsx)(h,{content:"successfullyDisabled",params:{title:t}})}),T(e,{sendToAdmin:n})}catch({message:e}){(0,P.addToast)({intent:"danger",message:e})}finally{T(e,{loading:!1})}})(t,o,e),loading:n},t)}],searchField:["title","context"]}),(0,d.jsx)(r.Section,{children:(0,d.jsx)(r.FormField,{name:"storagePeriod",label:(0,d.jsx)(S,{content:"storagePeriod"}),required:!0,children:({getValue:e,setValue:t,isDisabled:n})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r.InputNumber,{value:e(),min:1,max:360,onChange:t,disabled:n()})," ",(0,d.jsx)(S,{content:"days"})]})})})]})};j.propTypes={notification:u.PropTypes.object.isRequired};const T=(0,o.withPageLayout)((0,c.withNotificationTabs)(j),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:n}=(0,a.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail"}},pageSidebar:n,pageContentHeader:{breadcrumbs:[n.isPowerUserPanel?null:{title:i.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.notifications.index").lmsg("title"),href:"/admin/notifications"},{title:i.Locale.getSection("admin.controllers.notifications.panel-settings").lmsg("title"),href:"/cp/notifications/panel-settings"}
32].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1826:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o.default});var o=n(1827)}}]);
33//# sourceMappingURL=PanelNotificationsSettings.js.map?f8145306fdbb792ccfc8

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.