PageSourceSearch

https://cdn.sheetsfinance.com/public-site/_nuxt/CXmIRbsB.js

js sheetsfinance.com collected 2026-09-24 14:02:15 UTC 15,179 bytes, 1 lines download raw bytes

1import{_ as U,$ as C,l as m,G as _,M as t,n as i,m as p,V as c,K as x,E as T,o as u,U as g,a6 as S,a7 as N}from"./1_UnC8sM.js";import{E as j}from"./AJXR_NRB.js";import{a as L,E as I}from"./BvTRE17i.js";import"./T2ujQnoX.js";import"./dBoGhGW0.js";import"./CAYZMAcB.js";import"./D8wfpj_Q.js";/* empty css        */import"./l0sNRNKZ.js";import{E as M}from"./wK0-O32G.js";import{u as H}from"./wJgYOEo8.js";import{r as B}from"./DmYciNCf.js";import{r as O}from"./fajhysOZ.js";import{r as F}from"./CeDEOmSB.js";import{r as P}from"./zy1kb4uh.js";import{r as Y}from"./FqqQQrMh.js";import"./C2n3FOin.js";import"./BUADUvnR.js";import"./BbSfVKWN.js";import"./Cq9Fpw4b.js";import"./6EjoR8TF.js";import"./Cgsswmak.js";import"./UhHlwtlq.js";import"./Bp3YSIOJ.js";import"./BB_Ol6Sd.js";import"./bi5NXo4Q.js";import"./DlWEZPkf.js";const{createChart:y,destroyChart:f,destroyAllCharts:$}=H(),V={name:"CacheEndpointDetail",components:{ChartBarIcon:B,WifiIcon:O,ArrowTrendingUpIcon:F,CalculatorIcon:P,ArrowTopRightOnSquareIcon:Y},data(){return{loading:!0,error:null,endpointData:null,endpointChartData:null,dateRange:null,dailyChart:null,hourlyChart:null,eventChart:null}},computed:{endpointName(){return decodeURIComponent(this.$route.params.id||"")},endpointDisplayName(){var e;return this.formatTrackedEndpointName(((e=this.endpointData)==null?void 0:e.endpoint)||this.endpointName)},endpointSummary(){var n;const e=((n=this.endpointData)==null?void 0:n.summary)||{},a=e.date_range||{};return{total_calls:0,event_totals:{},most_active_event:null,peak_daily:0,date_range:{from:"",to:"",days:0,...a},...e}},eventTotals(){return this.endpointSummary.event_totals||{}},totalCacheErrors(){return(this.eventTotals.cache_error||0)+(this.eventTotals.prev_close_cache_error||0)},cacheHitRateLabel(){const e=this.eventTotals.cache_hit||0,a=this.eventTotals.cache_miss||0,n=e+a;return n?`${(e/n*100).toFixed(1)}%`:"0.0%"},eventTableData(){var a;const e=((a=this.endpointData)==null?void 0:a.events)||{};return Object.entries(e).map(([n,r])=>({rawEvent:n,event:this.formatEventName(n),totalCalls:r.total_calls||0,connectionCount:Object.keys(r.connections||{}).length,peakDaily:Math.max(...Object.values(r.daily_totals||{}),0),lastUsed:this.getLastUsedDate(r.daily_totals||{})})).sort((n,r)=>r.totalCalls-n.totalCalls)},connectionTableData(){var n;const e={},a=((n=this.endpointData)==null?void 0:n.events)||{};return Object.values(a).forEach(r=>{Object.entries(r.connections||{}).forEach(([o,s])=>{e[o]||(e[o]={id:o,total:0,eventCount:0,peakDaily:0,lastUsedRaw:"",lastUsed:"Never"}),e[o].total+=s.total||0,e[o].eventCount+=1,e[o].peakDaily=Math.max(e[o].peakDaily,...Object.values(s.daily||{}),0);const d=this.getLastUsedDateKey(s.daily||{});d&&(!e[o].lastUsedRaw||d>e[o].lastUsedRaw)&&(e[o].lastUsedRaw=d,e[o].lastUsed=this.formatDate(d))})}),Object.values(e).sort((r,o)=>o.total-r.total)}},async mounted(){this.setDefaultDateRange(),await this.fetchEndpointData(),this.createCharts()},beforeUnmount(){$()},methods:{async fetchEndpointData(){try{this.loading=!0,this.error=null;const e=new URLSearchParams;e.append("endpoint",this.endpointName),this.dateRange&&this.dateRange.length===2&&(e.append("date_from",this.dateRange[0]),e.append("date_to",this.dateRange[1]));const a=e.toString(),n=`${this.$config.public.DATA_API_URL}/admin/cache-metrics/endpoint?${a}`,r=`${this.$config.public.DATA_API_URL}/admin/cache-metrics/endpoint/chart-data?${a}`,[o,s]=await Promise.all([C(n,{credentials:"include",headers:{Accept:"application/json"}}),C(r,{credentials:"include",headers:{Accept:"application/json"}})]);this.endpointData=o.data||o,this.endpointChartData=s.data||s}catch{this.error="Failed to load cache endpoint data. Please try again later.",M.error({title:"Error",message:this.error})}finally{this.loading=!1}},createCharts(){this.$nextTick(()=>{this.createDailyChart(),this.createHourlyChart(),this.createEventChart()})},createDailyChart(){if(!this.endpointChartData||!this.$refs.dailyChart)return;const e=this.endpointChartData.daily_usage||[],a=e.map(r=>this.formatDate(r.date)),n=e.map(r=>r.calls);this.dailyChart=y(this.$refs.dailyChart,{id:"cacheEndpointDailyChart",type:"line",data:{labels:a,datasets:[{label:"Daily Events",data:n,borderColor:"rgba(59, 130, 246, 1)",backgroundColor:"rgba(59, 130, 246, 0.1)",fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{dis
1play:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}}}}})},createHourlyChart(){if(!this.endpointChartData||!this.$refs.hourlyChart)return;const e=this.endpointChartData.hourly_usage||[],a=e.map(r=>this.formatChartHour(r.hour)),n=e.map(r=>r.calls);this.hourlyChart=y(this.$refs.hourlyChart,{id:"cacheEndpointHourlyChart",type:"bar",data:{labels:a,datasets:[{label:"Hourly Events",data:n,backgroundColor:"rgba(16, 185, 129, 0.8)",borderColor:"rgba(16, 185, 129, 1)",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}}}}})},createEventChart(){if(!this.endpointChartData||!this.$refs.eventChart)return;const e=this.endpointChartData.event_breakdown||[],a=e.map(r=>this.formatEventName(r.event)),n=e.map(r=>r.calls);this.eventChart=y(this.$refs.eventChart,{id:"cacheEndpointEventChart",type:"bar",data:{labels:a,datasets:[{label:"Event Calls",data:n,backgroundColor:"rgba(249, 115, 22, 0.8)",borderColor:"rgba(249, 115, 22, 1)",borderWidth:1}]},options:{indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{beginAtZero:!0,ticks:{precision:0}}}}})},formatTrackedEndpointName(e){return e?e.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"N/A"},formatEventName(e){return e?e.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"N/A"},formatDate(e){if(!e)return"";if(e.includes("-")){const[o,s,d]=e.split("-");return`${d}/${s}/${o}`}const a=e.substr(0,4),n=e.substr(4,2);return`${e.substr(6,2)}/${n}/${a}`},formatDateRange(e,a){return`${this.formatDate(e)} - ${this.formatDate(a)}`},formatChartHour(e){return e?new Date(e).toLocaleString("en-AU",{timeZone:"Australia/Melbourne",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}):""},getLastUsedDate(e){const a=this.getLastUsedDateKey(e);return a?this.formatDate(a):"Never"},getLastUsedDateKey(e){return Object.keys(e||{}).sort().pop()||""},goBack(){this.$router.push("/kiosk/cache")},viewConnectionDetail(e){const a=this.$router.resolve({path:`/kiosk/analytics/${e}`}).href;window.open(a,"_blank")},handleDateRangeChange(e){this.dateRange=e},async applyDateFilter(){await this.fetchEndpointData(),this.updateCharts()},async clearDateFilter(){this.setDefaultDateRange(),await this.fetchEndpointData(),this.updateCharts()},updateCharts(){f("cacheEndpointDailyChart"),f("cacheEndpointHourlyChart"),f("cacheEndpointEventChart"),this.$nextTick(()=>{this.createDailyChart(),this.createHourlyChart(),this.createEventChart()})},setDefaultDateRange(){const e=new Date,a=new Date;a.setDate(e.getDate()-7);const n=r=>{const o=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),d=String(r.getDate()).padStart(2,"0");return`${o}-${s}-${d}`};this.dateRange=[n(a),n(e)]}}},l=e=>(S("data-v-62a7c014"),e=e(),N(),e),W={class:"endpoint-detail"},q={class:"mb-8"},z={class:"flex items-center gap-4 mb-4"},K=l(()=>t("h1",{class:"text-3xl font-bold text-gray-900"},"Cache Endpoint Details",-1)),Z={class:"text-gray-600 mt-1"},G={key:0,class:"flex items-center justify-center h-64"},J=l(()=>t("div",{class:"text-center"},[t("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t("p",{class:"text-gray-600 mt-4"},"Loading cache details...")],-1)),Q=[J],X={key:1,class:"bg-red-50 border border-red-200 rounded-lg p-6 text-center"},tt=l(()=>t("h3",{class:"text-lg font-semibold text-red-800 mb-2"},"Error Loading Data",-1)),et={class:"text-red-600 mb-4"},at={key:2},st={class:"mb-6 bg-white p-4 rounded-lg shadow-md border"},ot={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},rt={class:"flex flex-col sm:flex-row sm:items-center gap-4"},nt=l(()=>t("label",{class:"text-sm font-medium text-gray-700"},"Filter by Date Range:",-1)),it={class:"flex gap-2"},lt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"},dt={class:"bg-white p-6 rounded-lg shadow-md border"},ct={class:"flex items-center justify-between"},ht=l(()=>t("p",{class:"text-sm font-medium text-gray-600"},"Total Events",-1)),pt={class:"text-2xl font-bold text-blue-600"},mt={class:"p-3 bg-blue-100 rounded-full"},_t={class:"bg-white p-6 rounded-lg shadow-md border"},ut={class:"flex items-center justify-between"},gt=l(()=>t("p",{class:"text-sm font-medium text-gray-600"},"Cache Hit Rate",-1)),bt={class:"text-2xl font-bold text-green-600"},yt={class:"p-3 bg-green-100 rounded-full"},ft={class:"bg-white p-6 rounded-lg shadow-md border"},vt={class:"flex items-center justify-between"},Ct=l(()=>t("p",{class:"text-sm font-medium text-gray-600"},"Upstream Fetches",-1)),xt={class:"text-2xl font-bold text-purple-600"},Dt={class:"text-xs text-gray-500"},wt={class:"p-3 bg-purple-100 rounded-full"},kt={class:"bg-white p-6 rounded-lg shadow-md border"},Et={class:"flex items-center justify-between"},Rt=l(()=>t("p",{class:"text-sm font-medium text-gray-600"},"Cache Errors",-1)),At={class:"text-2xl font-bold text-orange-600"},Ut={class:"text-xs text-gray-500"},Tt={class:"p-3 bg-orange-100 rounded-full"},St={class:"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8"},Nt={class:"bg-white p-6 rounded-lg shadow-md border"},jt=l(()=>t("h3",{class:"text-lg font-semibold text-gray-900 mb-4"},"Daily Cache Activity",-1)),Lt={class:"h-80"},It={ref:"dailyChart"},Mt={class:"bg-white p-6 rounded-lg shadow-md border"},Ht=l(()=>t("h3",{class:"text-lg font-semibold text-gray-900 mb-4"},"Event Breakdown",-1)),Bt={class:"h-80"},Ot={ref:"eventChart"},Ft={key:0,class:"bg-white p-6 rounded-lg shadow-md border mb-8"},Pt=l(()=>t("h3",{class:"text-lg font-semibold text-gray-900 mb-4"},"Hourly Cache Activity",-1)),Yt={class:"h-80"},$t={ref:"hourlyChart"},Vt={class:"bg-white rounded-lg shadow-md border mb-8"},Wt=l(()=>t("div",{class:"px-6 py-4 border-b border-gray-200"},[t("h3",{class:"text-lg font-semibold text-gray-900"},"Summary Information")],-1)),qt={class:"p-6"},zt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},Kt=l(()=>t("h4",{class:"font-medium text-gray-900 mb-2"},"Date Range",-1)),Zt={class:"text-sm text-gray-600"},Gt={class:"text-xs text-gray-500 mt-1"},Jt=l(()=>t("h4",{class:"font-medium text-gray-900 mb-2"},"Peak Daily Activity",-1)),Qt={class:"text-sm text-gray-600"},Xt=l(()=>t("h4",{class:"font-medium text-gray-900 mb-2"},"Most Active Event",-1)),te={class:"text-sm text-gray-600"},ee={class:"bg-white rounded-lg shadow-md border mb-8"},ae=l(()=>t("div",{class:"px-6 py-4 border-b border-gray-200"},[t("h3",{class:"text-lg font-semibold text-gray-900"},"Event Totals")],-1)),se={class:"overflow-x-auto"},oe={class:"bg-white rounded-lg shadow-md border"},re=l(()=>t("div",{class:"px-6 py-4 border-b border-gray-200"},[t("h3",{class:"text-lg font-semibold text-gray-900"},"Connection Activity")],-1)),ne={class:"overflow-x-auto"};function ie(e,a,n,r,o,s){const d=T,D=j,w=m("ChartBarIcon"),k=m("WifiIcon"),E=m("ArrowTrendingUpIcon"),R=m("CalculatorIcon"),h=I,v=L,A=m("ArrowTopRightOnSquareIcon");return u(),_("div",W,[t("div",q,[t("div",z,[i(d,{onClick:s.goBack,type:"primary"},{default:p(()=>[g(" ← Back to Cache ")]),_:1},8,["onClick"]),t("div",null,[K,t("p",Z,c(s.endpointDisplayName),1)])])]),o.loading?(u(),_("div",G,Q)):o.error?(u(),_("div",X,[tt,t("p",et,c(o.error),1),i(d,{onClick:s.fetchEndpointData,t
1ype:"primary"},{default:p(()=>[g(" Retry ")]),_:1},8,["onClick"])])):o.endpointData&&o.endpointChartData?(u(),_("div",at,[t("div",st,[t("div",ot,[t("div",rt,[nt,i(D,{modelValue:o.dateRange,"onUpdate:modelValue":a[0]||(a[0]=b=>o.dateRange=b),type:"daterange","range-separator":"to","start-placeholder":"Start date","end-placeholder":"End date",format:"DD/MM/YYYY","value-format":"YYYY-MM-DD",size:"default",onChange:s.handleDateRangeChange,clearable:!0,"popper-class":"kiosk-date-range-popper",class:"w-full sm:w-auto"},null,8,["modelValue","onChange"])]),t("div",it,[i(d,{type:"primary",onClick:s.applyDateFilter,loading:o.loading,size:"default"},{default:p(()=>[g(" Apply Filter ")]),_:1},8,["onClick","loading"]),i(d,{onClick:s.clearDateFilter,size:"default"},{default:p(()=>[g(" Clear ")]),_:1},8,["onClick"])])])]),t("div",lt,[t("div",dt,[t("div",ct,[t("div",null,[ht,t("p",pt,c(s.endpointSummary.total_calls),1)]),t("div",mt,[i(w,{class:"w-6 h-6 text-blue-600"})])])]),t("div",_t,[t("div",ut,[t("div",null,[gt,t("p",bt,c(s.cacheHitRateLabel),1)]),t("div",yt,[i(k,{class:"w-6 h-6 text-green-600"})])])]),t("div",ft,[t("div",vt,[t("div",null,[Ct,t("p",xt,c(s.eventTotals.upstream_fetch||0),1),t("p",Dt,"Prev close: "+c(s.eventTotals.prev_close_upstream_fetch||0),1)]),t("div",wt,[i(E,{class:"w-6 h-6 text-purple-600"})])])]),t("div",kt,[t("div",Et,[t("div",null,[Rt,t("p",At,c(s.totalCacheErrors),1),t("p",Ut,"Most active: "+c(s.endpointSummary.most_active_event||"N/A"),1)]),t("div",Tt,[i(R,{class:"w-6 h-6 text-orange-600"})])])])]),t("div",St,[t("div",Nt,[jt,t("div",Lt,[t("canvas",It,null,512)])]),t("div",Mt,[Ht,t("div",Bt,[t("canvas",Ot,null,512)])])]),o.endpointChartData.hourly_usage&&o.endpointChartData.hourly_usage.length?(u(),_("div",Ft,[Pt,t("div",Yt,[t("canvas",$t,null,512)])])):x("",!0),t("div",Vt,[Wt,t("div",qt,[t("div",zt,[t("div",null,[Kt,t("p",Zt,c(s.formatDateRange(s.endpointSummary.date_range.from,s.endpointSummary.date_range.to)),1),t("p",Gt,c(s.endpointSummary.date_range.days)+" days",1)]),t("div",null,[Jt,t("p",Qt,c(s.endpointSummary.peak_daily)+" events ",1)]),t("div",null,[Xt,t("p",te,c(s.formatEventName(s.endpointSummary.most_active_event)),1)])])])]),t("div",ee,[ae,t("div",se,[i(v,{data:s.eventTableData,style:{width:"100%"}},{default:p(()=>[i(h,{prop:"event",label:"Event","min-width":"220",sortable:""}),i(h,{prop:"totalCalls",label:"Total Calls","min-width":"140",sortable:"",align:"right"}),i(h,{prop:"connectionCount",label:"Connections","min-width":"130",sortable:"",align:"right"}),i(h,{prop:"peakDaily",label:"Peak Daily","min-width":"130",sortable:"",align:"right"}),i(h,{prop:"lastUsed",label:"Last Used","min-width":"160",sortable:""})]),_:1},8,["data"])])]),t("div",oe,[re,t("div",ne,[i(v,{data:s.connectionTableData,style:{width:"100%"}},{default:p(()=>[i(h,{prop:"id",label:"Connection ID","min-width":"180"}),i(h,{prop:"total",label:"Total Events","min-width":"130",sortable:"",align:"right"}),i(h,{prop:"eventCount",label:"Event Types","min-width":"120",sortable:"",align:"right"}),i(h,{prop:"peakDaily",label:"Peak Daily","min-width":"120",sortable:"",align:"right"}),i(h,{prop:"lastUsed",label:"Last Used","min-width":"160",sortable:""}),i(h,{label:"Actions","min-width":"150"},{default:p(b=>[i(d,{size:"small",onClick:le=>s.viewConnectionDetail(b.row.id)},{default:p(()=>[g(" Connection "),i(A,{class:"w-3 h-3 ml-1 inline-block"})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])])):x("",!0)])}const Me=U(V,[["render",ie],["__scopeId","data-v-62a7c014"]]);export{Me as default};

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.