"use strict";(self["webpackChunkModoboa"]=self["webpackChunkModoboa"]||[]).push([[456],{2725:function(t,e,s){s.r(e),s.d(e,{default:function(){return k}});var a=s(6313),n=s(7953),i=function(){var t=this,e=t._self._c;return e("div",[e(a.Z,{attrs:{flat:""}},[e(n.qW,[e("translate",[t._v("Message history")])],1)],1),e("message-list")],1)},r=[],o=s(4145),l=s(3863),u=s(3687),h=s(7808),c=function(){var t=this,e=t._self._c;return e(o.Z,{staticClass:"mt-6"},[e(a.Z,{attrs:{flat:""}},[e(u.Z),e(h.Z,{attrs:{"prepend-inner-icon":"mdi-magnify",placeholder:t._f("translate")("Search"),filled:"",outlined:"",dense:"","hide-details":""},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1),e(l.Z,{staticClass:"elevation-1",attrs:{headers:t.headers,items:t.messages,search:t.search,options:t.options,"server-items-length":t.total},on:{"update:options":function(e){t.options=e}},scopedSlots:t._u([{key:"item.date",fn:function({item:e}){return[t._v(" "+t._s(t._f("date")(e.date))+" ")]}},{key:"item.sender",fn:function({item:e}){return[t._v(" "+t._s(t._f("truncate")(e.sender,50))+" ")]}}])})],1)},d=[],g=s(6310),p={data(){return{messages:[],headers:[{text:this.$gettext("Queue ID"),value:"queue_id"},{text:this.$gettext("Date"),value:"date",width:"20%"},{text:this.$gettext("Status"),value:"status"},{text:this.$gettext("To"),value:"rcpt"},{text:this.$gettext("From"),value:"sender"}],loading:!0,options:{},search:"",total:0}},methods:{fetchMessages(){let t;this.options.sortBy.length&&(t=(this.options.sortDesc[0]?"-":"")+this.options.sortBy[0]);const e={ordering:t,page:this.options.page,page_size:this.options.itemsPerPage,search:this.search};this.loading=!0,g.Z.getMessages(e).then((t=>{this.messages=t.data.results,this.total=t.data.count,this.loading=!1}))}},watch:{options:{handler(){this.fetchMessages()},deep:!0},search(t){this.fetchMessages()}}},f=p,m=s(1001),v=(0,m.Z)(f,c,d,!1,null,null,null),_=v.exports,x={components:{MessageList:_}},Z=x,M=(0,m.Z)(Z,i,r,!1,null,null,null),k=M.exports},3687:function(t,e,s){s(9027);var a=s(5352);e["Z"]=(0,a.Ji)("spacer","div","v-spacer")},6310:function(t,e,s){var a=s(2201);const n="logs";e["Z"]={getAuditTrail(t){return a.Z.get(`/${n}/audit-trail/`,{params:t})},getMessages(t){return a.Z.get(`/${n}/messages/`,{params:t})}}}}]);
//# sourceMappingURL=456.df17d1c9.js.map