All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.ExtendedSearchPage.b67e8c7e61f91c988887.js Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version
(window.webpackJsonp=window.webpackJsonp||[]).push([["d7fbfcf5-22"],{"+b6oEDsX":function(e,t,n){"use strict";n.r(t);var r=n("4KF7VOU5"),o=n.n(r),a=n("GZfD0NTG"),i=n("72UfWcJe"),c=n("QlBQbb2U"),l=n("21p8kIWv"),u=l.a.get("Session"),s=u.SessionStore,f=u.SessionActions,p=l.a.get("Startpage").StartpageStore,d=l.a.get("Preferences").PreferencesActions,m=o.a.createStore({listenables:[f],currentUser:void 0,init:function(){this.listenTo(s,this.sessionUpdate,this.sessionUpdate),this.listenTo(p,this.reload,this.reload),d.saveUserPreferences.completed.listen(this.reload)},getInitialState:function(){return{currentUser:this.currentUser}},get:function(){return this.currentUser},sessionUpdate:function(e){if(e.sessionId&&e.username){var t=e.username;this.update(t)}else this.currentUser=void 0,this.trigger({currentUser:this.currentUser})},reload:function(){return void 0!==this.currentUser?this.update(this.currentUser.username):Promise.resolve()},update:function(e){var t=this;return Object(i.b)("GET",Object(a.d)(c.a.UsersApiController.load(encodeURIComponent(e)).url)).then((function(e){t.currentUser=e,t.trigger({currentUser:t.currentUser})}))}});t.default=m},"07ChRTmU":function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return g}));var r=n("ivGQtwpr"),o=n("VPaD/Np4"),a=n("oCSEoDew"),i=n.n(a),c=n("+CppQpVm"),l=n("nUOgBntn"),u=n("BNv59zh1"),s=n("Nl8Bs5H3"),f=n("3d1pthdj");function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:c.a.push,n=l.b.getInitialState()||{},r=n.view;if(r&&r.type===u.a.Type.Search){var a=r.search.queries;if(1!==a.size)throw new Error("Searches must only have a single query!");var s=a.first();if(s){var d=s.query.query_string,m=s.timerange,h=s.filter,b=void 0===h?o.Map():h,g=new i.a(e).setSearch("q",d).removeQuery("from").removeQuery("to").removeQuery("keyword").removeQuery("relative"),v=y(m).reduce((function(e,t){var n=p(t,2),r=n[0],o=n[1];return e.setSearch(r,o)}),g),w=Object(f.d)(b),O=w.isEmpty()?v.removeSearch("streams").toString():v.setSearch("streams",w.join(",")).toString();e!==O&&t(O)}}},g=function(e){var t,n,o;Object(r.useEffect)((function(){return b(e,c.a.replace)}),[]),t=[s.a.update.completed],n=function(){return b(e)},o=[e],Object(r.useEffect)((function(){var e=t.map((function(e){return e.listen(n)}));return function(){return e.forEach((function(e){return e()}))}}),o)}},"4p/te11Y":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n("4KF7VOU5"),o=n.n(r),a=n("GZfD0NTG"),i=n("iRYn4e5r"),c=n("72UfWcJe"),l=n("8GJ6oOEd"),u=(n("BNv59zh1"),Object(i.b)("views.Dashboards",(function(){return o.a.createActions({search:{asyncResult:!0}})}))),s=a.a.qualifyUrl("/dashboards"),f=Object(i.c)("views.Dashboards",(function(){return o.a.createStore({listenables:[u],dashboards:void 0,pagination:{total:0,count:0,page:1,perPage:10},getInitialState:function(){return{pagination:this.pagination,list:this.dashboards}},search:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"title",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"asc",i=Object(c.b)("GET","".concat(s,"?query=").concat(t,"&page=").concat(n,"&per_page=").concat(r,"&sort=").concat(o,"&order=").concat(a)).then((function(t){return e.dashboards=t.views,e.pagination={total:t.total,count:t.count,page:t.page,perPage:t.per_page},e.trigger({list:e.dashboards,pagination:e.pagination}),t})).catch((function(e){l.a.error("Fetching dashboards failed with status: ".concat(e),"Could not retrieve dashboards")}));u.search.promise(i)}})}))},"5stz06Uu":function(e,t,n){"use strict";var r=n("ivGQtwpr"),o=n.n(r),a=n("ii0bleBb"),i=n.n(a),c=n("CzyxmveH"),l=n("dkQTzQ9h"),u=n("a1VYJspU");function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var f=n("1VnJesae").a.getStore("System"),p=c.default.footer.withConfig({displayName:"Footer__StyledFooter",componentId:"sc-1uymobt-0"})((function(e){var t=e.theme;return Object(c.css)(["text-align:center;font-size:11px;color:",";margin-bottom:15px;height:20px;@media print{display:none;}"],t.color.gray[70])})),d=function(e){var t=e.system,n=s(Object(r.useState)(),2),a=n[0],i=n[1];return Object(r.useEffect)((function(){var e=!0;return f.jvm().then((function(t){e&&i(t)})),function(){e=!1}}),[]),t&&a?o.a.createElement(p,null,"Graylog ",t.version," on ",t.hostname," (",a.info,")"):o.a.createElement(p,null,"Graylog ",l.a.getFullVersion())};d.propTypes={system:i.a.shape({version:i.a.string,hostname:i.a.string})},d.defaultProps={system:void 0},t.a=Object(u.a)(d,{system:f},(function(e){var t=e.system;return{system:(t=void 0===t?{}:t).system}}))},"7jFiuBJM":function(e,exports,t){(exports=e.exports=t("wTjlWjHz")(!1)).push([e.i,"._1S1PXSEE-2NF77D49YevVJ{cursor:pointer;font-size:14px}._1RIGWcTmbro8Lp7G_2D4dM,._2NCElmCd20xroS6v4rOqs9{opacity:.3}.FIv3lUYRVBcwcfroRgpa_{opacity:1}",""]),exports.locals={widgetActionDropdownCaret:"_1S1PXSEE-2NF77D49YevVJ",tonedDown:"_2NCElmCd20xroS6v4rOqs9",filterNotSet:"_1RIGWcTmbro8Lp7G_2D4dM",filterSet:"FIv3lUYRVBcwcfroRgpa_"}},DIpCNB3O:function(e,exports,t){(exports=e.exports=t("wTjlWjHz")(!1)).push([e.i,"._1Hwwsiz_ECvpmoGV15sPhl{margin:5px}",""]),exports.locals={button:"_1Hwwsiz_ECvpmoGV15sPhl"}},F3W0Xdr6:function(e,exports,t){(exports=e.exports=t("wTjlWjHz")(!1)).push([e.i,"._3R3pMTFifKN0XCkzSPw0Py{padding:0;overflow-y:auto}._23aKnu3AKQWcAcyh5whx_j{font-size:12px;display:table-row;white-space:nowrap}.XrRpysWYIPaLEk56dm1hT{display:flex}.cBdchmtRZAFd0jXE7FFM2{flex-grow:1;margin-right:5px}",""]),exports.locals={fieldList:"_3R3pMTFifKN0XCkzSPw0Py",fieldListItem:"_23aKnu3AKQWcAcyh5whx_j",filterContainer:"XrRpysWYIPaLEk56dm1hT",filterInputContainer:"cBdchmtRZAFd0jXE7FFM2"}},Q0IVNB5x:function(e,exports,t){(e.exports=t("wTjlWjHz")(!1)).push([e.i,".modal-content{padding:10px 15px;border-radius:unset;height:100%}",""])},R2fTrj72:function(e,exports,t){var n=t("7jFiuBJM");"string"==typeof n&&(n=[[e.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};t("HkU00dYq")(n,r);n.locals&&(e.exports=n.locals)},UtQpyW2J:function(e,exports,t){var n,r=0,o=t("Q0IVNB5x");"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(exports.locals=o.locals),exports.use=exports.ref=function(){return r++||(n=t("HkU00dYq")(o,{hmr:!0})),exports},exports.unuse=exports.unref=function(){r>0&&!--r&&(n(),n=null)}},"XSnPw/cy":function(e,exports,t){var n=t("rbNB3XMq");"string"==typeof n&&(n=[[e.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};t("HkU00dYq")(n,r);n.locals&&(e.exports=n.locals)},YS04Ntm6:function(e,exports,t){var n=t("DIpCNB3O");"string"==typeof n&&(n=[[e.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};t("HkU00dYq")(n,r);n.locals&&(e.exports=n.locals)},dGIsG0oq:function(e,exports,t){(exports=e.exports=t("wTjlWjHz")(!1)).push([e.i,'._2KZUiUWrvWBFPRy29xYVK7{height:80vh;width:80vw;margin-top:20px}.NC2KOFDZLwqfG809c1VQk{width:80vw}._2vwRxf2DcD5JZ4L1mYIPAj{padding:15px 20px}._1OtzAo-P7_UObrnhVSD-_S{display:grid;display:-ms-grid;height:100%;grid-template-columns:1fr;-ms-grid-columns:1fr;grid-template-rows:auto minmax(200px,1fr) auto;-ms-grid-rows:auto minmax(200px,1fr) auto;grid-template-areas:"Query-Controls" "Visualization" "Footer"}._2LYYZCVpn8KOHcrQeeVAb7{grid-area:Query-Controls;grid-column:1;-ms-grid-column:1;grid-row:1;-ms-grid-row:1}._2at144Njr8RXES-9Qoh5Fi{grid-area:Visualization;overflow:hidden;grid-column:1;-ms-grid-column:1;grid-row:2;-ms-grid-row:2}._3LyEBN4C2b31ykcXeMv6aW{grid-area:Footer;grid-column:1;-ms-grid-column:1;grid-row:3;-ms-grid-row:3}',""]),exports.locals={editWidgetDialog:"_2KZUiUWrvWBFPRy29xYVK7",editWidgetControls:"NC2KOFDZLwqfG809c1VQk",editWidgetControlsContent:"_2vwRxf2DcD5JZ4L1mYIPAj",gridContainer:"_1OtzAo-P7_UObrnhVSD-_S",QueryControls:"_2LYYZCVpn8KOHcrQeeVAb7",Visualization:"_2at144Njr8RXES-9Qoh5Fi",Footer:"_3LyEBN4C2b31ykcXeMv6aW"}},edGoRT7P:function(e,exports,t){(exports=e.exports=t("wTjlWjHz")(!1)).push([e.i,"._22-cQTgLvYcXuOEvjevsG{opacity:.3;position:relative;top:3px}",""]),exports.locals={button:"_22-cQTgLvYcXuOEvjevsG"}},osx3epUg:function(e,t,n){"use strict";n.r(t);var r=n("ivGQtwpr"),o=n.n(r),a=n("ii0bleBb"),i=n.n(a),c=n("VPaD/Np4"),l=n.n(c),u=n("CzyxmveH"),s=n("ZX4j5H1r"),f=n("a1VYJspU"),p=n("5stz06Uu"),d=n("kNK4w6Mc"),m=n("nHcjWeCO"),h=n.n(m),y=n("o39MkeR/"),b=n("x7QKyhPE"),g=n.n(b),v=n("AztyBNMT"),w=n("qoq4u5Uq"),O=n("nUOgBntn"),E=n("BNv59zh1");function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"all",r=function(e){return!Z(e.name)};switch(n){case"all":return t.filter(r);case"allreserved":return t;case"current":default:return e.filter(r)}},_renderFieldList:function(e){var t=this,n=e.fields,r=e.allFields,a=e.showFieldsBy,i=this.state,c=i.filter,l=i.viewMetadata,u=l.id,s=l.activeQuery,f=this.props.listHeight;if(!n)return o.a.createElement("span",null,"No field information available.");var p=c?function(e){return e.name.toLocaleUpperCase().includes(c.toLocaleUpperCase())}:function(){return!0},d=this._fieldsToShow(n,r,a).filter(p).sortBy((function(e){return e.name.toLocaleUpperCase()}));if(d.isEmpty())return o.a.createElement("i",null,"No fields to show. Try changing your filter term or select a different field set above.");return o.a.createElement("div",{ref:function(e){t.fieldList=e}},o.a.createElement(B.a,{height:f,itemCount:d.size,itemSize:17},(function(e){var r=e.index,o=e.style;return t._renderField({fieldType:d.get(r),selectedQuery:s,selectedView:u,fields:n,style:o})})))},handleSearch:function(e){var t=e.target.value;this.setState({filter:t})},handleSearchReset:function(){this.setState({filter:void 0})},changeShowFieldsBy:function(e){this.setState({showFieldsBy:e})},isCurrentShowFieldsBy:function(e){return this.state.showFieldsBy===e},showFieldsByLink:function(e,t,n){var r=this;return(o.a.createElement("a",{onClick:function(){return r.changeShowFieldsBy(e)},role:"button",tabIndex:0,title:n,style:{fontWeight:this.isCurrentShowFieldsBy(e)?"bold":"normal"}},t))},render:function(){var e=this.props,t=e.allFields,n=e.fields,r=this.state,a=r.filter,i=r.showFieldsBy;return o.a.createElement("div",{style:{whiteSpace:"break-spaces"}},o.a.createElement("form",{className:"form-inline ".concat(X.a.filterContainer),onSubmit:function(e){return e.preventDefault()}},o.a.createElement("div",{className:"form-group has-feedback ".concat(X.a.filterInputContainer)},o.a.createElement("input",{id:"common-search-form-query-input",className:"query form-control",style:{width:"100%"},onChange:this.handleSearch,value:a||"",placeholder:"Filter fields",type:"text",autoComplete:"off",spellCheck:"false"})),o.a.createElement("div",{className:"form-group"},o.a.createElement(w.c,{type:"reset",className:"reset-button",onClick:this.handleSearchReset},"Reset"))),o.a.createElement("div",{style:{marginTop:"5px",marginBottom:"0px"}},"List fields of"," ",this.showFieldsByLink("current","current streams","This shows fields which are (prospectively) included in the streams you have selected."),","," ",this.showFieldsByLink("all","all","This shows all fields, but no reserved (gl2_*) fields.")," or"," ",this.showFieldsByLink("allreserved","all including reserved","This shows all fields, including reserved (gl2_*) fields.")," fields."),o.a.createElement("hr",null),this._renderFieldList({fields:n,allFields:t,showFieldsBy:i}))}}),te=n("9pdI12pI"),ne=n.n(te),re=n("QDVhqBhn"),oe=n("+b6oEDsX"),ae=Object(f.a)(U.P,{currentUser:oe.default},(function(e){var t=e.currentUser;return{tz:Object(m.get)(t,"currentUser.timezone","UTC")}})),ie=function(e){var t=e.results,n=t.timestamp;return o.a.createElement("span",null,"Query executed in ",ne()(t.duration).format("0,0"),"ms at ",o.a.createElement(ae,{dateTime:n,format:re.a.Formats.DATETIME}),".")};ie.propTypes={results:i.a.object.isRequired};var ce=ie,le=n("m4G3HF66"),ue=n.n(le),se=n("ZQeiiyYL"),fe=u.default.div.withConfig({displayName:"NavItemstyles__Title",componentId:"sc-1whzhxd-0"})((function(e){var t=e.isSelected,n=e.expandRight,r=e.theme;return Object(u.css)(["padding:9px 10px;display:flex;align-items:center;cursor:pointer;position:relative;color:",";background:",";",""],t?r.color.variant.light.danger:"inherit",t?r.color.gray[10]:"tranparent",t&&n&&Object(u.css)(["&::after{content:' ';display:block;position:absolute;right:0;width:0;height:0;border-top:15px solid transparent;border-right:15px solid white;border-bottom:15px solid transparent;}"]))})),pe=u.default.div.withConfig({displayName:"NavItemstyles__TitleText",componentId:"sc-1whzhxd-1"})(["font-size:16px;display:inline;margin-left:10px;overflow:hidden;white-space:nowrap;"]),de=u.default.div.withConfig({displayName:"NavItemstyles__TitleIcon",componentId:"sc-1whzhxd-2"})(["width:25px;text-align:center;font-size:20px;cursor:pointer;"]),me=u.default.div.withConfig({displayName:"NavItemstyles__Content",componentId:"sc-1whzhxd-3"})((function(e){var t=e.isSelected,n=e.expandRight,r=e.theme;return Object(u.css)(["color:",";background:",";box-shadow:inset 0 13px 5px -10px ",",inset 0 -13px 5px -10px ",";"," ",""],se.d.readableColor(r.color.global.contentBackground),r.color.global.contentBackground,r.color.gray[80],r.color.gray[80],t?Object(u.css)(["padding:20px;"]):Object(u.css)(["max-height:0;"]),t&&n&&Object(u.css)(["position:absolute !important;top:0;left:100%;border:0;bottom:0;padding:20px;width:450px;overflow-y:hidden;"]))})),he="250px",ye="100%",be=u.default.div.withConfig({displayName:"Sidebarstyles__Container",componentId:"sc-14gk0n2-0"})((function(e){var t=e.open,n=e.theme;return Object(u.css)(["grid-row:1;-ms-grid-row:1;grid-column:1;-ms-grid-column:1;background:",";color:",";height:calc(100vh - 50px);padding-top:20px;position:",";top:50px;width:",";box-shadow:3px 0 3px rgba(0,0,0,0.25);z-index:",";"],n.color.gray[10],se.d.contrastingColor(n.color.gray[10],"AA"),t?"fixed":"static",t?he:ye,t?20:"auto")})),ge=u.default.div.withConfig({displayName:"Sidebarstyles__ContentOverlay",componentId:"sc-14gk0n2-1"})((function(e){var t=e.theme;return"\n  position: fixed;\n  top: 0;\n  bottom: 0;\n  left: ".concat(he,";\n  right: 0;\n  background: ").concat(ue()(t.color.brand.tertiary).alpha(.25).css(),";\n")})),ve=Object(u.default)(fe).withConfig({displayName:"Sidebarstyles__SidebarHeader",componentId:"sc-14gk0n2-2"})((function(e){var t=e.hasTitle,n=e.open;return"\n    justify-content: ".concat(n&&t?"space-between":n&&!t?"flex-end":"center","\n  ")})),we=u.default.h3.withConfig({displayName:"Sidebarstyles__Headline",componentId:"sc-14gk0n2-3"})(["color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]),Oe=u.default.div.withConfig({displayName:"Sidebarstyles__ToggleIcon",componentId:"sc-14gk0n2-4"})(["width:25px;text-align:center;font-size:20px;cursor:pointer;"]),Ee=u.default.div.withConfig({displayName:"Sidebarstyles__HorizontalRuler",componentId:"sc-14gk0n2-5"})(["width:100%;padding:0 10px;margin:5px 0 10px 0;&::after{content:' ';display:block;width:100%;border-bottom:1px solid currentColor;}"]),Se=n("2WniB+Gn"),je=n("ILDPzkX3"),Ce=n("D1pCKHnX"),_e=n("njftH3j9"),xe=u.default.div.withConfig({displayName:"ColorPreview",componentId:"sc-1whmn1g-0"})((function(e){var t=e.color;return"\n  height: 2rem;\n  width: 2rem;\n  margin-right: 0.4rem;\n\n  background-color: ".concat(t,";\n  border-radius: 4px;\n  border: 1px solid rgba(0,126,255,.24);\n")})),Pe=u.default.div.withConfig({displayName:"HighlightingRule__HighlightingRuleGrid",componentId:"sc-1h6a3-0"})(["display:grid;display:-ms-grid;margin-top:5px;grid-template-columns:max-content 1fr max-content;-ms-grid-columns:max-content 1fr max-content;word-break:break-word;> *:nth-child(1){grid-column:1;-ms-grid-column:1;}> *:nth-child(2){grid-column:2;-ms-grid-column:2;}> *:nth-child(3){grid-column:3;-ms-grid-column:3;}"]),Re=u.default.span.withConfig({displayName:"HighlightingRule__DeleteIcon",componentId:"sc-1h6a3-1"})((function(e){var t=e.theme;return"\n  width: 2rem;\n  height: 2rem;\n  margin-left: 0.4rem;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n\n  :active {\n    background-color: ".concat(t.color.gray[90],"\n  }\n")})),Te=function(e){var t=e.rule,n=t.field,o=t.value,a=t.color;return r.createElement(Pe,null,r.createElement(U.b,{id:"formatting-rule-color",placement:"right",color:a,colors:je.a.map((function(e){return[e]})),triggerNode:r.createElement(xe,{color:a}),onChange:function(e,n,r){return function(e,t,n){var r=e.toBuilder().color(t).build();return Ce.a.update(r).then(n)}(t,e,r)}}),r.createElement("div",null,"for ",r.createElement("strong",null,n)," = ",r.createElement("i",null,'"',o,'"'),"."),r.createElement(Re,{role:"presentation",title:"Remove this Highlighting Rule",onClick:function(e){return function(e,t){e.preventDefault(),window.confirm("Do you really want to remove this highlighting?")&&Ce.a.remove(t)}(e,t)}},r.createElement(U.r,{name:"trash-o"})))};Te.propTypes={rule:i.a.instanceOf(_e.a).isRequired};var qe=Te,ke=u.default.h4.withConfig({displayName:"HighlightingRules__Headline",componentId:"ri1t0l-0"})(["margin-bottom:10px;"]),De=function(e){var t=e.rules,n=void 0===t?[]:t;return r.createElement(r.Fragment,null,r.createElement(ke,null,"Highlighting"),r.createElement(Pe,null,r.createElement(xe,{color:je.b}),r.createElement("div",null,"Search terms")),n.map((function(e){return r.createElement(qe,{key:"".concat(e.field,"-").concat(e.value,"-").concat(e.color),rule:e})})))};De.propTypes={rules:i.a.arrayOf(i.a.instanceOf(_e.a))},De.defaultProps={rules:[]};var Ie=Object(f.a)(De,{rules:Ce.b}),Ne=n("P4PkhE7l"),Ae=function(e){var t=e.isOpen,n=e.isSelected,o=e.expandRight,a=e.text,i=e.children,c=e.icon,l=e.onClick;return r.createElement(r.Fragment,null,r.createElement(fe,{role:"presentation",onClick:l,isSelected:n,expandRight:o},r.createElement(de,null,r.createElement(U.r,{name:c})),t&&r.createElement(pe,null,a)),r.createElement(Ne.SizeMe,{monitorHeight:!0,refreshRate:100},(function(e){var t=e.size;return r.createElement(me,{isSelected:n,expandRight:o},n&&i?r.cloneElement(i,{listHeight:t.height-150}):r.createElement("span",null))})))};Ae.propTypes={isOpen:i.a.bool.isRequired,isSelected:i.a.bool.isRequired,expandRight:i.a.bool,text:i.a.string.isRequired,icon:i.a.node.isRequired,children:Se.a.OneOrMoreChildren.isRequired},Ae.defaultProps={expandRight:!1};var Fe=Ae,Me=function(e){var t=e.children;return r.createElement(y.a.Consumer,null,(function(e){return e===E.a.Type.Dashboard?t:null}))},Be=u.default.div.withConfig({displayName:"ViewDescription__Section",componentId:"bgxcm-0"})(["margin-bottom:8px;"]),We=function(e){var t,n=e.results,r=e.viewMetadata;return o.a.createElement(o.a.Fragment,null,o.a.createElement(Me,null,o.a.createElement(Be,null,r.summary||"No dashboard summary.")),o.a.createElement(Be,null,o.a.createElement(ce,{results:n})),o.a.createElement(Me,null,(t=r.description)?o.a.createElement("span",null,t):o.a.createElement("i",null,"No dashboard description.")))};We.propTypes={results:i.a.object.isRequired,viewMetadata:i.a.object.isRequired};var Ue=We;function ze(e){return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function He(e,t){for(var n=0;n0||a.size>0),config:l.searchesClusterConfig}}))},nt=n("fQFnrO3i"),rt=n("mc0qlNhN"),ot=n("wD38vQiO"),at=n("DhH+qDSx"),it=n("jHp4XH0b"),ct=n("7FNpc8B3"),lt=n("GaFHk8Qk"),ut=n.n(lt),st=n("KOxT6Zq/"),ft=n("byBhmxoq"),pt=n("UVNAt66+"),dt=n("8fes3XGF"),mt=(n("x2em8Xxx"),r.createContext()),ht=n("W+sNG9T1"),yt=n("yAGW00IN"),bt=n("GKX6fI9b"),gt=(n("KfSeOhGw"),n("CzKTWkBc")),vt=n("qTgaWzTN"),wt=(n("Rlm4c8Vs"),n("3d1pthdj")),Ot=n("Vt7OX4hg");function Et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var St=function(e,t,n){if(n.type===E.a.Type.Dashboard){var r=Object(c.Map)(t.search.queries.map((function(e){return[e.id,e]}))),o=function(e,t){return t.state.reduce((function(t,n,r){if(t)return t;var o=n.widgets.find((function(t){return t.id===e}));return o?[o,r]:void 0}),void 0)}(e,t);if(o){var a=Et(o,2),i=a[0],l=a[1],u=r.get(l),s=u.timerange,f=u.query,p=u.filter,d=void 0===p?Object(c.Map)():p,m=(d?d.get("filters",c.List.of()):c.List.of()).filter((function(e){return c.Map.isMap(e)&&"stream"===e.get("type")})).map((function(e){return e.get("id")})).toList().toArray(),h=i.toBuilder().timerange(s).query(f).streams(m).build();return Object(Ot.a)(function(e,t){var n=t.state.keySeq().first(),r=t.state.get(n),o=r.toBuilder().widgets(r.widgets.push(e)).build();return t.toBuilder().state(t.state.set(n,o)).build()}(h,n))}}},jt=n("E39+xTvN"),Ct=(n("eWdw6qgJ"),n("XioOavq4")),_t=(n("KqMTHfNP"),n("BE2BCqmw")),xt=n("4ysf/eyx"),Pt=n("B4BR5PLd"),Rt=n("n+S0ZchN"),Tt=function(e){var t=e.selectedWidget,n=e.view.getWidgetTitleByWidget(t);return r.createElement(w.I,null,r.createElement("i",null,r.createElement(ct.a,null,t&&"The following settings are based on the message table: ".concat(n),r.createElement("br",null)),r.createElement(Me,null,t&&"You are currently exporting the search results for the message table: ".concat(n),r.createElement("br",null))))},qt=function(e){var t=e.fields,n=e.selectedWidget,o=e.selectField,a=e.selectedFields,i=e.setLimit,c=e.limit,l=e.view;return r.createElement(r.Fragment,null,n&&r.createElement(Tt,{selectedWidget:n,view:l}),r.createElement(w.I,null,r.createElement("p",null,"Define the fields for your CSV file. You can change the field order with drag and drop.",r.createElement("br",null)),n&&r.createElement("p",null,"The export supports fields created by decorators which are part of the message table, but they currently do not appear in the field list. If you want to export a decorated field, just enter its name."),r.createElement("p",null,"When you've finished the configuration, click on ",r.createElement("q",null,"Start Download"),".")),r.createElement(w.I,null,r.createElement("label",{htmlFor:"export-fields"},"Fields to export"),r.createElement(Rt.a,{fields:t,onChange:o,value:a,allowOptionCreation:!!n,inputId:"export-fields"})),r.createElement(w.I,null,r.createElement("label",{htmlFor:"export-limit"},"Messages limit"),r.createElement(Pt.d,{type:"number",id:"export-limit",onChange:function(e){var t=e.target.value;return i(Number(t))},min:1,step:1,value:c})),r.createElement(w.I,null,"Messages are loaded in chunks. If a limit is defined, all chunks up to the one where the limit is reached will be retrieved. Which means the total number of delivered messages can be higher than the defined limit."))},kt=n("8vxGD2P+"),Dt=n("qkBqSRsU"),It=function(e){var t=e.selectWidget,n=e.widgets,o=e.view,a=n.map((function(e){return function(e){return{label:o.getWidgetTitleByWidget(e),value:e}}(e)})).toArray().sort((function(e,t){return Object(kt.a)(e.label,t.label)}));return r.createElement(r.Fragment,null,r.createElement(w.I,null,r.createElement(ct.a,null,"The CSV file will contain all messages for your current search.",r.createElement("br",null),"Please select a message table to adopt its fields. You can adjust all settings in the next step."),r.createElement(Me,null,"Please select the message table you want to export the search results for. You can adjust its fields in the next step.",r.createElement("br",null),'Selecting a message table equals using the option "Export to CSV" in a message table action menu.')),0!==n.size?r.createElement(w.I,null,r.createElement("label",{htmlFor:"widget-selection"},"Select message table"),r.createElement(Dt.a,{placeholder:"Select message table",onChange:t,options:a,inputId:"widget-selection"})):r.createElement(w.I,null,r.createElement(w.a,{bsStyle:"warning"},"You need to create a message table widget to export its result.")))},Nt=n("DX4TkA2V"),At=n.n(Nt),Ft=n("72UfWcJe"),Mt=n("GZfD0NTG"),Bt=n("8GJ6oOEd"),Wt=n("QlBQbb2U"),Ut=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"search-result";At()(e,"".concat(t,".csv"),"text/csv")},zt=function(e,t,n,r){var o=Wt.a.MessagesController.exportSearchType(t,n,r).url;return Object(Ft.c)("POST",Object(Mt.d)(o),e).then((function(e){return Ut(e,r)})).catch((function(){Bt.a.error("CSV Export for widget failed")}))},Ht=function(e,t){return e.find((function(e){return e.id===t}))},Lt=function(e,t,n,r,o){if(1!==t.size)throw new Error("Searches must only have a single query!");return n?zt(e,r,n.id,o):function(e,t,n){var r=Wt.a.MessagesController.exportSearch(t).url;return Object(Ft.c)("POST",Object(Mt.d)(r),e).then((function(e){return Ut(e,n)})).catch((function(){Bt.a.error("CSV Export failed")}))}(e,r,o)},Vt={title:"Export all search results to CSV",shouldEnableDownload:function(e,t,n,r){return!r&&!e&&!!n&&n.length>0},shouldAllowWidgetSelection:function(e,t,n){return!e&&!t&&n.size>1},shouldShowWidgetSelection:function(e,t,n){return!e&&!t&&n.size>1},initialWidget:function(e,t){return t?Ht(e,t):1===e.size?e.first():null},downloadFile:function(e,t,n,r,o){return Lt(e,t,n,r,o)}},Qt={title:"Export message table search results to CSV",shouldEnableDownload:function(e,t,n,r){return!r&&!!t&&!!n&&n.length>0},shouldAllowWidgetSelection:function(e,t){return!e&&!t},shouldShowWidgetSelection:function(e,t){return!e&&!t},initialWidget:function(e,t){return t?Ht(e,t):null},downloadFile:function(e,t,n,r,o){return function(e,t,n,r){if(!t)throw new Error("CSV exports on a dashboard require a selected widget!");return zt(e,n,t.id,r)}(e,n,r,o)}},Gt=function(e){switch(e){case E.a.Type.Dashboard:return Qt;case E.a.Type.Search:default:return Vt}},Kt=n("H1SnJhgx"),Jt=function(e){var t,n=e.type,r=e.capitalize,o=n.toLowerCase();return r?(t=o)[0].toUpperCase()+t.slice(1):o};Jt.propTypes={type:i.a.string.isRequired,capitalize:i.a.bool},Jt.defaultProps={capitalize:!1};var Yt=Jt,Xt=function(e,t,n,r,o,a){var i={execution_state:n,fields_in_order:o.map((function(e){return e.field})),limit:a},c=r?t.getSearchTypeByWidgetId(r.id):void 0,l=function(e,t){var n="search-result";if(t){var r=e.getWidgetTitleByWidget(t);n="".concat(r,"-").concat(n)}else{var o=e.title||"Untitled ".concat(Yt({type:e.type,capitalize:!0}));n="".concat(o,"-").concat(n)}return Kt.a.replaceSpaces(n,"-")}(t,r);return e(i,t.search.queries,c,t.search.id,l)};function Zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function en(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function tn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function nn(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var lr=Object(u.default)(w.k).withConfig({displayName:"TimeRangeDropdownButton__StyledDropdownButton",componentId:"sc-1rmks06-0"})(["padding:6px 7px;margin-right:5px;"]),ur=function(e){var t=e.onSelect,n=e.children,o=e.disabled,a=cr(e,["onSelect","children","disabled"]);return r.createElement(lr,ir({},a,{bsStyle:"info",disabled:o,id:"timerange-type",title:r.createElement(U.r,{name:"clock"}),onSelect:t}),n)};ur.defaultProps={disabled:!1};var sr=ur,fr=n("2gEPIf6i"),pr=n.n(fr),dr=function(e){return e.toString(re.a.Formats.TIMESTAMP)},mr=function(e){switch(e.type){case"absolute":return{type:e.type,from:re.a.parseFromString(e.from).toISOString(),to:re.a.parseFromString(e.to).toISOString()};case"relative":return{type:e.type,range:e.range};case"keyword":return e;default:throw new Error("Invalid time range type: ".concat(e.type))}},hr=function(e){switch(e.type){case"absolute":return{type:e.type,from:dr(re.a.parseFromString(e.from)),to:dr(re.a.parseFromString(e.to))};case"relative":return{type:e.type,range:e.range};case"keyword":return e;default:throw new Error("Invalid time range type: ".concat(e.type))}},yr={absolute:function(e){return{type:"absolute",from:dr(new re.a(pr()().subtract(e&&"relative"===e.type?e.range:300,"seconds"))),to:dr(new re.a(pr()()))}},relative:function(){return{type:"relative",range:300}},keyword:function(){return{type:"keyword",keyword:"Last five minutes"}},disabled:function(){}},br=function(e,t){if(t===(e?e.type:"disabled"))return e;if(!yr[t])throw new Error("Invalid time range type: ".concat(t));return yr[t](e)},gr=function(e){return je.i.map((function(t){var n=t.type,o=t.name;return r.createElement(w.v,{key:"time-range-type-selector-".concat(n),eventKey:n,active:e===n},o)}))};function vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function wr(e){var t=e.disabled,n=vr(Object(tr.e)("timerange"),1)[0],o=n.value,a=n.onChange,i=n.name,c=o.type,l=Object(r.useCallback)((function(e){return a({target:{value:br(o,e),name:i}})}),[a,o]);return r.createElement(w.e,{className:"pull-left"},r.createElement(sr,{disabled:t,onSelect:l},gr(c)))}function Or(){return(Or=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}wr.propTypes={disabled:Se.a.bool},wr.defaultProps={disabled:!1};var Sr=u.default.div.withConfig({displayName:"TimerangeSelector__TimerangeWrap",componentId:"sc-1oa3haa-0"})((function(e){var t=e.theme;return"\n  .form-group {\n    margin-bottom: 0;\n  }\n\n  .relative {\n    color: ".concat(t.color.gray[40],";\n  }\n\n  .absolute {\n    font-size: 12px;\n  }\n")})),jr=function(e){var t=e.className,n=e.children,r=Er(e,["className","children"]);return o.a.createElement(Sr,Or({className:t},r),n)};jr.propTypes={className:i.a.string,children:i.a.node.isRequired},jr.defaultProps={className:void 0};var Cr=jr,_r=n("Se3GJyty"),xr=function(e){var t=e.disabled,n=void 0!==t&&t,o=e.error,a=e.value,i=e.onBlur,c=void 0===i?function(){}:i,l=e.onChange,u=e.name,s=e.title,f=Object(r.useCallback)((function(e){return l({target:{name:u,value:e}})}),[l]),p=Object(r.useCallback)((function(e){return f(function(e){var t=e.setHours(0);return re.a.ignoreTZ(t)}(e).toString(re.a.Formats.TIMESTAMP))}),[f]),d=Object(r.useCallback)((function(){return f((new re.a).toString(re.a.Formats.TIMESTAMP))}),[f]);return r.createElement(U.h,{id:"date-input-datepicker-".concat(u),disabled:n,title:s,date:a,onChange:p},r.createElement(_r.a,{type:"text",id:"date-input-".concat(u),name:u,disabled:n,className:"absolute",value:a,onBlur:c,onChange:l,placeholder:re.a.Formats.DATETIME,buttonAfter:r.createElement(w.c,{disabled:n,onClick:d,title:"Insert current date"},r.createElement(U.r,{name:"magic"})),bsStyle:o?"error":null,required:!0}))};xr.propTypes={disabled:i.a.bool,error:i.a.string,value:i.a.oneOfType([i.a.object,i.a.string]),onBlur:i.a.func,onChange:i.a.func.isRequired,name:i.a.string.isRequired,title:i.a.string},xr.defaultProps={disabled:!1,onBlur:function(){},error:void 0,value:void 0,title:""};var Pr=xr,Rr=Object(u.default)(Cr).withConfig({displayName:"AbsoluteTimeRangeSelector__StyledTimerangeSelector",componentId:"wqj7aa-0"})(["display:flex;"]),Tr=u.default.div.withConfig({displayName:"AbsoluteTimeRangeSelector__InputWrap",componentId:"wqj7aa-1"})(["width:200px;"]),qr=u.default.p.withConfig({displayName:"AbsoluteTimeRangeSelector__Separator",componentId:"wqj7aa-2"})(["margin:0;line-height:34px;font-size:18px;padding-left:15px;padding-right:15px;"]),kr=function(e){if(void 0!==e)return re.a.isValidDateString(e)?void 0:"Invalid date: ".concat(e)},Dr=function(e){var t=e.disabled;return r.createElement(Rr,{className:"absolute"},r.createElement(tr.a,{name:"timerange.from",validate:kr},(function(e){var n=e.field,o=n.value,a=n.onChange,i=n.onBlur,c=n.name,l=e.meta.error;return r.createElement(Tr,null,r.createElement(Pr,{disabled:t,onChange:a,onBlur:i,value:o,name:c,title:"Search start date",error:l}))})),r.createElement(qr,{className:"text-center"},r.createElement(U.r,{name:"long-arrow-alt-right"})),r.createElement(tr.a,{name:"timerange.to",validate:kr},(function(e){var n=e.field,o=n.value,a=n.onChange,i=n.onBlur,c=n.name,l=e.meta.error;return r.createElement(Tr,null,r.createElement(Pr,{disabled:t,onChange:a,onBlur:i,value:o,name:c,title:"Search end date",error:l}))})))};Dr.propTypes={disabled:i.a.bool},Dr.defaultProps={disabled:!1};var Ir=Dr,Nr=n("1VnJesae");function Ar(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Fr=Nr.a.getStore("Tools"),Mr=Object(u.default)(w.a).withConfig({displayName:"KeywordTimeRangeSelector__KeywordPreview",componentId:"sc-1twg90-0"})(["display:flex;align-items:center;min-height:34px;padding-top:5px;padding-bottom:5px;margin-top:0 !important;"]),Br=Object(u.default)(w.m).withConfig({displayName:"KeywordTimeRangeSelector__KeywordInput",componentId:"sc-1twg90-1"})(["min-height:34px;font-size:14px;"]),Wr=function(e){var t=e.disabled,n=Ar(Object(r.useState)(c.Map()),2),o=n[0],a=n[1],i=Object(r.useCallback)((function(e){return a(function(e){var t=re.a.fromUTCDateTime(e.from).toString(),n=re.a.fromUTCDateTime(e.to).toString();return c.Map({from:t,to:n})}(e))}),[a]),l=Object(r.useCallback)((function(){return a(c.Map()),"Unable to parse keyword."}),[a]),u=Object(tr.f)(),s=Object(r.useCallback)((function(e){return function(e,t,n){if(void 0!==e)return""===Object(m.trim)(e)?Promise.resolve("Keyword must not be empty!"):Fr.testNaturalDate(e).then(t,n)}(e,i,l)}),[i,l]);Object(r.useEffect)((function(){var e=u.values.timerange.keyword;return Fr.testNaturalDate(e).then(i,l),function(){return u.unregisterField("timerange.keyword")}}),[]);var f=o.toObject(),p=f.from,d=f.to,h=!o.isEmpty()&&r.createElement(Mr,{bsStyle:"info"},r.createElement("strong",{style:{marginRight:8}},"Preview:"),p," to ",d);return r.createElement(w.I,{className:"no-bm",style:{marginLeft:50}},r.createElement(w.h,{xs:3,style:{padding:0}},r.createElement(tr.a,{name:"timerange.keyword",validate:s},(function(e){var n=e.field,o=n.name,a=n.value,i=n.onChange,c=e.meta.error;return r.createElement(w.n,{controlId:"form-inline-keyword",style:{marginRight:5,width:"100%",marginBottom:0},validationState:c?"error":null},r.createElement(w.q,null,r.createElement(Br,{type:"text",className:"input-sm",name:o,disabled:t,placeholder:"Last week",onChange:i,required:!0,value:a})))}))),r.createElement(w.h,{xs:8,style:{paddingRight:0}},h))};Wr.propTypes={disabled:i.a.bool},Wr.defaultProps={disabled:!1};var Ur=Object(tr.d)(Wr);function zr(e){var t,n=e.config,o=e.disabled,a=n.relative_timerange_options,i=pr.a.duration(n.query_time_range_limit);if(a){var c=null;t=Object.keys(a).map((function(e){var t=pr.a.duration(e).asSeconds();if(i.seconds()>0&&(t>i.asSeconds()||0===t))return null;var n=r.createElement("option",{key:"relative-option-".concat(e),value:t},a[e]);return"PT0S"===e?(c=n,null):n})),c&&t.push(c)}else t=r.createElement("option",{value:"300"},"Loading...");return r.createElement(tr.a,{name:"timerange.range"},(function(e){var n=e.field,a=n.name,i=n.value,c=n.onChange,l=Object(r.useCallback)((function(e){var t=e.target.value;c({target:{name:a,value:Number.parseInt(t,10)}})}),[c]);return r.createElement(Cr,{className:"relative",style:{marginLeft:50}},r.createElement(_r.a,{id:"relative-timerange-selector",disabled:o,type:"select",value:i,title:"Select a relative time range",className:"relative",name:a,onChange:l},t))}))}zr.propTypes={config:i.a.shape({relative_timerange_options:i.a.object.isRequired,query_time_range_limit:i.a.string.isRequired}).isRequired,disabled:i.a.bool},zr.defaultProps={disabled:!1};var Hr=function(){return r.createElement(Cr,{style:{marginLeft:50}},r.createElement(_r.a,{id:"no-override-timerange-selector",type:"select",disabled:!0,value:"disabled",title:"There is no override for the timerange currently selected",name:"no-override"},r.createElement("option",{value:"disabled"},"No Override")))};function Lr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Vr={absolute:{component:Ir},relative:{component:zr},keyword:{component:Ur}};function Qr(e){var t,n=e.disabled,o=e.config,a=Lr(Object(tr.e)("timerange.type"),1)[0].value,i=((t=a)&&Vr[t]||{component:Hr}).component;return r.createElement(i,{disabled:n,config:o})}Qr.propTypes={config:i.a.shape({relative_timerange_options:i.a.objectOf(i.a.string).isRequired}).isRequired,disabled:i.a.bool},Qr.defaultProps={disabled:!1};var Gr=n("sDkqyLXF"),Kr=function(e){var t=e.disabled,n=e.value,r=e.streams,a=e.onChange,i=n.join(","),c="Select streams the search should include. Searches in all streams if empty.",l=r.sort((function(e,t){var n=e.key,r=t.key;return Object(kt.a)(n,r)}));return o.a.createElement("div",{style:{position:"relative",zIndex:10},"data-testid":"streams-filter",title:c},o.a.createElement(Gr.a,{placeholder:c,disabled:t,displayKey:"key",inputId:"streams-filter",onChange:function(e){return a(""===e?[]:e.split(","))},options:l,multi:!0,value:i}))};Kr.propTypes={disabled:i.a.bool,value:i.a.arrayOf(i.a.string),streams:i.a.arrayOf(i.a.shape({key:i.a.string.isRequired,value:i.a.string.isRequired})).isRequired,onChange:i.a.func.isRequired},Kr.defaultProps={disabled:!1,value:[]};var Jr=Kr,Yr=Object(u.default)(w.c).withConfig({displayName:"SearchButton__StyledButton",componentId:"mm3q5z-0"})(["margin-right:7px;"]),Xr=Object(u.default)(Yr).withConfig({displayName:"SearchButton__DirtyButton",componentId:"mm3q5z-1"})((function(e){var t=e.theme;return"\n  position: relative;\n\n  &::after {\n    position: absolute;\n    content: '';\n    height: 16px;\n    width: 16px;\n    top: -5px;\n    right: -6px;\n    border-radius: 50%;\n    background-color: ".concat(t.color.variant.warning,";\n  }\n")})),Zr=function(e){var t=e.disabled,n=e.glyph,r=e.dirty,a=r?Xr:Yr,i=r?"Perform search (changes were made after last search execution)":"Perform search";return o.a.createElement(a,{type:"submit",bsStyle:"success",disabled:t,title:i,className:"pull-left"},o.a.createElement(U.r,{name:n}))};Zr.defaultProps={disabled:!1,dirty:!1,glyph:"search"},Zr.propTypes={disabled:i.a.bool,dirty:i.a.bool,glyph:i.a.string};var $r=Zr,eo=n("M19gleAP"),to=Object(eo.a)((function(){return Promise.all([n.e("d7fbfcf5-11"),n.e("d7fbfcf5-61"),n.e("d7fbfcf5-54")]).then(n.bind(null,"qgIHcCM2"))})),no=function(e){var t=e.initialValues,n=e.onSubmit,o=e.children,a=Object(r.useCallback)((function(e){var t=e.timerange,r=e.streams,o=e.queryString,a=mr(t);return n({timerange:a,streams:r,queryString:o})}),[n]),i=t.timerange,c=t.streams,l={queryString:t.queryString,streams:c,timerange:hr(i)};return r.createElement(tr.c,{initialValues:l,enableReinitialize:!0,onSubmit:a},(function(){return r.createElement(tr.b,null,Object(m.isFunction)(o)?o.apply(void 0,arguments):o)}))};no.propTypes={initialValues:i.a.shape({timerange:i.a.object.isRequired,queryString:i.a.string.isRequired,streams:i.a.arrayOf(i.a.string).isRequired}).isRequired,onSubmit:i.a.func.isRequired};var ro=no;function oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var co=u.default.div.withConfig({displayName:"WidgetQueryControls__BlurredWrapper",componentId:"sc-1hhyqwz-0"})(["filter:blur(4px);"]),lo=u.default.div.withConfig({displayName:"WidgetQueryControls__CenteredBox",componentId:"sc-1hhyqwz-1"})(["position:absolute;background:white;padding:10px 15px 10px 15px;border-color:lightgray;border-radius:2px;border-width:1px;border-style:solid;box-shadow:3px 3px 3px darkgrey;z-index:1;left:0;right:0;width:max-content;margin:0 auto;"]),uo=Object(u.default)(nr.a).withConfig({displayName:"WidgetQueryControls__ResetFilterButton",componentId:"sc-1hhyqwz-2"})(["margin-left:5px;vertical-align:initial;"]),so=function(){return ar.a.reset().then(gt.a.refresh)},fo=function(){return r.createElement(lo,null,"These controls are disabled, because a filter is applied to all widgets."," ",r.createElement(uo,{bsSize:"xs",bsStyle:"primary","data-testid":"reset-filter",onClick:so},"Reset filter"))},po=function(e){var t=e.availableStreams,n=e.config,o=e.globalOverride,a=void 0===o?{}:o,i=e.widget,c=i.streams,l=i.timerange||je.e,u=(i.query||Object(wt.a)("")).query_string,s=null!=a&&(void 0!==a.query||void 0!==a.timerange),f=s?co:r.Fragment,p=Object(r.useCallback)((function(e){return function(e,t){var n=e.timerange,r=e.streams,o=e.queryString,a=t.toBuilder().timerange(n).query(Object(wt.a)(o)).streams(r).build();return yt.a.update(t.id,a)}(e,i)}),[i]);return r.createElement(r.Fragment,null,s&&r.createElement(fo,null),r.createElement(f,null,r.createElement(ro,{initialValues:{timerange:l,streams:c,queryString:u},onSubmit:p},(function(e){var o=e.dirty,a=e.isSubmitting,i=e.isValid,c=e.handleSubmit;return r.createElement(r.Fragment,null,r.createElement(rr,null,r.createElement(w.h,{md:4},r.createElement(wr,{disabled:s}),r.createElement(Qr,{disabled:s,config:n})),r.createElement(w.h,{md:8},r.createElement(tr.a,{name:"streams"},(function(e){var n=e.field,o=n.name,a=n.value,i=n.onChange;return r.createElement(Jr,{value:a,disabled:s,streams:t,onChange:function(e){return i({target:{value:e,name:o}})}})})))),r.createElement(w.I,{className:"no-bm"},r.createElement(w.h,{md:12},r.createElement("div",{className:"pull-right search-help"},r.createElement(it.a,{page:rt.a.PAGES.SEARCH_QUERY_LANGUAGE,title:"Search query syntax documentation",text:r.createElement(U.r,{name:"lightbulb-o"})})),r.createElement($r,{running:a,disabled:s||a||!i,dirty:o}),r.createElement(tr.a,{name:"queryString"},(function(e){var t=e.field,n=t.name,o=t.value,a=t.onChange;return r.createElement(to,{value:o,disabled:s,placeholder:'Type your search query here and press enter. E.g.: ("not found" AND http) OR http_response_code:[400 TO 404]',onChange:function(e){return a({target:{value:e,name:n}}),Promise.resolve()},onExecute:c})})))))}))))};po.propTypes={};var mo=Object(f.a)(po,{availableStreams:or.b,configurations:Xe.b,globalOverride:ar.b},(function(e){var t=e.availableStreams.streams,n=void 0===t?[]:t,r=e.configurations;return function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Ao=function(e){e.className;var t=e.children,n=(e.bsClass,No(e,["className","children","bsClass"]));return r.createElement(w.x.Dialog,Io({},n,{dialogClassName:yo.a.editWidgetDialog}),r.createElement("div",{className:yo.a.gridContainer},t))};Ao.propTypes={className:i.a.string.isRequired,children:i.a.node.isRequired};var Fo,Mo,Bo,Wo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qo(e,t)}(i,e);var t,n,o,a=function(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=Do(e);if(t()){var o=Do(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ko(this,n)}}(i);function i(){return Ro(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"componentWillMount",value:function(){go.a.use()}},{key:"componentWillUnmount",value:function(){go.a.unuse()}},{key:"render",value:function(){var e=this.props.children;return r.createElement(w.x,{show:!0,animation:!1,dialogComponentClass:Ao,enforceFocus:!1},r.createElement(Me,null,r.createElement(w.x.Header,{className:yo.a.QueryControls},r.createElement(er.Provider,{value:"widget"},r.createElement(wo,null),r.createElement(mt.Consumer,null,(function(e){return r.createElement(mo,{widget:e})}))))),r.createElement(w.x.Body,{className:yo.a.Visualization},r.createElement("div",{role:"presentation",style:{height:"100%"}},r.createElement(xo,null,e[0]))),r.createElement(w.x.Footer,{className:yo.a.Footer},e[1]))}}])&&To(t.prototype,n),o&&To(t,o),i}(r.Component);Fo=Wo,Mo="propTypes",Bo={children:i.a.node.isRequired},Mo in Fo?Object.defineProperty(Fo,Mo,{value:Bo,enumerable:!0,configurable:!0,writable:!0}):Fo[Mo]=Bo;var Uo=n("AkqSYE8I"),zo=n.n(Uo),Ho=function(){return o.a.createElement("div",{className:zo.a.spinnerContainer},o.a.createElement(U.r,{"data-testid":"loading-widget",name:"refresh",size:"3x",className:"spinner"}))};Ho.propTypes={};var Lo=Ho,Vo=n("oIo0rjXT"),Qo=n("26nXiCx+"),Go=function(e){var t=e.onFinish,n=e.onCancel;return r.createElement(r.Fragment,null,r.createElement(w.c,{onClick:t,bsStyle:"primary"},"Save"),r.createElement(w.c,{onClick:n},"Cancel"))},Ko=n("K5MyyuhP");function Jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xo(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0?o.a.createElement(w.t,null,v):o.a.createElement("span",null,"No dashboards found");return o.a.createElement(w.x,{show:!0},o.a.createElement(w.x.Body,null,o.a.createElement(U.F,{onSearch:y,onReset:b}),o.a.createElement(U.B,{onChange:g,activePage:m.page,totalItems:l.total,pageSize:m.perPage,pageSizes:[5,10,15]},O)),o.a.createElement(w.x.Footer,null,o.a.createElement(w.c,{bsStyle:"primary",disabled:null===f,onClick:function(){return u(t,f)}},"Select"),o.a.createElement(w.c,{onClick:n},"Cancel")))}),{dashboards:la.b});function ma(e){return(ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ha(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ya(e,t){for(var n=0;n0)return r.createElement(Vo.a,{errors:a});if(o){var c=t.state.editing,l=t.props,u=l.id,s=l.widget,f=l.height,p=l.width,d=l.fields,m=s.config,h=s.filter,y=(e=s.type,Object(at.c)(e).visualizationComponent);return r.createElement(y,{config:m,data:o,editing:c,fields:d,filter:h,height:f,onConfigChange:function(e){return t._onWidgetConfigChange(u,e)},setLoadingState:t._setLoadingState,title:i,toggleEdit:t._onToggleEdit,type:s.type,width:p,id:u})}return r.createElement(Lo,null)}));var n=e.editing;return t.state={editing:n,loading:!1,showCopyToDashboard:!1,showCsvExport:!1},n&&(t.state=function(e){for(var t=1;t0?o.a.createElement(ft.a,{animate:!0,locked:a,columns:{xxl:12,xl:12,lg:12,md:12,sm:12,xs:12},measureBeforeMount:!0,onPositionsChange:i,positions:u,useDragHandle:".widget-drag-handle"},l):o.a.createElement("span",null);return o.a.createElement(Ja,null,s,t)}}]),n}(o.a.Component);Ka(Za,"propTypes",{allFields:Se.a.FieldListType.isRequired,data:Qo.c.isRequired,errors:Qo.e.isRequired,fields:Se.a.FieldListType.isRequired,locked:i.a.bool,onPositionsChange:i.a.func.isRequired,positions:Qo.b,staticWidgets:i.a.arrayOf(i.a.node),titles:ut.a.map.isRequired,widgets:Qo.f.isRequired}),Ka(Za,"defaultProps",{locked:!0,staticWidgets:[],positions:{}});var $a=Object(f.a)(Za,{titles:pt.c}),ei=Object(u.default)(w.r).withConfig({displayName:"Query__StyledJumbotron",componentId:"sc-1mdthhv-0"})((function(e){var t=e.theme;return"\n  .container-fluid & {\n    border: 1px solid ".concat(t.color.gray[80],";\n    border-top-left-radius: 0;\n    border-top-right-radius: 0;\n    margin-bottom: 0;\n  }\n")})),ti=function(e,t,n,r,a,i,c){var u={},s={},f={},p=n.searchTypes;return e.forEach((function(e){var r=Object(at.c)(e.type).searchResultTransformer||function(e){return e},o=t[e.id]||[],a=o.map((function(e){return p[e]})).filter((function(e){return e})),i=n.errors.filter((function(e){return o.includes(e.searchTypeId)}));if(u[e.id]=e,s[e.id]=r(a,e),i&&i.length>0&&(f[e.id]=i),!a||0===a.length){var c=n.errors.filter((function(e){return"query"===e.type}));c.length>0&&(f[e.id]=f[e.id]?[].concat(f[e.id],c):c)}})),o.a.createElement(ca.a.Consumer,null,(function(e){return o.a.createElement($a,{allFields:c,data:s,errors:f,fields:i,locked:!e,onPositionsChange:function(e){return function(e){var t=l.a.Map(e.map((function(e){var t=e.col,n=e.height,r=e.row,o=e.width;return[e.id,new dt.a(t,r,n,o>=12?1/0:o)]}))).toJS();ot.a.widgetPositions(t)}(e)},positions:r,widgets:u})}))},ni=function(){return o.a.createElement(ei,null,o.a.createElement("h2",null,o.a.createElement(Me,null,"This dashboard has no widgets yet"),o.a.createElement(ct.a,null,"There are no widgets defined to visualize the search result")),o.a.createElement("br",null),o.a.createElement("p",null,'Create a new widget by selecting a widget type in the left sidebar section "Create".',o.a.createElement("br",null)),o.a.createElement("p",null,"A few tips for creating searches and dashboards"),o.a.createElement("ul",null,o.a.createElement("li",null,o.a.createElement("p",null,"1. Start with a ",o.a.createElement("b",null,"question")," you want to answer. Define the problem you want to solve.")),o.a.createElement("li",null,o.a.createElement("p",null,"2. ",o.a.createElement("b",null,"Limit")," the data to only the data points you want to see.")),o.a.createElement("li",null,o.a.createElement("p",null,"3. ",o.a.createElement("b",null,"Visualize")," the data. Does it answer your question?")),o.a.createElement(Me,null,o.a.createElement("li",null,o.a.createElement("p",null,"4. ",o.a.createElement("b",null,"Share")," the dashboard with your colleagues. Prepare it for ",o.a.createElement("b",null,"reuse")," by using parameters (contained in ",o.a.createElement("a",{href:"https://www.graylog.org/graylog-enterprise-edition",target:"_blank",rel:"noopener noreferrer"},"Graylog Enterprise"),").")))),o.a.createElement("p",null,"You can also have a look at the ",o.a.createElement(it.a,{page:rt.a.PAGES.DASHBOARDS,text:"documentation"}),", to learn more about the widget creation."))},ri=function(e){var t=e.allFields,n=e.fields,r=e.results,a=e.positions,i=e.widgetMapping,c=e.widgets;e.queryId;if(!c||c.isEmpty())return o.a.createElement(ni,null);if(r){var l=ti(c,i.toJS(),r,a,0,n,t);return o.a.createElement("span",null,l)}return o.a.createElement(U.L,null)};ri.propTypes={allFields:i.a.object.isRequired,fields:i.a.object.isRequired,positions:Qo.b,queryId:i.a.string.isRequired,results:i.a.object.isRequired,widgetMapping:i.a.object.isRequired,widgets:Qo.a.isRequired},ri.defaultProps={positions:{}};var oi=ri,ai=n("7vpu2Nbc"),ii=Object(Zn.b)("views.SearchLoadingState",(function(){return A.a.createActions(["loading","finished"])})),ci=Object(Zn.c)("views.SearchLoadingState",(function(){return A.a.createStore({listenables:[ii],isLoading:!1,init:function(){ai.a.execute.listen(this.loading),ai.a.execute.completed.listen(this.finished)},getInitialState:function(){return this._state()},loading:function(){this.isLoading=!0,this._trigger()},finished:function(){this.isLoading=!1,this._trigger()},_state:function(){return{isLoading:this.isLoading}},_trigger:function(){this.trigger(this._state())}})})),li=(n("2EXlaXtj"),n("gITOw//l"));function ui(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function si(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fi=Object(f.a)((function(e){return e.searchLoadingState.isLoading&&r.createElement(li.a,{text:"Updating search results..."})}),{searchLoadingState:ci}),pi=Object(f.a)(oi,{widgets:yt.b}),di=r.memo((function(e){var t=e.fieldTypes,n=e.queryId,o=e.searches,a=e.viewState;if(!t)return r.createElement(nt.a,null);var i=o&&o.result,c=o&&o.widgetMapping,l=i?i.forId(n):void 0,u=t.all,s=t.queryFields.get(n,t.all),f=a.state&&a.state.widgetPositions,p=l?r.createElement(pi,{allFields:u,fields:s,queryId:n,results:l,positions:f,widgetMapping:c}):r.createElement(nt.a,null);return r.createElement(w.I,null,r.createElement(w.h,null,p,r.createElement(fi,null)))})),mi=Object(f.a)(di,{fieldTypes:_t.b,searches:ai.b,viewMetadata:K.a,viewState:ot.b},(function(e){return function(e){for(var t=1;t .nav-tabs {\n    border-bottom: 0;\n\n    > li {\n      > a {\n        border-color: ".concat(t.color.gray[80],";\n      }\n    }\n\n    > li.active {\n      z-index: 1;\n\n      > a {\n        border-bottom-color: transparent;\n      }\n    }\n  }\n")})),fc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ac(e,t)}(i,e);var t,n,o,a=function(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=lc(e);if(t()){var o=lc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ic(this,n)}}(i);function i(){var e;rc(this,i);for(var t=arguments.length,n=new Array(t),r=0;r .btn-group{.btn:first-child{max-width:100%;}}"]),xc=u.default.div.withConfig({displayName:"RefreshControls__ButtonLabel",componentId:"sc-1pygk8n-2"})(["display:inline-block;text-overflow:ellipsis;overflow:hidden;max-width:calc(100% - 9px);vertical-align:inherit;"]),Pc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wc(e,t)}(i,e);var t,n,r,a=function(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=Sc(e);if(t()){var o=Sc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oc(this,n)}}(i);function i(){var e;gc(this,i);for(var t=arguments.length,n=new Array(t),r=0;r0&&t.bottom>0}};function Dc(e){return(Dc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ic(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ml(e){return(ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function yl(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ll(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Vl=Nr.a.getStore("CurrentUser"),Ql=function(e){var t=e.view,n=e.isNewView,a=e.metadata,i=e.currentUser,c=e.router,l=Ll(Object(r.useState)(!1),2),u=l[0],s=l[1],f=Ll(Object(r.useState)(!1),2),p=f[0],d=f[1],m=Ll(Object(r.useState)(!1),2),h=m[0],y=m[1],b=Ll(Object(r.useState)(!1),2),g=b[0],v=b[1],S=Ll(Object(r.useState)(!1),2),j=S[0],C=S[1],_=a.undeclared.size>0,x=function(e,t){return Object(zc.b)(t.permissions,[Gc.b.Edit(e.id)])||e.type===E.a.Type.Dashboard&&Object(zc.b)(t.permissions,["dashboards:edit:".concat(e.id)])}(t,i),P=Hc.a.gl2DevMode()&&o.a.createElement(o.a.Fragment,null,o.a.createElement(w.v,{divider:!0}),o.a.createElement(w.v,{onSelect:function(){return d(!0)}},o.a.createElement(U.r,{name:"code"})," Debug"));return o.a.createElement(w.d,null,o.a.createElement(w.c,{onClick:function(){return Qc(t)},disabled:n||_||!x,"data-testid":"dashboard-save-button"},o.a.createElement(U.r,{name:"save"})," Save"),o.a.createElement(w.c,{onClick:function(){return y(!0)},disabled:_,"data-testid":"dashboard-save-as-button"},o.a.createElement(U.r,{name:"copy"})," Save as"),o.a.createElement(w.k,{title:o.a.createElement(U.r,{name:"ellipsis-h"}),id:"query-tab-actions-dropdown",pullRight:!0,noCaret:!0},o.a.createElement(w.v,{onSelect:function(){return v(!0)},disabled:n||!x},o.a.createElement(U.r,{name:"edit"})," Edit"),o.a.createElement(w.v,{onSelect:function(){return s(!0)},disabled:n||!x},o.a.createElement(U.r,{name:"share-alt"})," Share"),o.a.createElement(w.v,{onSelect:function(){return C(!0)}},o.a.createElement(U.r,{name:"cloud-download"})," Export to CSV"),P,o.a.createElement(Me,null,o.a.createElement(w.v,{divider:!0}),o.a.createElement(Wl,{view:t,disabled:n}))),p&&o.a.createElement(Vc,{show:!0,onClose:function(){return d(!1)}}),h&&o.a.createElement(nl,{show:!0,view:t.toBuilder().newId().build(),title:"Save new dashboard",onClose:function(){return y(!1)},onSave:function(e){return function(e,t){return vt.a.create(e).then((function(){return O.a.load(e)})).then((function(e){return t.push(ht.a.dashboard_show(e.view.id))})).then((function(){return Bt.a.success('Saving view "'.concat(e.title,'" was successful!'),"Success!")})).catch((function(e){return Bt.a.error("Saving view failed: ".concat(e),"Error!")}))}(e,c)}}),g&&o.a.createElement(nl,{show:!0,view:t,title:"Editing dashboard",onClose:function(){return v(!1)},onSave:function(e){return Qc(e)}}),u&&o.a.createElement(Pl,{show:!0,view:t,onClose:function(){return s(!1)}}),j&&o.a.createElement(ln,{view:t,closeModal:function(){return C(!1)}}))};Ql.propTypes={currentUser:i.a.shape({currentUser:i.a.shape({permissions:i.a.arrayOf(i.a.string)})}),router:i.a.any.isRequired,metadata:i.a.shape({undeclared:ut.a.Set}).isRequired,view:i.a.instanceOf(E.a).isRequired,isNewView:i.a.bool.isRequired},Ql.defaultProps={currentUser:{currentUser:{permissions:[]}}};var Gl=Object(f.a)(Object(s.withRouter)(Ql),{metadata:$e.b,view:O.b,currentUser:Vl},(function(e){var t=e.view,n=t.view,r=t.isNew;return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"title",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"asc",i=Object(Ft.b)("GET","".concat(iu,"?query=").concat(t,"&page=").concat(n,"&per_page=").concat(r,"&sort=").concat(o,"&order=").concat(a)).then((function(t){return e.searches=t.views,e.pagination={total:t.total,count:t.count,page:t.page,perPage:t.per_page},e.trigger({list:e.searches,pagination:e.pagination}),t})).catch((function(e){Bt.a.error("Fetching saved searches failed with status: ".concat(e),"Could not retrieve saved searches")}));au.search.promise(i)}})}));function lu(e){return(lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){for(var n=0;n0?o.a.createElement(U.B,{onChange:this.handlePageChange,activePage:c,totalItems:i,pageSize:u,pageSizes:[5,10,15]},o.a.createElement(w.t,null,f)):o.a.createElement(yu,null,o.a.createElement(hu,{name:"exclamation-triangle",size:"lg"}),o.a.createElement("span",null,"No saved searches found."));return o.a.createElement(w.x,{show:!0},o.a.createElement(w.x.Body,null,o.a.createElement(U.F,{onSearch:this.handleSearch,onReset:this.handleSearchReset}),p),o.a.createElement(w.x.Footer,null,o.a.createElement(Zl.a.Consumer,null,(function(t){return o.a.createElement(w.c,{disabled:!s,bsStyle:"primary",onClick:function(){e.onLoad(s,t)}},"Load")})),o.a.createElement(w.c,{disabled:!s,onClick:function(){e.onDelete(s)}},"Delete"),o.a.createElement(w.c,{onClick:r},"Cancel")))}}])&&uu(t.prototype,n),r&&uu(t,r),i}(o.a.Component);mu(bu,"propTypes",{toggleModal:i.a.func.isRequired,deleteSavedSearch:i.a.func.isRequired,views:i.a.object}),mu(bu,"defaultProps",{views:{}});var gu=Object(f.a)(bu,{views:cu});function vu(e){return(vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wu(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return e.owner===t.username||Object(zc.b)(t.permissions,[Gc.b.Edit(e.id)])},Pu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ou(e,t)}(i,e);var t,n,r,a=function(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=ju(e);if(t()){var o=ju(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Eu(this,n)}}(i);function i(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),Cu(Su(t=a.call(this,e)),"formTarget",void 0),Cu(Su(t),"toggleFormModal",(function(){var e=t.state.showForm;t.setState({showForm:!e})})),Cu(Su(t),"toggleListModal",(function(){var e=t.state.showList;t.setState({showList:!e})})),Cu(Su(t),"toggleCSVExport",(function(){var e=t.state.showCSVExport;t.setState({showCSVExport:!e})})),Cu(Su(t),"toggleShareSearch",(function(){var e=t.state.showShareSearch;t.setState({showShareSearch:!e})})),Cu(Su(t),"onChangeTitle",(function(e){t.setState({newTitle:e.target.value})})),Cu(Su(t),"saveSearch",(function(){var e=t.state.newTitle,n=t.props.viewStoreState.view;if(n.id){var r=n.toBuilder().title(e).type(E.a.Type.Search).build();vt.a.update(r).then(t.toggleFormModal).then((function(){return Bt.a.success('Saving view "'.concat(r.title,'" was successful!'),"Success!")})).catch((function(e){return Bt.a.error("Saving view failed: ".concat(t._extractErrorMessage(e)),"Error!")}))}})),Cu(Su(t),"_extractErrorMessage",(function(e){return e&&e.additional&&e.additional.body&&e.additional.body.message?e.additional.body.message:e})),Cu(Su(t),"saveAsSearch",(function(){var e=t.state.newTitle,n=t.props.viewStoreState.view;if(e&&""!==e){var r=n.toBuilder().newId().title(e).type(E.a.Type.Search).build();vt.a.create(r).then((function(e){(0,t.context)(e.id).then((function(){s.browserHistory.push(ht.a.pluginRoute("SEARCH_VIEWID")(e.id))}))})).then(t.toggleFormModal).then((function(){return Bt.a.success('Saving view "'.concat(r.title,'" was successful!'),"Success!")})).catch((function(e){return Bt.a.error("Saving view failed: ".concat(t._extractErrorMessage(e)),"Error!")}))}})),Cu(Su(t),"loadSavedSearch",(function(){t.toggleListModal()})),Cu(Su(t),"deleteSavedSearch",(function(e){var n=t.props.viewStoreState.view;return vt.a.delete(e).then((function(){return Bt.a.success('Deleting view "'.concat(e.title,'" was successful!'),"Success!")})).then((function(){return O.a.create(E.a.Type.Search)})).then((function(){e.id===n.id&&s.browserHistory.push(ht.a.SEARCH)})).catch((function(e){return Bt.a.error("Deleting view failed: ".concat(t._extractErrorMessage(e)),"Error!")}))})),Cu(Su(t),"loadAsDashboard",(function(){var e=t.props.viewStoreState.view;s.browserHistory.push({pathname:je.m,state:{view:e}})}));var n=e.viewStoreState.view;return t.state={showCSVExport:!1,showShareSearch:!1,showForm:!1,showList:!1,newTitle:n&&n.title||""},t}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.state,n=t.showForm,r=t.showList,a=t.newTitle,i=t.showCSVExport,c=t.showShareSearch,l=this.props,u=l.currentUser,s=l.theme,f=l.viewStoreState,p=f.view,d=f.dirty,m=i&&o.a.createElement(ln,{view:p,closeModal:this.toggleCSVExport}),h=c&&o.a.createElement(Pl,{show:!0,view:p,onClose:this.toggleShareSearch}),y=r&&o.a.createElement(gu,{loadSavedSearch:this.loadSavedSearch,deleteSavedSearch:this.deleteSavedSearch,toggleModal:this.toggleListModal}),b=p&&p.id,g=b?"star":"star-o",v="";b&&(v=d?s.color.variant.warning:s.color.variant.info);var O,E=!(d||b);O=d?"Unsaved changes":b?"Saved search":"Save search";var S=n&&o.a.createElement(ou,{onChangeTitle:this.onChangeTitle,target:this.formTarget,saveSearch:this.saveSearch,saveAsSearch:this.saveAsSearch,disableCreateNew:a===p.title,isCreateNew:!p.id,toggleModal:this.toggleFormModal,value:a});return o.a.createElement($l.a.Consumer,null,(function(t){return o.a.createElement("div",{className:"pull-right"},o.a.createElement(w.d,null,o.a.createElement(o.a.Fragment,null,o.a.createElement(w.c,{title:O,ref:function(t){e.formTarget=t},onClick:e.toggleFormModal},o.a.createElement(U.r,{style:{color:v},name:g})," Save"),S),o.a.createElement(w.c,{title:"Load a previously saved search",onClick:e.toggleListModal},o.a.createElement(U.r,{name:"folder-o"})," Load"),y,o.a.createElement(w.k,{title:o.a.createElement(U.r,{name:"ellipsis-h"}),id:"search-actions-dropdown",pullRight:!0,noCaret:!0},o.a.createElement(w.v,{onSelect:e.loadAsDashboard},o.a.createElement(U.r,{name:"dashboard"})," Export to dashboard"),o.a.createElement(w.v,{onSelect:e.toggleCSVExport},o.a.createElement(U.r,{name:"cloud-download"})," Export to CSV"),o.a.createElement(w.v,{disabled:E,onSelect:function(){return t()},"data-testid":"reset-search"},o.a.createElement(U.r,{name:"eraser"})," Reset search"),o.a.createElement(w.v,{divider:!0}),o.a.createElement(w.v,{onSelect:e.toggleShareSearch,title:"Share search",disabled:!(p&&p.id&&xu(p,u))},o.a.createElement(U.r,{name:"share-alt"})," Share")),m,h))}))}}])&&wu(t.prototype,n),r&&wu(t,r),i}(o.a.Component);Cu(Pu,"propTypes",{viewStoreState:i.a.object.isRequired,currentUser:i.a.shape({username:i.a.string.isRequired}).isRequired,theme:i.a.shape({color:i.a.object}).isRequired}),Cu(Pu,"contextType",Zl.a);var Ru=Object(f.a)(Object(u.withTheme)(Pu),{currentUser:_u,viewStoreState:O.b},(function(e){var t=e.viewStoreState,n=e.currentUser;return{currentUser:(n=void 0===n?{}:n).currentUser,viewStoreState:t}})),Tu=u.default.div.withConfig({displayName:"HorizontalSpacer__Spacer",componentId:"sc-16udv6c-0"})(["width:100%;height:","px;"],(function(e){return e.height})),qu=function(e){var t=e.height,n=e.className;return r.createElement(Tu,{height:t,className:n})};qu.propTypes={height:i.a.number,className:i.a.string},qu.defaultProps={height:10,className:void 0};var ku=qu,Du=n("pkbmcE3H");function Iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Au(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Fu={disableSearch:!1,onSubmit:function(e,t){var n=e.timerange,r=e.streams,o=e.queryString,a=t.toBuilder().timerange(n).filter(Object(wt.c)(r)).query(Object(wt.a)(o)).build();return Ci.a.update(a.id,a)}},Mu=function(e){var t=e.availableStreams,n=e.config,o=e.currentQuery,a=e.disableSearch,i=void 0===a?Fu.disableSearch:a,l=e.queryFilters,u=e.onSubmit,s=void 0===u?Fu.onSubmit:u;if(!o||!n)return r.createElement(U.L,null);var f=o.id,p=o.query,d=o.timerange,m=p.query_string,h=Object(wt.d)(l.get(f,c.Map())).toJS(),y=Object(r.useCallback)((function(e){return s(e,o)}),[p,s]);return r.createElement(Bc,{value:p.query_string},r.createElement(w.I,{className:"content"},r.createElement(w.h,{md:12},r.createElement(ro,{initialValues:{timerange:d,streams:h,queryString:m},onSubmit:y},(function(e){var o=e.dirty,a=e.isSubmitting,c=e.isValid,l=e.handleSubmit;return r.createElement(r.Fragment,null,r.createElement(rr,null,r.createElement(w.h,{md:4},r.createElement(wr,null),r.createElement(Qr,{config:n})),r.createElement(w.h,{mdHidden:!0,lgHidden:!0},r.createElement(ku,null)),r.createElement(w.h,{md:5,xs:8},r.createElement(tr.a,{name:"streams"},(function(e){var n=e.field,o=n.name,a=n.value,i=n.onChange;return r.createElement(Jr,{value:a,streams:t,onChange:function(e){return i({target:{value:e,name:o}})}})}))),r.createElement(w.h,{md:3,xs:4},r.createElement(Rc,null))),r.createElement(w.I,{className:"no-bm"},r.createElement(w.h,{md:9,xs:8},r.createElement("div",{className:"pull-right search-help"},r.createElement(it.a,{page:rt.a.PAGES.SEARCH_QUERY_LANGUAGE,title:"Search query syntax documentation",text:r.createElement(U.r,{name:"lightbulb"})})),r.createElement($r,{running:a,disabled:i||a||!c,dirty:o}),r.createElement(tr.a,{name:"queryString"},(function(e){var t=e.field,n=t.name,o=t.value,a=t.onChange;return r.createElement(to,{value:o,placeholder:'Type your search query here and press enter. E.g.: ("not found" AND http) OR http_response_code:[400 TO 404]',onChange:function(e){return a({target:{value:e,name:n}}),Promise.resolve()},onExecute:l})}))),r.createElement(w.h,{md:3,xs:4,className:"pull-right"},r.createElement(Ru,null))))})))))};Mu.propTypes={config:i.a.object.isRequired,disableSearch:i.a.bool,onSubmit:i.a.func},Mu.defaultProps=Fu;var Bu=Object(f.a)(Mu,{currentQuery:Fa.a,availableStreams:or.b,queryFilters:Du.a},(function(e){var t=e.availableStreams.streams;return function(e){for(var t=1;t




© 2015 - 2024 Weber Informatics LLC | Privacy Policy