(self["webpackChunkaw_webui"]=self["webpackChunkaw_webui"]||[]).push([[4641],{24641:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>p});n(21249),n(57327),n(41539);var r=function(){var t=this,e=t._self._c;return e("div",[e("h2",[t._v("Timeline")]),e("input-timeinterval",{staticClass:"mb-3",attrs:{defaultDuration:t.timeintervalDefaultDuration,maxDuration:t.maxDuration},model:{value:t.daterange,callback:function(e){t.daterange=e},expression:"daterange"}}),e("details",{staticClass:"d-inline-block bg-light small border rounded mr-2 px-2"},[t._m(0),e("div",{staticClass:"p-2 bg-light"},[e("table",[e("tr",[t._m(1),e("td",[e("select",{directives:[{name:"model",rawName:"v-model",value:t.filter_hostname,expression:"filter_hostname"}],on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.filter_hostname=e.target.multiple?n:n[0]}}},[e("option",{domProps:{value:null}},[t._v("All")]),t._l(t.hosts,(function(n){return e("option",{domProps:{value:n}},[t._v(t._s(n))])}))],2)])]),e("tr",[t._m(2),e("td",[e("select",{directives:[{name:"model",rawName:"v-model",value:t.filter_client,expression:"filter_client"}],on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.filter_client=e.target.multiple?n:n[0]}}},[e("option",{domProps:{value:null}},[t._v("All")]),t._l(t.clients,(function(n){return e("option",{domProps:{value:n}},[t._v(t._s(n))])}))],2)])])])])]),0!==t.num_events?e("div",{staticClass:"d-inline-block border rounded p-2 mr-2"},[t._v("Events shown: "+t._s(t.num_events))]):t._e(),0===t.num_events?e("b-alert",{staticClass:"d-inline-block p-2 mb-0 mt-2",attrs:{variant:"warning",show:""}},[t._v("No events match selected criteria. Timeline is not updated.")]):t._e(),e("div",{staticClass:"float-right small text-muted pt-3"},[t._v("Drag to pan and scroll to zoom")]),null!==t.buckets?e("div",[e("div",{staticStyle:{clear:"both"}}),e("vis-timeline",{attrs:{buckets:t.buckets,showRowLabels:!0,queriedInterval:t.daterange}}),e("aw-devonly",{attrs:{reason:"Not ready for production, still experimenting"}},[e("aw-calendar",{attrs:{buckets:t.buckets}})],1)],1):e("div",[e("h1",{staticClass:"aw-loading"},[t._v("Loading...")])])],1)},a=[function(){var t=this,e=t._self._c;return e("summary",{staticClass:"p-2"},[e("b",[t._v("Filters")])])},function(){var t=this,e=t._self._c;return e("th",{staticClass:"pt-2 pr-3"},[e("label",[t._v("Host:")])])},function(){var t=this,e=t._self._c;return e("th",{staticClass:"pt-2 pr-3"},[e("label",[t._v("Client:")])])}],i=n(51055),l=n(27981),s=n(63105),u=n.n(s),o=n(73303),c=n.n(o),v=(n(9653),n(43371),n(82772),n(67383)),f=n(85711);const d={name:"Timeline",data:function(){return{all_buckets:null,hosts:null,buckets:null,clients:null,daterange:null,maxDuration:2678400,filter_hostname:null,filter_client:null}},computed:{timeintervalDefaultDuration:function(){var t=(0,v.F2)();return Number(t.durationDefault)},num_events:function(){return c()(this.buckets,"events.length")}},watch:{daterange:function(){this.getBuckets()},filter_hostname:function(){this.getBuckets()},filter_client:function(){this.getBuckets()}},methods:{getBuckets:function(){var t=(0,l.Z)((0,i.Z)().mark((function t(){var e,n=this;return(0,i.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(null!=this.daterange){t.next=2;break}return t.abrupt("return");case 2:return t.t0=Object,t.next=5,(0,f.U)().getBucketsWithEvents({start:this.daterange[0].format(),end:this.daterange[1].format()});case 5:t.t1=t.sent,this.all_buckets=t.t0.freeze.call(t.t0,t.t1),this.hosts=this.all_buckets.map((function(t){return t.hostname})).filter((function(t,e,n){return n.indexOf(t)===e})),this.clients=this.all_buckets.map((function(t){return t.client})).filter((function(t,e,n){return n.indexOf(t)===e})),e=this.all_buckets,this.filter_hostname&&(e=u()(e,(function(t){return t.hostname==n.filter_hostname}))),this.filter_client&&(e=u()(e,(function(t){return t.client==n.filter_client}))),this.buckets=e;case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}},m=d;var h=n(1001),_=(0,h.Z)(m,r,a,!1,null,"392d3642",null);const p=_.exports},67762:t=>{function e(t,e){var n,r=-1,a=t.length;while(++r<a){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}t.exports=e},73303:(t,e,n)=>{var r=n(67206),a=n(67762);function i(t,e){return t&&t.length?a(t,r(e,2)):0}t.exports=i}}]);
//# sourceMappingURL=4641.5ddcac3f.js.map