"use strict";(self["webpackChunkModoboa"]=self["webpackChunkModoboa"]||[]).push([[153],{4884:function(t,e,s){s.r(e),s.d(e,{default:function(){return k}});var a=s(6313),o=s(7953),i=function(){var t=this,e=t._self._c;return e("div",[e(a.Z,{attrs:{flat:""}},[e(o.qW,[e("translate",[t._v("Audit trail")])],1)],1),e("audit-trail-list")],1)},r=[],l=s(4145),n=s(4127),c=s(3863),h=s(3687),u=s(7808),d=function(){var t=this,e=t._self._c;return e(l.Z,{staticClass:"mt-6"},[e(a.Z,{attrs:{flat:""}},[e(h.Z),e(u.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(c.Z,{staticClass:"elevation-1",attrs:{headers:t.headers,items:t.logs,search:t.search,options:t.options,"server-items-length":t.total},on:{"update:options":function(e){t.options=e}},scopedSlots:t._u([{key:"item.level",fn:function({item:s}){return[e(n.Z,{attrs:{color:t.getLevelColor(s.level),"text-color":"white",small:""}},[t._v(" "+t._s(s.level)+" ")])]}}])})],1)},g=[],p=s(6310),f={data(){return{logs:[],headers:[{text:this.$gettext("Date"),value:"date_created"},{text:this.$gettext("Level"),value:"level"},{text:this.$gettext("Logger"),value:"logger"},{text:this.$gettext("Message"),value:"message"}],loading:!0,options:{},search:"",total:0}},methods:{getLevelColor(t){return"INFO"===t?"primary":"WARNING"===t?"orange":"CRITICAL"===t||"ERROR"===t?"red":""},fetchLogs(){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,p.Z.getAuditTrail(e).then((t=>{this.logs=t.data.results,this.total=t.data.count,this.loading=!1}))}},watch:{options:{handler(){this.fetchLogs()},deep:!0},search(t){this.fetchLogs()}}},v=f,m=s(1001),Z=(0,m.Z)(v,d,g,!1,null,null,null),x=Z.exports,_={components:{AuditTrailList:x}},L=_,C=(0,m.Z)(L,i,r,!1,null,"34cff6f8",null),k=C.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 o="logs";e["Z"]={getAuditTrail(t){return a.Z.get(`/${o}/audit-trail/`,{params:t})},getMessages(t){return a.Z.get(`/${o}/messages/`,{params:t})}}}}]);
//# sourceMappingURL=153.7d64b8ec.js.map