web-interface.assets.bb8c8232-6119.23231fc83bcf991086a5.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-6119"],{uCppV7l0:(_,A,o)=>{o.d(A,{A:()=>I});var e=o("pmX897Fv"),l=o.n(e),a=o("DjJvgDaP"),h=o.n(a),g=h()(l());g.push([_.id,`.xZzz7avfOImN5wyTQXue dl dl {
padding-left: 10px;
margin-bottom: 5px;
}
`,"",{version:3,sources:["webpack://./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css"],names:[],mappings:"AAAA;IACI,kBAAkB;IAClB,kBAAkB;AACtB",sourcesContent:[`:local(.eventSummary) dl dl {
padding-left: 10px;
margin-bottom: 5px;
}
`],sourceRoot:""}]),g.locals={eventSummary:"xZzz7avfOImN5wyTQXue"};const I=g},wrndsiBg:(_,A,o)=>{o.d(A,{nt:()=>Y,G8:()=>B});var e=o("Z7aTuO5B"),l=o("J6y4/h8P"),a=o("IOI9nV80"),h=o("zKLlqmvB"),g=o("rIl5IEuP");const I=l.default.div`
position: fixed;
display: flex;
flex-direction: column;
align-items: center;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1051;
background-color: rgba(0, 0, 0, 0.5);
`,M=l.default.div`
position: relative;
display: flex;
flex-direction: column;
width: 600px;
height: 65vh;
top: 10vh;
padding: 16px;
background-color: ${({theme:t})=>t.colors.global.contentBackground};
border: 1px solid ${({theme:t})=>t.colors.input.border};
border-radius: 8px;
`,$=(0,l.default)(a.In)`
margin-left: auto;
cursor: pointer;
color: ${({theme:t})=>t.colors.input.placeholder};
&:hover {
color: ${({theme:t})=>t.colors.global.textDefault};
}
`,W=l.default.div`
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: stretch;
gap: 1rem;
editor-body {
flex-grow: 1;
}
`;function R({value:t,show:r,onClose:y}){const[x,p]=e.useState(0);e.useEffect(()=>{var m;const s=(m=document.getElementById("preview-body"))==null?void 0:m.scrollHeight;p(s)},[r]);const f=e.useMemo(()=>r?e.createElement(I,{onClick:()=>y()},e.createElement(M,{onClick:m=>m.stopPropagation()},e.createElement(W,null,e.createElement("h2",{style:{marginBottom:"1rem"}},"Markdown Preview"),e.createElement($,{name:"close",onClick:()=>y()})),e.createElement(B,{value:t,height:x,show:!0}),e.createElement(W,{style:{justifyContent:"flex-end",marginTop:"1rem"}},e.createElement(g.Button,{bsStyle:"success",role:"button",onClick:()=>y()},"Close")))):null,[r,t,x,y]);return e.createElement(e.Fragment,null,h.createPortal(f,document.body))}const v=R,c=l.default.div`
position: relative;
padding: 8px 0;
background-color: ${({theme:t,$noBackground:r})=>r?"transparent":t.colors.global.contentBackground};
${({$noBorder:t})=>!t&&(0,l.css)`border: 1px solid ${({theme:r})=>r.colors.input.border};`}
border-radius: 4px;
flex-grow: 1;
overflow: hidden;
height: ${({$height:t})=>t?`${t}px`:"auto"};
min-height: 100px;
`,F=(0,l.default)(a.In)`
position: absolute;
bottom: 0;
right: 0;
padding: 8px 16px;
cursor: pointer;
color: ${({theme:t})=>t.colors.input.placeholder};
z-index: 10;
&:hover {
color: ${({theme:t})=>t.colors.global.textDefault};
}
`,N=l.default.div`
overflow-y: auto;
overflow-x: hidden;
height: 100%;
padding: 0 8px;
container-type: inline-size;
& > div {
& > h1, & > h2, & > h3, & > h4, & > h5, & > h6 {
margin-bottom: 8px;
}
& ul, & ol {
padding-left: 1.5rem;
margin: 8px 0;
& > li {
padding: 4px 0;
}
}
& ul {
list-style-type: disc;
}
& p {
white-space: pre-wrap;
margin: 8px 0;
}
& table {
border-collapse: collapse;
border-spacing: 0;
margin: 8px 0;
& th, & td {
border: 1px solid ${({theme:t})=>t.colors.input.border};
padding: 4px 8px;
}
}
}
`;function S({value:t,height:r,show:y,withFullView:x,noBackground:p,noBorder:f}){const[m,s]=e.useState(!1);return y&&e.createElement(c,{$height:r,$noBackground:p,$noBorder:f},e.createElement(N,null,e.createElement(a.oz,{text:t})),x&&e.createElement(F,{name:"expand",onClick:()=>s(!0)}),e.createElement(v,{value:t,show:m,onClose:()=>s(!1)}))}S.defaultProps={withFullView:!1,noBackground:!1,noBorder:!1,height:void 0};const B=S,K=l.default.div`
position: fixed;
display: flex;
flex-direction: column;
align-items: center;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1051;
background-color: rgba(0, 0, 0, 0.5);
`,U=l.default.div`
position: relative;
display: flex;
flex-direction: column;
width: 75vw;
max-width: 1000px;
height: 65vh;
top: 10vh;
padding: 16px;
background-color: ${({theme:t})=>t.colors.global.contentBackground};
border: 1px solid ${({theme:t})=>t.colors.input.border};
border-radius: 8px;
`,X=(0,l.default)(a.In)`
margin-left: auto;
cursor: pointer;
color: ${({theme:t})=>t.colors.input.placeholder};
&:hover {
color: ${({theme:t})=>t.colors.global.textDefault};
}
`,L=l.default.div`
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: stretch;
gap: 1rem;
editor-body {
flex-grow: 1;
}
`,Q=l.default.div`
.ace_editor {
border: 1px solid ${({theme:t})=>t.colors.input.border} !important;
}
`;function j({value:t,readOnly:r,onChange:y,show:x,onClose:p,onDone:f}){const[m,s]=e.useState(0),[E,C]=e.useState(t);e.useEffect(()=>{var b;const D=(b=document.getElementById("editor-body"))==null?void 0:b.scrollHeight;s(D)},[]),e.useEffect(()=>C(t),[t]);const P=e.useCallback(b=>{C(b),y(b)},[y]),T=e.useCallback(()=>{f&&f(E),p()},[E,p,f]),O=e.useMemo(()=>x?e.createElement(K,{onClick:()=>p()},e.createElement(U,{onClick:b=>b.stopPropagation()},e.createElement(L,null,e.createElement("h2",{style:{marginBottom:"1rem"}},"Markdown Editor"),e.createElement(X,{name:"close",onClick:()=>p()})),e.createElement(L,{id:"editor-body"},m>0&&e.createElement(e.Fragment,null,e.createElement(Q,{style:{width:"50%"}},e.createElement(a.Qb,{id:"md-editor",mode:"markdown",theme:"light",toolbar:!1,resizable:!1,readOnly:r,height:m,value:E,onChange:P})),e.createElement("div",{style:{width:"50%"}},e.createElement(B,{show:!0,value:E,height:m})))),e.createElement(L,{style:{justifyContent:"flex-end",marginTop:"1rem"}},e.createElement(g.Button,{onClick:()=>p()},"Cancel"),e.createElement(g.Button,{bsStyle:"success",onClick:T},"Done")))):null,[x,m,E,r,p,T,P]);return e.createElement(e.Fragment,null,h.createPortal(O,document.body))}j.defaultProps={readOnly:!1,onDone:void 0};const H=j,G=l.default.div`
position: relative;
bottom: -1px;
display: flex;
flex-direction: row;
align-items: flex-end;
gap: 5px;
padding: 0 8px;
z-index: 1;
`,V=l.default.div`
padding: 4px 8px;
border: none;
border-bottom: 1px solid ${({theme:t})=>t.colors.input.border};
border-top-left-radius: 8px;
border-top-right-radius: 8px;
background-color: ${({theme:t})=>t.colors.global.contentBackground};
color: ${({theme:t,$active:r})=>r?t.colors.global.textDefault:t.colors.input.placeholder};
cursor: pointer;
${({$active:t})=>t&&(0,l.css)`
border: 1px solid ${({theme:r})=>r.colors.input.border};
border-bottom-color: ${({theme:r})=>r.colors.global.contentBackground};
`}
`,Z=l.default.div`
& .ace_editor {
border-color: ${({theme:t})=>t.colors.input.border} !important;
}
& .ace_cursor {
border-color: ${({theme:t})=>t.colors.global.textDefault};
}
`,J=(0,l.default)(a.In)`
position: absolute;
bottom: 0;
right: 0;
padding: 8px;
cursor: pointer;
color: ${({theme:t})=>t.colors.input.placeholder};
z-index: 10;
&:hover {
color: ${({theme:t})=>t.colors.global.textDefault};
}
`;function k({id:t,value:r,height:y,readOnly:x,onChange:p,onFullMode:f}){const[m,s]=e.useState(r),[E,C]=e.useState(!1),[P,T]=e.useState(!1);e.useEffect(()=>s(r),[r]);const O=D=>{T(D),f&&f(D)},b=D=>{s(D),p(D)};return e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"relative"}},e.createElement(G,null,e.createElement(V,{$active:!E,onClick:()=>C(!1)},"Edit"),e.createElement(V,{$active:E,onClick:()=>C(!0)},"Preview")),!E&&e.createElement(Z,null,e.createElement(a.Qb,{id:t!=null?t:"md-editor",mode:"markdown",theme:"light",toolbar:!1,resizable:!1,readOnly:x,height:y,value:m,onChange:b})),e.createElement(B,{value:m,height:y,show:E}),e.createElement(J,{"data-testid":"expand-icon",name:"expand",onClick:()=>O(!0)})),P&&e.createElement(H,{value:m,readOnly:x,show:P,onChange:b,onClose:()=>O(!1)}))}k.defaultProps={id:void 0,readOnly:!1,onFullMode:void 0};const Y=k},SfPIQIJE:(_,A,o)=>{o.d(A,{A:()=>R});var e=o("Z7aTuO5B"),l=o("J6y4/h8P"),a=o("rIl5IEuP"),h=o("ty2gyrHp"),g=o("IOI9nV80"),I=o("NV1/EHMi");const M=(0,l.default)(a.ButtonToolbar)`
margin-bottom: 10px;
`,$=(0,l.default)(a.Button)(({theme:v})=>(0,l.css)`
font-family: ${v.fonts.family.navigation};
font-size: ${v.fonts.size.navigation};
color: ${v.colors.variant.darker.default};
&:hover,
&:focus {
background: inherit;
text-decoration: none;
}
&:hover {
color: inherit;
${(0,I.WS)(v)}
}
&.active {
color: ${v.colors.global.textDefault};
${(0,I.at)(v)}
&:hover,
&:focus {
${(0,I.at)(v)}
}
`);$.displayName="Button";const R=({items:v})=>e.createElement(M,null,v.map(({path:c,title:F,permissions:N,exactPathMatch:S})=>c?e.createElement(g.Wj,{permissions:N!=null?N:[],key:c},e.createElement(h.m,{to:c,relativeActive:!S},e.createElement($,{bsStyle:"link"},e.createElement(I.Ay,null,F)))):null))},IFFKjdia:(_,A,o)=>{o.d(A,{PI:()=>l,S2:()=>h,eD:()=>e,zR:()=>a});const e="system-notifications-v1",l="event_definitions",a={pageSize:20,sort:{attributeId:"title",direction:"asc"},displayedColumns:["title","description","priority","scheduling","status","matched_at"],columnsOrder:["title","description","priority","matched_at","status","scheduling"]},h=[{id:"scheduling",title:"Scheduling",sortable:!1},{id:"matched_at",title:"Last Matched",sortable:!0}]},XirFL5dA:(_,A,o)=>{o.d(A,{A:()=>m});var e=o("Z7aTuO5B"),l=o("ii0bleBb"),a=o.n(l),h=o("Dg7SLLbb"),g=o.n(h),I=o("QL8i6bcz"),M=o("9oVghaOd"),$=o.n(M),W=o("gtXNkEXl"),R=o("4E3oowBb"),v=o("wrndsiBg"),c=o("rIl5IEuP"),F=o("yGRmSjYM"),N=o("UMMlOSMl"),S=o("9O66OgQd");const B=({validation:s})=>{const E=Object.keys(s.errors);return E.length===0?null:e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement(c.Alert,{bsStyle:"danger",className:S.A.validationSummary,title:"We found some errors!"},e.createElement("p",null,"Please correct the following errors before saving this Event Definition:"),e.createElement("ul",null,E.map(C=>s.errors[C].map(P=>{const T=C==="config"?P.replace("config","condition"):P;return e.createElement("li",{key:`${C}-${T}`},T)}))))))};B.propTypes={validation:a().object},B.defaultProps={validation:{errors:[]}};const K=B;var U=o("dFpwyWHg"),X=o.n(U),L=o("C2ikvoS0"),Q=o.n(L),j=o("1IntWRSu"),H=o.n(j),G=o("8nGWeFnd"),V=o.n(G),Z=o("TeAcaicX"),J=o.n(Z),k=o("eE3+5goe"),Y=o.n(k),t=o("uCppV7l0"),r={};r.styleTagTransform=Y(),r.setAttributes=V(),r.insert=H().bind(null,"head"),r.domAPI=Q(),r.insertStyleElement=J();var y=X()(t.A,r);const x=t.A&&t.A.locals?t.A.locals:void 0;var p=o("IFFKjdia");const f=({eventDefinition:s,notifications:E,validation:C,currentUser:P})=>{const[T,O]=(0,e.useState)(!1);(0,e.useEffect)(()=>{(()=>{T||O(!0)})()},[T,O]);const b=()=>e.createElement(e.Fragment,null,e.createElement("h3",{className:S.A.title},"Details"),e.createElement("dl",null,e.createElement("dt",null,"Title"),e.createElement("dd",null,s.title||"No title given"),e.createElement("dt",null,"Description"),e.createElement("dd",null,s.description||"No description given"),e.createElement("dt",null,"Priority"),e.createElement("dd",null,g()(N.A.properties[s.priority].name)),e.createElement("dt",{style:{margin:"16px 0 0"}},"Remediation Steps"),e.createElement("dd",null,e.createElement(v.G8,{show:!0,withFullView:!0,noBorder:!0,noBackground:!0,value:s.remediation_steps||"No remediation steps given"})))),D=(n,i)=>i===void 0?{}:I.d.exports(n).find(d=>d.type===i)||{},ee=n=>{const i=D("eventDefinitionTypes",n.type),d=i.summaryComponent?e.createElement(i.summaryComponent,{config:n,currentUser:P}):e.createElement("p",null,"Condition plugin ",e.createElement("em",null,n.type)," does not provide a summary.");return e.createElement(e.Fragment,null,e.createElement("h3",{className:S.A.title},i.displayName||n.type),d)},te=(n,i,d)=>{if(!i.providers||i.providers.length===0)return e.createElement("span",{key:n},"No field value provider configured.");const u=i.providers[0]||{},z=D("fieldValueProviders",u.type);return z.summaryComponent?e.createElement(z.summaryComponent,{fieldName:n,config:i,keys:d,key:n,currentUser:P}):e.createElement("p",{key:n},"Provider plugin ",e.createElement("em",null,u.type)," does not provide a summary.")},oe=(n,i,d)=>e.createElement(e.Fragment,null,e.createElement("dl",null,e.createElement("dt",null,"Keys"),e.createElement("dd",null,d.length>0?d.join(", "):"No Keys configured for Events based on this Definition.")),n.sort(R.j).map(u=>te(u,i[u],d))),ne=(n,i)=>{const d=Object.keys(n);return e.createElement(e.Fragment,null,e.createElement("h3",{className:S.A.title},"Fields"),d.length===0?e.createElement("p",null,"No Fields configured for Events based on this Definition."):oe(d,n,i))},le=n=>{const i=E.find(u=>u.id===n.notification_id);let d;if(i){const u=D("eventNotificationTypes",i.config.type);d=u.summaryComponent?e.createElement(u.summaryComponent,{type:u.displayName,notification:i,definitionNotification:n}):e.createElement("p",null,"Notification plugin ",e.createElement("em",null,i.config.type)," does not provide a summary.")}else d=e.createElement("p",null,"Could not find information for Notification ",e.createElement("em",null,n.notification_id),".");return e.createElement(e.Fragment,{key:n.notification_id},d)},re=n=>{const i=$().duration(n.grace_period_ms).format("d [days] h [hours] m [minutes] s [seconds]",{trim:"all"}),d=n.grace_period_ms?`Grace Period is set to ${i}`:"Grace Period is disabled",u=n.backlog_size?`Notifications will include ${n.backlog_size} messages`:"Notifications will not include any messages.";return e.createElement(e.Fragment,null,e.createElement("h4",null,"Settings"),e.createElement("dl",null,e.createElement("dd",null,d),e.createElement("dd",null,u)))},ae=(n,i)=>{const d=n.filter(w=>(0,F.Nn)(P.permissions,`eventnotifications:read:${w.notification_id}`)),u=n.filter(w=>!d.map(ie=>ie.notification_id).includes(w.notification_id)),z=u.length>0?e.createElement(c.Alert,{bsStyle:"warning"},"Missing Notifications Permissions for:",e.createElement("br",null),u.map(w=>w.notification_id).join(", ")):null;return e.createElement(e.Fragment,null,e.createElement("h3",{className:S.A.title},"Notifications"),e.createElement("p",null,z),d.length===0&&u.length<=0?e.createElement("p",null,"This Event is not configured to trigger any Notifications."):e.createElement(e.Fragment,null,re(i),n.map(le)))},q=s.config.type===p.eD;return e.createElement(c.Row,{className:x.eventSummary},e.createElement(c.Col,{md:12},e.createElement("h2",{className:S.A.title},"Event Summary"),T&&e.createElement(K,{validation:C}),e.createElement(c.Row,null,e.createElement(c.Col,{md:5},b()),!q&&e.createElement(c.Col,{md:5,mdOffset:1},ee(s.config))),e.createElement(c.Row,null,!q&&e.createElement(c.Col,{md:5},ne(s.field_spec,s.key_spec)),e.createElement(c.Col,{md:5,mdOffset:q?0:1},ae(s.notifications,s.notification_settings)))))};f.propTypes={eventDefinition:a().object.isRequired,notifications:a().array.isRequired,validation:a().object,currentUser:a().object.isRequired},f.defaultProps={validation:void 0};const m=f},jvpdvVQ7:(_,A,o)=>{o.d(A,{A:()=>M});var e=o("Z7aTuO5B"),l=o("SfPIQIJE"),a=o("d4kzUuQm"),h=o("rIl5IEuP");const g=[{title:"Alerts & Events",path:a.Ay.ALERTS.LIST,exactPathMatch:!0},{title:"Event Definitions",path:a.Ay.ALERTS.DEFINITIONS.LIST},{title:"Notifications",path:a.Ay.ALERTS.NOTIFICATIONS.LIST}],M=()=>e.createElement(h.Row,null,e.createElement(l.A,{items:g}))}}]);})();
//# sourceMappingURL=bb8c8232-6119.23231fc83bcf991086a5.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy