web-interface.assets.bb8c8232-1554.9b46048828a11db4ab5a.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-1554"],{W19JNEMx:(dt,D,s)=>{s.r(D),s.d(D,{default:()=>ct});var t=s("Z7aTuO5B"),m=s("IOI9nV80"),i=s("J6y4/h8P"),Z=s("/W/x1zfW"),R=s("QBkUz07U"),h=s("ty2gyrHp"),T=s("d4kzUuQm"),p=s("DUKaTDO2"),_=s("GRU0vAV6"),q=s("PLazxdob");const ee={defaultOptions:{queries:{cacheTime:1e3*60*60*24}}},te=(0,q.s)({storage:window.localStorage}),ne=({children:e})=>{const n=(0,t.useMemo)(()=>new p.QueryClient(ee),[]);return t.createElement(_.t,{client:n,persistOptions:{persister:te}},e)};var k=s("3yfJIRSb"),oe=s("oc9db6Tt"),w=s.n(oe),re=s("UEhMhaHZ"),ae=s("2GbzTNI4");const se="open-feed",gt="enterprise-feed",yt="smb-feed";var le=s("RCNj0OY4"),ie=s("xAuw/bbM"),N=s("ysvTSBlf"),A=s("q2j1bVbz");const G=["content-stream","settings"],ce=["content-stream","tags"],M=()=>{const e=(0,p.useQueryClient)(),n=(0,A.A)(),{getContentStreamUserSettings:o,setContentStreamUserSettings:r,getContentStreamTags:l}=ie.ContentStream,E=async({settings:v,username:ut})=>{await r(v,ut)},{data:a,isLoading:c,refetch:u}=(0,p.useQuery)([G],()=>o(n.username),{onError:v=>{N.A.error(`Loading content stream config failed with status: ${v}`,"Could not load content stream.")}}),{data:g,isLoading:y,refetch:S,error:F}=(0,p.useQuery)([ce],()=>l(),{onError:v=>{N.A.error(`Loading content stream tag failed with status: ${v}`,"Could not load content stream tags.")}}),{mutateAsync:mt}=(0,p.useMutation)(E,{onSuccess:()=>{e.invalidateQueries(G),e.invalidateQueries(U)},onError:v=>{N.A.error(`Enabling content stream failed with status: ${v}`,"Could not cancel instant archiving jobs")}});return{contentStreamSettings:{contentStreamTopics:a==null?void 0:a.content_stream_topics,releasesSectionEnabled:a==null?void 0:a.releases_enabled,contentStreamEnabled:a==null?void 0:a.content_stream_enabled},contenStreamTags:{currentTag:g==null?void 0:g[0],isLoadingTags:y,refetchContentStreamTag:S,contentStreamTagError:F},isLoadingContentStreamSettings:c,refetchContentStream:u,onSaveContentStreamSetting:mt}},me=e=>{const n={ignoreAttributes:!1,attributeNamePrefix:"attr_"},r=new ae.XMLParser(n).parse(e),{rss:{channel:{item:l=void 0}}}=r;return Array.isArray(l)?l:[l]},ue=e=>e&&window.fetch(e,{method:"GET"}).then(n=>n.text()).then(me).catch(n=>n),U=["content-stream","content"],B=e=>{const{contenStreamTags:{currentTag:n,isLoadingTags:o,contentStreamTagError:r}}=M(),{rss_url:l}=le.A.contentStream()||{},E=(0,t.useCallback)(()=>e||(o||r||!n?se:n),[r,n,o,e]),a=l&&`${l}/${E()}/feed`,{data:c,isLoading:u,error:g}=(0,p.useQuery)([...U,a],()=>ue(a),{initialData:[]});return{error:g,feedList:c,isLoadingFeed:u}};var de=s("AbA4Yk3R"),Q=s.n(de),d=s("rIl5IEuP"),L=s("8OvTct/Z"),f=s("v4GbOr/o");const Ee=i.default.img(({theme:e})=>(0,i.css)`
max-width: 100%;
width: 100%;
object-fit: contain;
border-radius: ${e.spacings.xxs} ${e.spacings.xxs} 0 0;
`),ge=(0,i.default)(d.Panel.Body)(({theme:e})=>(0,i.css)`
flex-grow: 1;
background-color: ${e.colors.newsCards.background};
> a {
font-weight: bold;
}
`),ye=(0,i.default)(d.Panel.Footer)(({theme:e})=>(0,i.css)`
background-color: ${e.colors.newsCards.background};
border-radius: 0 0 ${e.spacings.xxs} ${e.spacings.xxs};
`),pe=(0,i.default)(d.Panel)(({theme:e})=>(0,i.css)`
display: flex;
flex-direction: column;
height: 100%;
border: none;
border-radius: ${e.spacings.xxs};
`),W=e=>Q().sanitize(e),Se=e=>{var n;return Array.isArray(e)?(n=e==null?void 0:e[0])==null?void 0:n.attr_url:e==null?void 0:e.attr_url},he=({feed:e})=>{const n=(0,L.A)(),o=()=>{n(f.g.CONTENTSTREAM.ARTICLE_CLICKED,{app_pathname:"welcome",app_section:"content-stream",event_details:{title:e==null?void 0:e.title,link:e==null?void 0:e.link}})};return t.createElement(m.FN.Slide,null,t.createElement(pe,null,t.createElement("a",{href:e==null?void 0:e.link,onClick:()=>o(),target:"_blank",rel:"noreferrer"},t.createElement(Ee,{src:Se(e==null?void 0:e["media:content"]),alt:e==null?void 0:e.title})),t.createElement(ge,null,t.createElement("a",{href:e==null?void 0:e.link,target:"_blank",onClick:()=>o(),rel:"noreferrer"},t.createElement("span",{dangerouslySetInnerHTML:{__html:W(e==null?void 0:e.title)}}))),t.createElement(ye,null,t.createElement(m.Dc,{dateTime:W(e==null?void 0:e.pubDate),format:"shortReadable"}))))},ve=()=>{const{feedList:e,isLoadingFeed:n,error:o}=B();return n?t.createElement(m.y$,null):o||w()(e)?t.createElement(d.Alert,{bsStyle:"info"},t.createElement("p",null,"Unable to load RSS feed at the moment ! You can read more on "," ",t.createElement(m.Gr,{href:"https://www.graylog.org/blog/"},"Graylog"),".")):t.createElement(re.A,null,e==null?void 0:e.map(r=>t.createElement(he,{key:(r==null?void 0:r.guid["#text"])||(r==null?void 0:r.title),feed:r})))};var fe=s("twCj7/B5");const Ce=e=>{const[n,o]=(0,t.useState)(void 0);(0,t.useEffect)(()=>{n||setInterval(()=>{o(document.querySelector(e))},200)},[n,e]);const r=(0,t.useMemo)(()=>n&&(0,fe.A)(n,{containScroll:"trimSnaps"}),[n]),l=(0,t.useCallback)(()=>{r&&r.scrollPrev()},[r]);return{scrollNext:(0,t.useCallback)(()=>{r&&r.scrollNext()},[r]),scrollPrev:l}},Te=()=>{const{scrollPrev:e,scrollNext:n}=Ce(".carousel"),o=(0,L.A)(),r=()=>{o(f.g.CONTENTSTREAM.PREV_ARROW_CLICKED,{app_pathname:"welcome",app_section:"content-stream"}),e()},l=()=>{o(f.g.CONTENTSTREAM.NEXT_ARROW_CLICKED,{app_pathname:"welcome",app_section:"content-stream"}),n()};return t.createElement(t.Fragment,null,t.createElement(d.Button,{onClick:()=>r()},t.createElement(m.In,{name:"chevron_left"})),t.createElement(d.Button,{onClick:()=>l()},t.createElement(m.In,{name:"chevron_right"})))},Ae=i.default.div(({theme:e})=>(0,i.css)`
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
grid-auto-flow: row;
margin-top: ${e.spacings.sm};
`),Le=i.default.div`
display: flex;
align-items: center;
justify-content: right;
`,Re=i.default.div`
justify-content: center;
display: flex;
flex-direction: column;
`,we=()=>t.createElement(Ae,null,t.createElement(Re,null,t.createElement(m.Gr,{href:"https://www.graylog.org/blog/"},"Read more")),t.createElement(Le,null,t.createElement(Te,null))),Ne=(0,i.default)(d.ListGroupItem)(({theme:e})=>(0,i.css)`
display: flex;
gap: ${e.spacings.md};
align-items: flex-start;
`),Pe=i.default.i(({theme:e})=>(0,i.css)`
color: ${e.colors.gray[60]};
`),At=(0,i.default)(d.Label)`
cursor: default;
width: 110px;
display: block;
`,be=(e="")=>Q().sanitize(e),Ie=()=>{const e="release-info",{feedList:n,isLoadingFeed:o,error:r}=B(e),l=(0,L.A)(),E=a=>{l(f.g.CONTENTSTREAM.RELESE_ARTICLE_CLICKED,{app_pathname:"welcome",app_section:"content-stream",event_details:{title:a==null?void 0:a.title,link:a==null?void 0:a.link}})};return o&&!w()(n)?t.createElement(m.y$,null):r||w()(n)?t.createElement(d.Alert,{bsStyle:"info"},t.createElement("p",null,"Unable to load RSS feed at the moment ! You can read more on "," ",t.createElement(m.Gr,{href:"https://www.graylog.org/post/tag/release-info"},"Graylog.org"),".")):t.createElement(d.ListGroup,null,n.map(a=>t.createElement(Ne,{key:(a==null?void 0:a.guid["#text"])||(a==null?void 0:a.title)},t.createElement("a",{href:a==null?void 0:a.link,onClick:()=>E(a),target:"_blank",rel:"noreferrer"},t.createElement("span",{dangerouslySetInnerHTML:{__html:be(a==null?void 0:a.title)}})),a!=null&&a.pubDate?t.createElement(Pe,null,t.createElement(m.sR,{dateTime:a.pubDate})):null)))},xe=(0,i.default)(d.Button)(({theme:e})=>(0,i.css)`
border: 0;
font-size: ${e.fonts.size.large};
&:hover {
text-decoration: none;
}
`),Y=({onClick:e,isOpen:n})=>t.createElement(xe,{bsStyle:"link",onClick:()=>e(),type:"button"},n?"Close":"Open",t.createElement(m.In,{name:n?"expand_more":"chevron_right"})),Oe=(0,i.default)(R.A)(({$enabled:e,theme:n})=>(0,i.css)`
overflow: hidden;
flex-grow: 3;
height: ${e?"initial":"min-content"};
@media (max-width: ${n.breakpoints.max.md}) {
flex-grow: 1;
}
`),$e=(0,i.default)(R.A)(({$enabled:e})=>(0,i.css)`
flex-grow: 1;
height: ${e?"initial":"min-content"};
`),Fe=()=>{const{username:e}=(0,A.A)(),n=(0,L.A)(),{contentStreamSettings:o,isLoadingContentStreamSettings:r,onSaveContentStreamSetting:l,refetchContentStream:E}=M();if(r||!o)return null;const a=async({enableContentStream:S,enableRelease:F})=>{await l({settings:{content_stream_enabled:S,releases_enabled:F,content_stream_topics:o.contentStreamTopics},username:e}),E()},{contentStreamEnabled:c,releasesSectionEnabled:u}=o,g=()=>{n(f.g.CONTENTSTREAM.NEWS_OPT_IN_TOGGLED,{app_pathname:"welcome",app_section:"content-stream",event_details:{contentStreamEnabled:!c}}),a({enableContentStream:!c,enableRelease:u})},y=()=>{n(f.g.CONTENTSTREAM.RELEASE_OPT_IN_TOGGLED,{app_pathname:"welcome",app_section:"content-stream",event_details:{contentStreamEnabled:!u}}),a({enableContentStream:c,enableRelease:!u})};return t.createElement(k.A,{$columns:"2fr 1fr"},t.createElement(Oe,{title:"News",$enabled:c,headerActions:t.createElement(Y,{onClick:g,isOpen:c})},c&&t.createElement(t.Fragment,null,t.createElement(ve,null),t.createElement(we,null))),t.createElement($e,{title:"Releases",$enabled:u,headerActions:t.createElement(Y,{onClick:y,isOpen:u})},u&&t.createElement(Ie,null)))},De=()=>t.createElement(ne,null,t.createElement(Fe,null)),Pt={dashboard:{link:"DASHBOARDS_VIEWID",typeTitle:"dashboard"},search:{link:"SEARCH_VIEWID",typeTitle:"search"},search_filter:{link:"MY-FILTERS_DETAILS_FILTERID",typeTitle:"search filter"},unknown:{typeTitle:"unknown",link:void 0}},C={per_page:5,page:1,count:0,total:0};var ke=s("PH5VRLCQ"),Ge=s.n(ke);const Me=e=>{throw new Error(`Can't find title for type: ${e!=null?e:"(undefined)"}`)},Ue=new Set(["user","team","dashboard","event_definition","notification","search","stream","search_filter","report","role","output"]),H=(e,n=!0)=>Ue.has(e)?Ge()(e):n?Me(e):void 0;var P=s("Q1zRxDOP");const Be=e=>{throw new Error(`Can't find prefix for type: ${e!=null?e:"(undefined)"}`)},Qe=new Set(["user","team","dashboard","event_definition","notification","search","stream","search_filter","report","role","output"]),We={event_definition:"eventdefinitions:",notification:"eventnotifications:",search:"view:",report:"report:"},Ye=(e,n=!0)=>{var o;return Qe.has(e)?(o=We[e])!=null?o:`${e}s:`:n?Be(e):`(unsupported type ${e})`};var He=s("yGRmSjYM");const z=(e,n="read")=>{const{id:o,type:r}=(0,P.U)(e),{permissions:l}=(0,A.A)();return(0,t.useMemo)(()=>(0,He.Nn)(l,`${Ye(r)}${n}:${o}`),[o,n,l,r])};var K=s("tz1fbBRX");const ze=(0,i.default)(d.ListGroupItem)`
display: flex;
gap: 16px;
align-items: flex-start;
`,j=(0,i.default)(d.Label)`
cursor: default;
width: 110px;
display: block;
`,Ke=i.default.i(({theme:e})=>(0,i.css)`
color: ${e.colors.gray[60]};
`),V=({title:e,grn:n,timestamp:o})=>{const{id:r,type:l}=(0,P.U)(n),E=z(n,"read"),a=(0,t.useMemo)(()=>{var y;return(y=H(l,!1))!=null?y:"unknown"},[l]),c=(0,K.A)(n),u=e||r,g=!!c&&E;return t.createElement(ze,null,t.createElement(j,{bsStyle:"info"},a),g?t.createElement(h.N,{to:c},u):t.createElement("i",null,u),o?t.createElement(Ke,null,t.createElement(m.sR,{dateTime:o})):null)};V.defaultProps={timestamp:void 0};const J=V;var b=s("gyRmhZSW"),I=s("eFxcQyPT"),x=s("MdYBRjRJ"),O=s("jAGDuYSC");const je="/startpage",Ve="last_open_query_key",Je=async({page:e})=>{const n=(0,b.A)(`${je}/lastOpened`,e,5,"");return(0,I.Ay)("GET",(0,x.H3)(n))},Xe=e=>(0,p.useQuery)([Ve,e],()=>Je(e),{onError:n=>{O.A.error(`Loading last opened items failed with status: ${n}`,"Could not load last opened items")},retry:0,initialData:{lastOpened:[],...C}}),Ze=()=>{const{data:{lastOpened:e},isFetching:n}=Xe(C);return n?t.createElement(m.y$,null):e.length===0?t.createElement(m.EO,null,"You have not opened any searches/dashboards yet.",t.createElement("br",null),"From now on, whenever you open a saved search/dashboard, it will show up here. In the meantime, you can start a new ",t.createElement(h.N,{to:T.Ay.SEARCH},"Search")," or ",t.createElement(h.N,{to:T.Ay.pluginRoute("DASHBOARDS_NEW")},"Dashboard"),"."):t.createElement(d.ListGroup,null,e.map(({grn:o,title:r,timestamp:l})=>t.createElement(J,{key:o,grn:o,title:r,timestamp:l})))},_e="favorite_items_query_key",qe=async({page:e})=>{const n=(0,b.A)("/favorites",e,5,"");return(0,I.Ay)("GET",(0,x.H3)(n))},et=e=>(0,p.useQuery)([_e,e],()=>qe(e),{onError:n=>{O.A.error(`Loading favorite items failed with status: ${n}`,"Could not load favorite items")},retry:0,initialData:{favorites:[],...C}}),tt=()=>{const[e,n]=(0,t.useState)(C),{data:{favorites:o,total:r},isFetching:l}=et(e),E=(0,t.useCallback)(a=>{n(c=>({...c,page:a}))},[n]);return l?t.createElement(m.y$,null):o.length===0?t.createElement(m.EO,null,"You do not have any favorite items yet.",t.createElement("br",null),"Make any ",t.createElement(h.N,{to:T.Ay.SEARCH},"Search")," or ",t.createElement(h.N,{to:T.Ay.pluginRoute("DASHBOARDS_NEW")},"Dashboard")," favorite to show up here."):t.createElement(m.OW,{onChange:E,useQueryParameter:!1,activePage:e.page,totalItems:r,pageSize:e.per_page,showPageSizeSelect:!1,hideFirstAndLastPageLinks:!0},t.createElement(d.ListGroup,null,o.map(({grn:a,title:c})=>t.createElement(J,{key:a,grn:a,title:c}))))},nt="/startpage",ot="recent_actions_query_key",rt=async({page:e})=>{const n=(0,b.A)(`${nt}/recentActivity`,e,5,"");return(0,I.Ay)("GET",(0,x.H3)(n)).then(o=>({page:o.page,per_page:o.per_page,count:o.count,total:o.total,recentActivity:o.recentActivity.map(r=>({id:r.id,itemTitle:r.item_title,timestamp:r.timestamp,activityType:r.activity_type,itemGrn:r.item_grn,userName:r.user_name}))}))},at=e=>(0,p.useQuery)([ot,e],()=>rt(e),{onError:n=>{O.A.error(`Loading recent activity failed with status: ${n}`,"Could not load recent activity")},retry:0,initialData:{recentActivity:[],...C}}),X=({itemGrn:e,activityType:n,itemTitle:o,userName:r})=>{const l=z(e,"read"),{id:E,type:a}=(0,P.U)(e),c=(0,t.useMemo)(()=>{var S;return(S=H(a,!1))!=null?S:`(unsupported type ${a})`},[a]),u=(0,K.A)(e),g=o||E,y=n!=="delete"&&!!u&&l;return t.createElement("div",null,`The ${c} `,y?t.createElement(h.N,{target:"_blank",to:u},g):t.createElement("i",null,g)," was ",`${n}d`,r?` by ${r}`:"")};X.defaultProps={userName:null};const st=()=>{const[e,n]=(0,t.useState)(C),{data:{recentActivity:o,total:r},isFetching:l}=at(e),E=(0,t.useCallback)(a=>{n(c=>({...c,page:a}))},[n]);return l?t.createElement(m.y$,null):o.length===0?t.createElement(m.EO,null,"There is no recent activity yet.",t.createElement("p",null,"Whenever any other user will update content you have access to, or share new content with you, it will show up here.")):t.createElement(m.OW,{onChange:E,useQueryParameter:!1,activePage:e.page,totalItems:r,pageSize:e.per_page,showPageSizeSelect:!1,hideFirstAndLastPageLinks:!0},t.createElement(d.Table,{striped:!0},t.createElement("tbody",null,o.map(({id:a,timestamp:c,activityType:u,itemGrn:g,itemTitle:y,userName:S})=>t.createElement("tr",{key:a},t.createElement("td",{style:{width:110}},t.createElement(j,{bsStyle:"primary"},t.createElement(m.sR,{dateTime:c}))),t.createElement("td",null,t.createElement(X,{itemGrn:g,activityType:u,itemTitle:y,userName:S})))))))},$=(0,i.default)(R.A)`
flex-grow: 1;
`,lt=({readOnly:e,userId:n,startpage:o})=>o!==null||e?t.createElement("span",null,"This is your personal page, allowing easy access to the content most relevant for you."):t.createElement(t.Fragment,null,t.createElement("span",null,"This is your personal start page, allowing easy access to the content most relevant for you."),t.createElement("span",null," ","You can change your personal start page on the ",t.createElement(h.N,{to:T.Ay.SYSTEM.USERS.edit(n)},"edit profile")," page.")),it=()=>{const{permissions:e,readOnly:n,id:o,startpage:r}=(0,A.A)(),l=e.includes("*");return t.createElement(t.Fragment,null,t.createElement(Z.A,{title:"Welcome to Graylog!"},t.createElement(lt,{userId:o,readOnly:n,startpage:r})),t.createElement(k.A,null,t.createElement($,{title:"Last Opened"},t.createElement("p",{className:"description"},"Overview of recently visited saved searches and dashboards."),t.createElement(Ze,null)),t.createElement($,{title:"Favorite Items"},t.createElement("p",{className:"description"},"Overview of your favorite saved searches and dashboards."),t.createElement(tt,null))),t.createElement($,{title:"Recent Activity"},t.createElement("p",{className:"description"},l?"This list includes all actions Graylog users performed, like creating or sharing an entity.":"Overview of actions you made with entities or somebody else made with entities which relates to you, like creating or sharing an entity."),t.createElement(st,null)),t.createElement(De,null))},ct=()=>t.createElement(m.Qc,{title:"Welcome"},t.createElement(it,null))}}]);})();
//# sourceMappingURL=bb8c8232-1554.9b46048828a11db4ab5a.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy