"use strict";(self["webpackChunkaw_webui"]=self["webpackChunkaw_webui"]||[]).push([[5107],{65107:(t,e,n)=>{n.r(e),n.d(e,{default:()=>_});var r=function(){var t=this,e=t._self._c;return e("div",[e("h3",[t._v(t._s(t.id))]),e("table",[e("tr",[e("th",[t._v("Type:")]),e("td",[t._v(t._s(t.bucket.type))])]),e("tr",[e("th",[t._v("Client:")]),e("td",[t._v(t._s(t.bucket.client))])]),e("tr",[e("th",[t._v("Hostname:")]),e("td",[t._v(t._s(t.bucket.hostname))])]),e("tr",[e("th",[t._v("Created:")]),e("td",[t._v(t._s(t._f("iso8601")(t.bucket.created)))])]),t.bucket.metadata?e("tr",[e("th",[t._v("First/last event:")]),e("td",[t._v(t._s(t.bucket.metadata.start)+" / "+t._s(t.bucket.metadata.end))])]):t._e(),e("tr",[e("th",[t._v("Eventcount:")]),e("td",[t._v(t._s(t.eventcount))])]),e("tr",[e("th",[t._v("Data:")]),e("td",[t._v(t._s(t.bucket.data))])])]),e("input-timeinterval",{attrs:{maxDuration:t.maxDuration},model:{value:t.daterange,callback:function(e){t.daterange=e},expression:"daterange"}}),e("vis-timeline",{attrs:{buckets:[t.bucket_with_events],showRowLabels:!1}}),e("aw-eventlist",{attrs:{bucket_id:t.id,events:t.events,editable:""},on:{save:t.updateEvent}})],1)},s=[],a=n(51055),u=n(27981),i=n(97911),c=(n(34553),n(85711)),o=n(47840);const v={name:"Bucket",props:{id:String},data:function(){return{bucketsStore:(0,c.U)(),events:[],eventcount:"?",daterange:null,maxDuration:2678400}},computed:{bucket:function(){return this.bucketsStore.getBucket(this.id)||{id:this.id}},bucket_with_events:function(){return console.log(this.bucket),(0,i.Z)((0,i.Z)({},this.bucket),{},{events:this.events})}},watch:{daterange:function(){var t=(0,u.Z)((0,a.Z)().mark((function t(){return(0,a.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getEvents(this.id);case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},mounted:function(){var t=(0,u.Z)((0,a.Z)().mark((function t(){return(0,a.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.bucketsStore.ensureLoaded();case 2:return t.next=4,this.getEventCount(this.id);case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{getEvents:function(){var t=(0,u.Z)((0,a.Z)().mark((function t(e){var n;return(0,a.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.bucketsStore.getBucketWithEvents({id:e,start:this.daterange[0].format(),end:this.daterange[1].format()});case 2:n=t.sent,this.events=n.events;case 4:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),getEventCount:function(){var t=(0,u.Z)((0,a.Z)().mark((function t(e){return(0,a.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,o.s3)().countEvents(e);case 2:this.eventcount=t.sent.data;case 3:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),updateEvent:function(t){var e=this.events.findIndex((function(e){return e.id==t.id}));-1!=e?this.$set(this.events,e,t):console.error(":(")}}},d=v;var h=n(1001),l=(0,h.Z)(d,r,s,!1,null,null,null);const _=l.exports}}]);
//# sourceMappingURL=5107.f84ea7d4.js.map