define("taoEventLog/controller/routes",[],function(){"use strict";return{TaoEventLog:{actions:{index:"controller/TaoEventLog/show"}}}}),define("tpl!taoEventLog/controller/TaoEventLog/show/layout",["handlebars"],function(hb){return hb.template(function(helper,depth0,helpers,partials,stack1){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,helper.helpers),stack1=stack1||{};var options,buffer="",functionType="function",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing ;return buffer+='
\n
\n
\n
\n
\n

'+escapeExpression((options={hash:{},data:stack1},(helper=helpers.__||depth0&&depth0.__)?helper.call(depth0,"Log watcher",options):helperMissing.call(depth0,"__","Log watcher",options)))+'

\n
\n \n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
"})}),define("tpl!taoEventLog/components/export/templates/layout",["handlebars" ],function(hb){return hb.template(function(options,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,options.helpers),data=data||{};var helper,buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;return buffer+='
\n

',buffer+=escapeExpression((helper=helpers.title)||"function"==typeof(helper=depth0&&depth0.title)?helper.call(depth0,{hash:{},data:data}):helper)+'

\n
\n
\n

'+escapeExpression((options={hash:{},data:data},(helper=helpers.__||depth0&&depth0.__ )?helper.call(depth0,"CSV Options",options):helperMissing.call(depth0,"__","CSV Options",options)))+'

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n \n
\n
\n
"})}),define("taoEventLog/components/export/exporter",["jquery","lodash","i18n","ui/component","ui/feedback", "layout/loading-bar","tpl!taoEventLog/components/export/templates/layout","util/url","layout/logout-event","jquery.fileDownload"],function($,_,__,component,feedback,loadingBar,layoutTpl,url,logoutEvent){"use strict";return function(options){if(!_.isPlainObject(options)||!_.isString(options.exportUrl))throw new TypeError("The exporter must be configured with exportUrl option");return component({},{title:__("Export")}).setTemplate(layoutTpl).on("render",function(){var self=this,$form=self.$component.find(".js-export-form");$form.on("submit",function(exportUrl){exportUrl.preventDefault(),loadingBar.start();var params={};_.each($form.serializeArray(),function( param){params[param.name]=param.value}),exportUrl=url.build(options.exportUrl,params),$.fileDownload(exportUrl,{successCallback:function(){loadingBar.stop(),self.$component.modal("close")},failCallback:function(response){loadingBar.stop();response=$.parseJSON($(response).text());response?feedback().error(new Error(response.message)):(self.$component.modal("close"),logoutEvent())}})})}).init(options)}}),define("taoEventLog/components/export/modalExporter",["jquery","lodash","i18n","ui/feedback","taoEventLog/components/export/exporter","ui/modal"],function($,_,__,feedback,exporter){"use strict";return function(options){var feedbackOptions={timeout:{warning:8e3 },encodeHtml:!1};return exporter(options).on("warning",function(err){feedback().warning(err,feedbackOptions)}).on("error",function(err){feedback().error(err,feedbackOptions)}).on("render",function(){var self=this;this.$component.addClass("modal").on("close.modal",function(){self.$component.modal("close")}).modal({width:600})}).render("body")}}),define("taoEventLog/controller/TaoEventLog/show",["jquery","lodash","i18n","util/url","ui/datatable","tpl!taoEventLog/controller/TaoEventLog/show/layout","taoEventLog/components/export/modalExporter","ui/dateRange/dateRange"],function($,_,__,url,datatable,layoutTpl,exporter,dateRangeFactory){"use strict" ;var listUrl=url.route("search","TaoEventLog","taoEventLog");return{start:function(){var $exportLink={dataTypes:[{key:"event_name",title:__("Event Name")},{key:"action",title:__("Action")},{key:"user_id",title:__("User ID")},{key:"user_roles",title:__("User Roles")},{key:"occurred",title:__("Occurred")},{key:"properties",title:__("Properties")}]},$layout=$(layoutTpl($exportLink)),$eventFilter=$(".log-browser .log-table-filters",$layout),$eventList=$(".log-browser .log-table",$layout),$eventViewer=$(".event-viewer",$layout),$exportLink=$(".js-export",$layout),filterRange=dateRangeFactory($eventFilter),currentFilter={filtercolumns:{}};filterRange.on( "submit reset",function(){$eventList.datatable("options",{params:{periodStart:this.getStart(),periodEnd:this.getEnd()}}),$eventList.datatable("refresh")}),$exportLink.on("click",function(){currentFilter.filtercolumns=_.merge(currentFilter.filtercolumns,{from:filterRange.getStart(),to:filterRange.getEnd()}),exporter({title:__("Export Log Entries"),exportUrl:url.route("export","TaoEventLog","taoEventLog",currentFilter)})}),$(".content").append($layout),$eventList.datatable({url:listUrl,sortby:"occurred",sortorder:"desc",filter:!0,rowSelection:!0,filterStrategy:"multiple",model:[{id:"identifier",label:__("ID"),transform:function(id,row){return row.raw.id}},{ id:"event_name",label:__("Event Name"),sortable:!0,filterable:!0},{id:"action",label:__("Action"),sortable:!0,filterable:!0},{id:"user_id",label:__("User ID"),sortable:!0,filterable:!0},{id:"user_roles",label:__("User Roles"),sortable:!0,filterable:!0,transform:function(roles){var result,rolesArray=roles.split(", "),rolesCount=rolesArray.length;return 1"+str+"")):"user_roles"===key?$("."+key,$eventViewer).html(event.user_roles.split(",").join("
")):$("."+key,$eventViewer).html(event[key]))}(event.raw),$eventViewer.is(".hidden")&&($layout.find(".col-12").removeClass("col-12").addClass("col-7"),$eventViewer.removeClass("hidden"))},filter:function(e,options){options.page=1}, query:function(e,ajaxConfig){currentFilter=_.pick(ajaxConfig&&ajaxConfig.data,["filterquery","filtercolumns","sortby","sortorder","sorttype"])}}})}}}),define("taoEventLog/loader/taoEventLog.bundle",function(){}); //# sourceMappingURL=taoEventLog.min.js.map