1import{a as R}from"./chunk-B2WYTJ7S.js";import{a as U}from"./chunk-GH2RV5OT.js";import"./chunk-YWAL7HVF.js";import{a as Q}from"./chunk-AHQSOXDD.js";import{a as F}from"./chunk-GCE2MEC6.js";import{a as j}from"./chunk-W2ZMKN4C.js";import{e as k,g as T}from"./chunk-SB5L2XE4.js";import{D as Y,c as N,g as H,h as B,j as P,l as O,m as W}from"./chunk-ICJV4PL6.js";import{a as V}from"./chunk-RIRGXRXY.js";import"./chunk-3GN2FC7K.js";import"./chunk-47CSRN7C.js";import"./chunk-SKH2MXBC.js";import{j as L,k as M,v as D}from"./chunk-BQLJE42W.js";import{$b as C,Db as x,Ib as f,Jb as s,Pa as w,Tb as r,Ub as g,Vb as b,Xa as l,Ya as _,Zb as y,_b as S,bc as I,da as E,ib as h,mb as u,na as d,oa as p,xb as i,yb as t,zb as v}from"./chunk-YE3BF7DR.js";import{e as G}from"./chunk-4IDNTCH7.js";var A=G(Q());function q(a,n){if(a&1){let e=x();i(0,"tr",21),f("click",function(){let o=d(e).$implicit,c=s(2);return p(c.detail(o))}),i(1,"td"),r(2),t(),i(3,"td"),r(4),t(),i(5,"td",22),r(6),t()()}if(a&2){let e=n.$implicit;l(2),g(e.superName?"SuperAdmin "+e.superName:e.user.name),l(2),g(e.shortMessage),l(2),g(e.date)}}function J(a,n){if(a&1){let e=x();i(0,"div")(1,"a",23),f("click",function(){d(e);let o=s(2);return p(o.nextPage())}),r(2," Cargar m\xE1s registros "),v(3,"span",24),t()()}}function K(a,n){if(a&1){let e=x();i(0,"div",1)(1,"h2",2),r(2,"Log de actividad"),t(),i(3,"a",3),v(4,"span",4),t(),i(5,"form",5),f("ngSubmit",function(){d(e);let o=s();return p(o.search())}),i(6,"div",6)(7,"label"),r(8,"\xBFQu\xE9 estas buscando?"),t(),i(9,"input",7),C("ngModelChange",function(o){d(e);let c=s();return S(c.filter.keyword,o)||(c.filter.keyword=o),p(o)}),t()(),i(10,"div",8)(11,"div",9)(12,"label"),r(13,"Desde"),t(),i(14,"input",10),C("ngModelChange",function(o){d(e);let c=s();return S(c.filter.from,o)||(c.filter.from=o),p(o)}),t()(),i(15,"div",9)(16,"label"),r(17,"Hasta"),t(),i(18,"input",11),C("ngModelChange",function(o){d(e);let c=s();return S(c.filter.to,o)||(c.filter.to=o),p(o)}),t()()(),v(19,"input",12),i(20,"input",13),f("click",function(){d(e);let o=s();return p(o.descargarArchivo())}),t(),v(21,"br"),t(),i(22,"div",14)(23,"table",15)(24,"thead")(25,"tr")(26,"th",16),r(27,"Usuario"),t(),i(28,"th",17),r(29),t(),i(30,"th",18),r(31,"Fecha"),t()()(),i(32,"tbody"),h(33,q,7,3,"tr",19),t()(),h(34,J,4,0,"div",20),t()()}if(a&2){let e=s();l(9),y("ngModel",e.filter.keyword),l(5),u("from",e.rangeFrom),y("ngModel",e.filter.from),l(4),u("to",e.rangeTo),y("ngModel",e.filter.to),l(11),b("Actividad (",e.totalCount,")"),l(4),u("ngForOf",e.logs)("ngForTrackBy",e.trackByLogID),l(),u("ngIf",e.filter.hasNextPage)}}function X(a,n){if(a&1){let e=x();i(0,"div",1)(1,"h2",2),r(2,"Log de actividad"),t(),i(3,"a",25),f("click",function(){d(e);let o=s();return p(o.model={})}),v(4,"span",4),t(),i(5,"form")(6,"div",26)(7,"strong"),r(8,"Creacion"),t(),i(9,"div"),r(10),t()(),i(11,"div",26)(12,"strong"),r(13,"Usuario"),t(),i(14,"div"),r(15),t()(),i(16,"div",26)(17,"strong"),r(18,"Descripci\xF3n"),t(),v(19,"div",27),t(),i(20,"div",26)(21,"strong"),r(22,"IP"),t(),i(23,"div"),r(24),t()(),i(25,"div",26)(26,"strong"),r(27,"Nivel"),t(),i(28,"div"),r(29),t()(),i(30,"div",26)(31,"strong"),r(32,"Url"),t(),i(33,"div"),r(34),t()()()()}if(a&2){let e=s();l(10),g(e.model.creationDate),l(5),g(e.model.superName?"SuperAdmin "+e.model.superName:e.model.user.name),l(4),u("innerHtml",e.model.fullMessageHtml,w),l(5),g(e.model.ipAddress),l(5),g(e.model.logLevel),l(5),g(e.model.pageUrl)}}var z=class a{constructor(n,e,m,o){this.logService=n;this.helperService=e;this.appService=m;this.fileService=o}logs=[];filter={};model={};totalCount=0;dates={};rangeFrom=null;rangeTo=null;ngOnInit(){this.activate()}activate(){this.filter.from=(0,A.default)().startOf("month").format("YYYY-MM-DD"),this.filter.to=(0,A.default)().endOf("month").format("YYYY-MM-DD"),this.filter.page=0,this.filter.logLevelId="Tracking",this.filter.keyword="",this.filter.pageSize=30,this.bind()}search(){this.filter.page=0,this.filter.from=document.getElementById("fromDate").value,this.filter.to=document.getElementById("toDate").value,this.bind()}bind(){console.log(this.filter),this.logService.get(this.filter).subscribe({next:n=>this.setLogs(n),error:n=>this.helperService.handlerException(n)})}descargarArchivo(){this.fileService.downloadFile("/api/v1/logs/export/",this.filter).subscribe({next:n=>{document.location.href=n}})}nextPage(){this.filter.page+=1,this.bind()}detail(n){this.model=n,this.model.fullMessageHtml=this.helperService.trustAsHtml(this.model.fullMessage.replace(/\n/g,"<br />"))}setLogs(n){console.log(n),this.filter.page===0&&(this.logs=[]);for(var e=0;e<n.results.length;e++){try{n.results[e].date=n.results[e].creationDate.getFullDate()}catch(m){console.error(m),n.results[e].date=n.results[e].creationDate}n.results[e].user||(n.results[e].fullMessage.indexOf("Elemento:User Id:")>-1?n.results[e].user={name:"Registro usuario"}:n.results[e].user={name:"Sistema"}),this.logs.push(n.results[e])}this.totalCount=n.meta.totalCount+" registros",this.filter.hasNextPage=n.meta.hasNextPage}trackByLogID(n,e){return e.logID}static \u0275fac=function(e){return new(e||a)(_(R),_(V),_(F),_(j))};static \u0275cmp=E({type:a,selectors:[["app-admin-activity-log"]],standalone:!0,features:[I],decls:2,vars:2,consts:[["class","admin-content",4,"ngIf"],[1,"admin-content"],[1,"section-tit"],["routerLink","/administrador",1,"btn-close"],[1,"icon-close"],["novalidate","",1,"form-table",3,"ngSubmit"],[1,"cl-2"],["type","text","name","filter",3,"ngModelChange","ngModel"],[1,"filtre-wDatePick","cl-2"],[1,"filtre-dateCol"],["id","fromDate","readonly","","appDateTime","","type","text","name","fromDate",3,"ngModelChange","from","ngModel"],["id","toDate","readonly","","appDateTime","","type","text","name","toDate",3,"ngModelChange","to","
1ngModel"],["type","submit","value","Buscar",1,"btn-search"],["type","button","value","Descargar",1,"btn-search",3,"click"],[1,"content-table"],[1,"table-admin"],["width","20%"],["width","60%"],["width","20%",2,"text-align","right"],["class","cursor-pointer",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[1,"cursor-pointer",3,"click"],[2,"text-align","right"],[1,"more-page",3,"click"],[1,"icon-down"],[1,"btn-close",3,"click"],[2,"padding","10px 0"],[3,"innerHtml"]],template:function(e,m){e&1&&h(0,K,35,9,"div",0)(1,X,35,6,"div",0),e&2&&(u("ngIf",!m.model.logID),l(),u("ngIf",m.model.logID))},dependencies:[D,L,M,Y,W,N,H,B,O,P,T,k,U]})};export{z as AdminActivityLogComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.