import{a as Q,b as U}from"./chunk-3VHHFWVY.js";import{d as te}from"./chunk-OQMWV4LA.js";import{a as X}from"./chunk-G5QQX4VN.js";import{f as $,g as ee}from"./chunk-CV35HHXX.js";import{a as Z}from"./chunk-VDODMHDR.js";import{d as Y}from"./chunk-IEJVBN5K.js";import{E as A,c as H,h as z,o as q}from"./chunk-MDIMQ3H3.js";import{b as K}from"./chunk-7CQSSHSC.js";import{n as O,q as G}from"./chunk-TKVDP62Z.js";import{Ad as N,Bb as f,Cc as T,Db as x,Dc as E,Ec as I,Fb as k,Gb as W,Hb as M,Ib as s,Jb as i,Kb as o,Kc as y,Mc as v,Qc as P,Ub as h,Vd as R,Xb as D,Xd as j,Za as l,Zb as m,eb as _,ib as w,mc as p,nb as F,nd as J,ob as L,oc as S,rc as u,sc as C,tc as b,va as c,vd as V,wa as g,xd as B}from"./chunk-GJDGQISV.js";var oe=()=>["/menu/Developer/Webhook/Job_Logs/Detail"],ne=n=>({ID:n}),ae=(n,d)=>({"text-success":n,"text-danger":d});function re(n,d){if(n&1){let e=h();i(0,"div",12)(1,"h6"),p(2,"Status"),o(),i(3,"ng-select",13),b("ngModelChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.Status,t)||(r.pageData.Filter.Status=t),g(t)}),o(),i(4,"h6"),p(5,"Job ID"),o(),i(6,"input",14),b("ngModelChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.JobID,t)||(r.pageData.Filter.JobID=t),g(t)}),o(),i(7,"h6"),p(8,"From"),o(),i(9,"datepicker",15),b("dateChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),g(t)}),o(),i(10,"h6"),p(11,"To"),o(),i(12,"datepicker",16),b("dateChange",function(t){c(e);let r=m(2);return C(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),g(t)}),o()()}if(n&2){let e=m(2);l(3),s("disabled",!e.role.developer.Edit)("items",e.pageData.Options.Status),u("ngModel",e.pageData.Filter.Status),l(3),u("ngModel",e.pageData.Filter.JobID),l(3),s("isFloatingLabel",!1),u("date",e.pageData.Filter.From),l(3),s("isFloatingLabel",!1),u("date",e.pageData.Filter.To)}}function le(n,d){if(n&1&&(i(0,"tr",9)(1,"td")(2,"a",17),p(3),y(4,"date"),o()(),i(5,"td"),p(6),y(7,"number"),o(),i(8,"td",18),p(9),o()()),n&2){let e=d.$implicit;l(2),s("routerLink",T(12,oe))("queryParams",E(13,ne,e._id)),l(),S(" ",v(4,6,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," "),l(3),S("",v(7,9,e.DurationInSecond,"1.1-1")," s"),l(2),s("ngClass",I(15,ae,e._source.log.respCode==200,e._source.log.respCode!=200)),l(),S(" ",e._source.log.respCode," ")}}function pe(n,d){if(n&1){let e=h();i(0,"mat-paginator",19),D("page",function(t){c(e);let r=m(2);return g(r.onPaginationChange(t))}),o()}if(n&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function me(n,d){if(n&1){let e=h();i(0,"mainpanel-cmp",2),D("onSubmit",function(){c(e);let t=m();return g(t.searchFromPageOne())}),i(1,"filters"),L(2,re,13,8,"ng-template",null,0,P),o(),i(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr",7)(10,"th",8),p(11,"Created"),o(),i(12,"th",8),p(13,"Duration"),o(),i(14,"th",8),p(15,"Status"),o()()(),i(16,"tbody"),W(17,le,10,18,"tr",9,k),o()()(),i(19,"div",10),f(20,pe,1,3,"mat-paginator",11),o()()()()}if(n&2){let e=m();s("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),l(17),M(e.data.hits),l(3),x(e.pagination.listTotal>0?20:-1)}}var ie=class n extends X{constructor(e,a,t,r){super(e,a,"Developer/DeveloperSpace/Webhook/JobLogs","Developer/DeveloperSpace/WebhookLoader/GetLogs",t);this.httpService=a;this.role=r}postInit(e){this.data.hits=this.data?.hits.map(a=>(a.DurationInSecond=parseInt(a._source?.Duration)/1e3,a)),this.data.ListTotal=e?.total?.value}static \u0275fac=function(a){return new(a||n)(_(Z),_(G),_(O),_(K))};static \u0275cmp=w({type:n,selectors:[["app-webhook-job-logs"]],features:[F],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown"],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","50px"],[1,"border-bottom"],[1,"mt-2"],[3,"length","pageSize","pageIndex"],[1,"dialog-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose a status","appendTo","body",3,"ngModelChange","disabled","items","ngModel"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[3,"routerLink","queryParams"],[3,"ngClass"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&f(0,me,21,4,"mainpanel-cmp",1),a&2&&x(t.data?0:-1)},dependencies:[N,J,ee,$,te,U,Q,Y,A,H,z,q,j,R,B,V],encapsulation:2})};export{ie as a};
