PageSourceSearch

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

js sheetsfinance.com collected 2026-09-24 14:02:16 UTC 10,149 bytes, 1 lines download raw bytes

1import{E as k}from"./AJXR_NRB.js";import{G as p,M as r,o as h,_ as E,$ as w,n as i,m,Q as x,a0 as T,Y as _,E as F,U as f,c as R,a6 as M,a7 as A}from"./1_UnC8sM.js";import{_ as U}from"./BiiO4VIb.js";import{a as S,E as $}from"./BvTRE17i.js";import{v as j}from"./SKTN75BZ.js";import{E as z}from"./wK0-O32G.js";import"./T2ujQnoX.js";import"./dBoGhGW0.js";import"./CAYZMAcB.js";import"./D8wfpj_Q.js";/* empty css        */import"./l0sNRNKZ.js";import{u as N}from"./wJgYOEo8.js";import{r as Y}from"./DmYciNCf.js";import{r as L}from"./BFh_X68E.js";import{r as O}from"./_BxSdwwP.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";function B(t,e){return h(),p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z"})])}const{createChart:v,destroyChart:C,destroyAllCharts:I}=N(),V={name:"KioskCacheIndex",data(){return{loading:!0,cacheMetricsData:{},dateRange:null,upstreamChart:null,dailyChart:null}},computed:{totalTrackedEndpoints(){return Object.keys(this.cacheMetricsData).length},totalUpstreamFetches(){return this.getEventTotalAcrossEndpoints("upstream_fetch")},totalCacheErrors(){return this.getEventTotalAcrossEndpoints("cache_error")+this.getEventTotalAcrossEndpoints("prev_close_cache_error")},topTrackedEndpoint(){const t=this.cacheTableData[0];return t?t.name:"N/A"},topTrackedEndpointFetches(){const t=this.cacheTableData[0];return t?`${t.upstreamFetches} fetches`:""},keyMetricCards(){return[{title:"Tracked Endpoints",value:this.totalTrackedEndpoints,valueColor:null,icon:Y,iconColor:"blue"},{title:"Upstream Fetches",value:this.totalUpstreamFetches,valueColor:null,icon:B,iconColor:"green"},{title:"Cache Errors",value:this.totalCacheErrors,valueColor:this.totalCacheErrors>0?"red":"gray",icon:L,iconColor:this.totalCacheErrors>0?"red":"purple"},{title:"Most Active Endpoint",value:this.topTrackedEndpoint,valueColor:null,extraDetail:this.topTrackedEndpointFetches,icon:O,iconColor:"orange"}]},cacheTableData(){return Object.entries(this.cacheMetricsData).map(([t,e])=>{const a=e.event_totals||{},o=a.cache_hit||0,s=a.cache_miss||0,n=o+s,d=n>0?o/n*100:0;return{rawName:t,name:this.formatTrackedEndpointName(t),totalEvents:e.total||0,hitRate:d,hitRateLabel:`${d.toFixed(1)}%`,upstreamFetches:a.upstream_fetch||0,prevCloseFetches:a.prev_close_upstream_fetch||0,cacheErrors:(a.cache_error||0)+(a.prev_close_cache_error||0),lockWaitTimeouts:(a.lock_wait_timeout||0)+(a.prev_close_lock_wait_timeout||0),connectionCount:e.connection_count||0}}).sort((t,e)=>e.upstreamFetches-t.upstreamFetches||e.totalEvents-t.totalEvents)}},async mounted(){this.dateRange=this.buildDefaultDateRange(),await this.fetchCacheMetrics(),this.initializeCharts()},beforeUnmount(){I()},methods:{buildDefaultDateRange(){const t=new Date,e=new Date;e.setDate(t.getDate()-7);const a=o=>{const s=o.getFullYear(),n=String(o.getMonth()+1).padStart(2,"0"),d=String(o.getDate()).padStart(2,"0");return`${s}-${n}-${d}`};return[a(e),a(t)]},buildMetricsUrl(t){let e=t;const a=new URLSearchParams;return this.dateRange&&this.dateRange.length===2&&(a.append("date_from",this.dateRange[0]),a.append("date_to",this.dateRange[1])),a.toString()&&(e+=`?${a.toString()}`),e},async fetchCacheMetrics(){try{this.loading=!0;const t=this.buildMetricsUrl(`${this.$config.public.DATA_API_URL}/admin/cache-metrics`),e=await w(t,{credentials:"include",headers:{Accept:"application/json"}});this.cacheMetricsData=e.data||e||{}}catch{z.error({title:"Error",message:"Failed to load cache metrics data. Please try again later."})}finally{this.loading=!1}},handleDateRangeChange(t){this.dateRange=t},async applyDateFilter(){await this.fetchCacheMetrics(),this.updateCharts()},async clearDateFilter(){this.dateRange=this.buildDefaultDateRange(),await this.fetchCacheMetrics(),this.updateCharts()},initializeCharts(){this.$nextTick(()=>{this.createUpstreamChart(),this.createDailyChart()})},updateCharts(){C("cacheUpstreamChart"),C("cacheDailyChart"),this.$nextTick(()=>{this.createUpstreamChart(),this.createDailyChart()})},createUpstreamChart(){const t=this.cacheTableData.slice(0,10),e=t.map(o=>o.name),a=t.map(o=>o.upstreamFetches);this.upstreamChart=v(this.$refs.upstreamChart,{id:"cacheUpstreamChart",type:"bar",data:{labels:e,datasets:[{label:"Upstream Fetches",data:a,backgroundColor:"rgba(59, 130, 246, 0.8)",borderColor:"rgba(59, 130, 246, 1)",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{dis
1play:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}},x:{ticks:{maxRotation:45}}}}})},createDailyChart(){const t=this.getAggregatedDailyTotals(),e=Object.keys(t).sort(),a=e.map(s=>this.formatShortMetricsDate(s)),o=e.map(s=>t[s]);this.dailyChart=v(this.$refs.dailyChart,{id:"cacheDailyChart",type:"line",data:{labels:a,datasets:[{label:"Daily Cache Events",data:o,borderColor:"rgba(16, 185, 129, 1)",backgroundColor:"rgba(16, 185, 129, 0.1)",fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}}}}})},getEventTotalAcrossEndpoints(t){return Object.values(this.cacheMetricsData).reduce((e,a)=>e+((a.event_totals||{})[t]||0),0)},getAggregatedDailyTotals(){const t={};return Object.values(this.cacheMetricsData).forEach(e=>{Object.values(e.events||{}).forEach(a=>{Object.values(a.connections||{}).forEach(o=>{Object.entries(o.daily||{}).forEach(([s,n])=>{t[s]=(t[s]||0)+n})})})}),t},formatTrackedEndpointName(t){return t?t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"N/A"},formatShortMetricsDate(t){const e=t.substr(4,2);return`${t.substr(6,2)}/${e}`},viewEndpointDetails(t){this.$router.push(`/kiosk/cache/${encodeURIComponent(t)}`)}}},u=t=>(M("data-v-f2e20e19"),t=t(),A(),t),P={class:"admin-kiosk"},W=u(()=>r("div",{class:"mb-8"},[r("h1",{class:"text-3xl font-bold text-gray-900 mb-2"},"Cache Performance"),r("p",{class:"text-gray-600"}," Track cache hit rates, lock contention, and upstream fetch pressure for cache-protected kiosk endpoints. ")],-1)),H={class:"mb-6 bg-white p-4 rounded-lg shadow-md border"},K={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},Z={class:"flex flex-col sm:flex-row sm:items-center gap-4"},G=u(()=>r("label",{class:"text-sm font-medium text-gray-700"},"Filter by Date Range:",-1)),Q={class:"flex gap-2"},q={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"},J={class:"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8"},X={class:"bg-white p-6 rounded-lg shadow-md border"},tt=u(()=>r("h3",{class:"text-lg font-semibold text-gray-900 mb-4"},"Upstream Fetches By Endpoint",-1)),et={class:"h-80"},at={ref:"upstreamChart"},rt={class:"bg-white p-6 rounded-lg shadow-md border"},st=u(()=>r("h3",{class:"text-lg font-semibold text-gray-900 mb-4"},"Daily Cache Event Trend",-1)),ot={class:"h-80"},it={ref:"dailyChart"},nt={class:"bg-white rounded-lg shadow-md border mb-8"},lt=u(()=>r("div",{class:"px-6 py-4 border-b border-gray-200"},[r("h3",{class:"text-lg font-semibold text-gray-900"},"Tracked Endpoint Details")],-1)),ct={class:"overflow-x-auto"};function ht(t,e,a,o,s,n){const d=k,b=F,y=U,c=$,D=S,g=j;return h(),p("div",P,[W,r("div",H,[r("div",K,[r("div",Z,[G,i(d,{modelValue:s.dateRange,"onUpdate:modelValue":e[0]||(e[0]=l=>s.dateRange=l),type:"daterange","range-separator":"to","start-placeholder":"Start date","end-placeholder":"End date",format:"DD/MM/YYYY","value-format":"YYYY-MM-DD",size:"default",clearable:!0,"popper-class":"kiosk-date-range-popper",class:"w-full sm:w-auto",onChange:n.handleDateRangeChange},null,8,["modelValue","onChange"])]),r("div",Q,[i(b,{type:"primary",size:"default",loading:s.loading,onClick:n.applyDateFilter},{default:m(()=>[f(" Apply Filter ")]),_:1},8,["loading","onClick"]),i(b,{size:"default",onClick:n.clearDateFilter},{default:m(()=>[f(" Clear ")]),_:1},8,["onClick"])])])]),r("div",q,[(h(!0),p(x,null,T(n.keyMetricCards,l=>_((h(),R(y,{key:l.title,title:l.title,value:l.value,valueColor:l.valueColor,icon:l.icon,iconColor:l.iconColor,extraDetail:l.extraDetail},null,8,["title","value","valueColor","icon","iconColor","extraDetail"])),[[g,s.loading]])),128))]),r("div",J,[_((h(),p("div",X,[tt,r("div",et,[r("canvas",at,null,512)])])),[[g,s.loading]]),_((h(),p("div",rt,[st,r("div",ot,[r("canvas",it,null,512)])])),[[g,s.loading]])]),_((h(),p("div",nt,[lt,r("div",ct,[i(D,{data:n.cacheTableData,class:"w-full","default-sort":{prop:"upstreamFetches",order:"descending"}},{default:m(()=>[i(c,{prop:"name",label:"Tracked Endpoint","min-width":"220",sortable:""}),i(c,{prop:"totalEvents",label:"Total Events","min-width":"140",sortable:"",align:"right"}),i(c,{prop:"hitRateLabel",label:"Hit Rate","min-width":"130",sortable:""}),i(c,{prop:"upstreamFetches",label:"Upstream Fetches","min-width":"160",sortable:"",align:"right"}),i(c,{prop:"prevCloseFetches",label:"Prev Close Fetches","min-width":"170",sortable:"",align:"right"}),i(c,{prop:"cacheErrors",label:"Cache Errors","min-width":"140",sortable:"",align:"right"}),i(c,{prop:"lockWaitTimeouts",label:"Lock Timeouts","min-width":"150",sortable:"",align:"right"}),i(c,{prop:"connectionCount",label:"Connections","min-width":"130",sortable:"",align:"right"}),i(c,{label:"Actions","min-width":"160",fixed:"right"},{default:m(l=>[i(b,{type:"primary",size:"small",onClick:dt=>n.viewEndpointDetails(l.row.rawName)},{default:m(()=>[f(" View Details ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])),[[g,s.loading]])])}const Lt=E(V,[["render",ht],["__scopeId","data-v-f2e20e19"]]);export{Lt 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.