"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6618],{25270:(g,l,e)=>{e.r(l),e.d(l,{default:()=>O});var t=e(27702),o=e(26811),i=e(73289),a=e(66670),E=e(64022),s=e(66970),c=e(44644),r=e(66574),m=e(48105),d=e(43620);const O=()=>{const M=(0,m.q)("channels"),[P,T]=(0,t.useState)([]),C=async()=>await(0,i.i)().get("/api/alert-notifications"),[D,h]=(0,o.Z)(C);(0,t.useEffect)(()=>{h().then(n=>{T(n)})},[h]);const v=n=>{r.h$.publish(new d.VJ({title:"Delete",text:"Do you want to delete this notification channel?",text2:"Deleting this notification channel will not delete from alerts any references to it",icon:"trash-alt",confirmText:"Delete",yesText:"Delete",onConfirm:async()=>{L(n)}}))},L=async n=>{await(0,i.i)().delete(`/api/alert-notifications/${n}`);const _=await h();T(_)};return t.createElement(c.T,{navModel:M},t.createElement(c.T.Contents,null,D.error&&t.createElement("p",null,D.error.message),!!P.length&&t.createElement(t.Fragment,null,t.createElement("div",{className:"page-action-bar"},t.createElement("div",{className:"page-action-bar__spacer"}),t.createElement(a.Qj,{icon:"channel-add",href:"alerting/notification/new"},"New channel")),t.createElement("table",{className:"filter-table filter-table--hover"},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",{style:{minWidth:"200px"}},t.createElement("strong",null,"Name")),t.createElement("th",{style:{minWidth:"100px"}},"Type"),t.createElement("th",{style:{width:"1%"}}))),t.createElement("tbody",null,P.map(n=>t.createElement("tr",{key:n.id},t.createElement("td",{className:"link-td"},t.createElement("a",{href:`alerting/notification/${n.id}/edit`},n.name)),t.createElement("td",{className:"link-td"},t.createElement("a",{href:`alerting/notification/${n.id}/edit`},n.type)),t.createElement("td",{className:"text-right"},t.createElement(E.Lh,{justify:"flex-end"},n.isDefault&&t.createElement(a.zx,{disabled:!0,variant:"secondary",size:"sm"},"default"),t.createElement(a.zx,{variant:"destructive",icon:"times",size:"sm",onClick:()=>{v(n.id)}})))))))),!(P.length||D.loading)&&t.createElement(s.Z,{title:"There are no notification channels defined yet",buttonIcon:"channel-add",buttonLink:"alerting/notification/new",buttonTitle:"Add channel",proTip:"You can include images in your alert notifications.",proTipLink:"http://docs.grafana.org/alerting/notifications/",proTipLinkTitle:"Learn more",proTipTarget:"_blank"})))}},34913:(g,l,e)=>{e.r(l),e.d(l,{default:()=>d});var t=e(27702),o=e(91078),i=e(37647),a=e(9031),E=e(81324),s=e(30888);const c=(0,a.Q)(()=>Promise.all([e.e(1109),e.e(562),e.e(7978)]).then(e.bind(e,17978))),r=(0,a.Q)(()=>e.e(146).then(e.bind(e,10146))),m=f=>t.createElement(E.O,{pageId:"receivers",accessType:"notification"},t.createElement(o.WZ,{feature:s.v.ContactPointsV2},t.createElement(r,{...f})),t.createElement(o.kC,{feature:s.v.ContactPointsV2},t.createElement(c,{...f}))),d=(0,i.Pf)(m,{style:"page"})}}]);

//# sourceMappingURL=NotificationsListPage.4a4e09990bddf54ce860.js.map