import{r as t,h as e,H as s}from"./p-9f21f85f.js";import{L as i}from"./p-e8a169b7.js";import{T as o}from"./p-968ee2ec.js";import"./p-aa5ffe14.js";import"./p-31e77e7b.js";import"./p-105f7627.js";const a=class{constructor(e){t(this,e),this.domains=i.init(),this.logs=i.init(),this.relativeTime=30,this.startDate=void 0,this.endDate=void 0}componentWillLoad(){this.endDate=new Date,this.startDate=new Date((new Date).getTime()-60*this.relativeTime*1e3),this.fetchList()}async fetchList(){this.selectedDomain="api.mentornity.com",this.fetchLogs()}async fetchLogs(){const{logs:t,endDate:e,startDate:s}=this;this.logs=this.logs.beforeFetch();const i=await this.apiServicesDamga.getLogs(this.selectedDomain,s,e).catch((e=>{this.logs=t.afterFetchError(e)}));i&&(this.logs=t.afterFetch(i))}render(){const{logs:t}=this,i=t.data||[];return e(s,{class:"-container d-flex flex-grow-1 flex-column"},e("dvn-list-view-table",{config:{fields:[{fieldId:"msg"},{fieldId:"target-response-time"},{fieldId:"method"},{fieldId:"path"},{fieldId:"status-code"},{fieldId:"time"}],columns:{msg:{width:200},"target-response-time":{width:100},method:{width:100},path:{weight:1},"status-code":{width:100},time:{width:200}}},fields:[new o("msg","Message"),new o("target-response-time","Duration"),new o("method","Method"),new o("path","Path"),new o("status-code","Status Code"),new o("time","Time")],items:i,isEndReached:t.isEndReached(),isProgressing:t.isPending,error:t.error?"Fetching list failed":void 0,onRetry:()=>this.fetchLogs(),scrollToFit:!0}))}};a.style="";export{a as damga_domain_logs}