PageSourceSearch

https://jobpoint.ai/build/assets/Index-abc88697.js

js jobpoint.ai collected 2026-10-05 15:09:06 UTC 13,329 bytes, 1 lines download raw bytes

1import{R as q,c as g,o as i,d as r,e as f,h as l,f as t,t as s,A as z,P as p,Z as k,F as x,B as h,Q as v,y as V,i as w,q as j,a0 as W,p as H,m as P,M as B,U as Q,V as Z}from"./vue-vendor-239f2361.js";import{_ as J,a as X}from"./HeaderSegment-a58593f7.js";import{_ as tt}from"./Paginate-9e3721c9.js";import{_ as T}from"./NoDataFound-1a1a5865.js";import{t as o}from"./app-d19f38dc.js";import{_ as et}from"./_plugin-vue_export-helper-c27b6911.js";import"./sharedComposable-84db5671.js";import"./notify-e63650aa.js";import"./modalComposable-82726ce9.js";import"./all-e7d38a4a.js";import"./Modal-e27e1bcb.js";/* empty css            */const $=u=>(Q("data-v-ea2ed1fc"),u=u(),Z(),u),st={class:"container space-y-6 p-4 sm:p-6 admin-pill"},ot={class:"text-xl font-semibold text-slate-900 dark:text-slate-100"},lt={class:"text-sm text-slate-500"},at={class:"rounded-xl border border-slate-100 bg-white p-5 dark:border-slate-700 dark:bg-slate-900"},nt=["onSubmit"],it={class:"xl:col-span-3"},rt={for:"ai-module",class:"mb-1 block text-xs font-medium text-slate-500"},ct={value:""},dt=["value"],ut={class:"xl:col-span-3"},_t={for:"ai-model",class:"mb-1 block text-xs font-medium text-slate-500"},mt={value:""},pt=["value"],xt={class:"xl:col-span-2"},ht={for:"ai-status",class:"mb-1 block text-xs font-medium text-slate-500"},bt={value:""},ft={value:"success"},yt={value:"failed"},gt={class:"xl:col-span-4"},kt={for:"ai-user",class:"mb-1 block text-xs font-medium text-slate-500"},vt={class:"relative"},wt=$(()=>t("i",{class:"bx bx-search pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"},null,-1)),$t=["placeholder"],Ft={class:"xl:col-span-2"},At={for:"ai-from",class:"mb-1 block text-xs font-medium text-slate-500"},Ct={class:"xl:col-span-2"},St={for:"ai-to",class:"mb-1 block text-xs font-medium text-slate-500"},It=["min"],Mt={class:"flex flex-wrap items-center gap-2 sm:col-span-2 xl:col-span-8"},Ut={class:"flex min-w-0 flex-1 flex-wrap items-center gap-2"},Nt={class:"text-sm text-slate-500"},Vt=["aria-label","onClick"],jt=$(()=>t("i",{class:"bx bx-x text-sm"},null,-1)),Bt={type:"submit",class:"btn btn-primary btn-sm"},Tt=$(()=>t("i",{class:"bx bx-filter-alt"},null,-1)),Dt={class:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4"},Ot={class:"flex items-center gap-3"},Et={class:"flex h-10 w-10 items-center justify-center rounded-full bg-primary-50 text-lg text-primary-600"},Lt={class:"text-sm font-medium text-slate-500"},Gt={class:"mt-3 text-2xl font-semibold tracking-tight text-slate-900 dark:text-slate-100"},Kt={class:"mt-1 text-xs text-slate-400"},Rt={class:"rounded-xl border border-slate-100 bg-white dark:border-slate-700 dark:bg-slate-900"},Yt={class:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-100 px-5 py-4 dark:border-slate-700"},qt={class:"text-base font-semibold text-slate-900 dark:text-slate-100"},zt={class:"text-sm text-slate-500"},Wt={class:"table-responsive"},Ht={class:"table ai-table"},Pt={class:"w-1/4"},Qt={class:"text-right"},Zt={class:"text-right"},Jt={class:"text-right"},Xt={key:0},te=["onClick","onKeydown"],ee={class:"font-medium text-slate-800 dark:text-slate-100"},se={class:"font-mono text-xs text-slate-400"},oe={class:"flex items-center gap-3"},le={class:"h-2 flex-1 overflow-hidden rounded-full bg-slate-100 dark:bg-slate-700"},ae={class:"w-14 text-right text-sm tabular-nums text-slate-700 dark:text-slate-200"},ne={class:"text-right tabular-nums"},ie={class:"text-right tabular-nums"},re={class:"text-right tabular-nums"},ce={key:1},de={class:"rounded-xl border border-slate-100 bg-white dark:border-slate-700 dark:bg-slate-900"},ue={class:"border-b border-slate-100 px-5 py-4 dark:border-slate-700"},_e={class:"text-base font-semibold text-slate-900 dark:text-slate-100"},me={class:"text-sm text-slate-500"},pe={class:"table-responsive"},xe={class:"table ai-table"},he={class:"text-right"},be={class:"text-right"},fe={class:"text-right"},ye={key:0},ge={class:"whitespace-nowrap text-sm text-slate-600 dark:text-slate-300"},ke={class:"max-w-[11rem] font-medium leading-snug text-slate-800 dark:text-slate-100"},ve={key:0,class:"text-xs text-slate-400"},we=["title"],$e={class:"whitespace-nowrap text-right tabular-nums"},Fe={class:"text-xs text-slate-400"},Ae={class:"whitespace-nowrap text-right tabular-nums"},Ce={key:0},Se={key:1,class:"text-xs text-slate-400"},Ie={key:2,class:"text-xs text-slate-400"},Me={class:"whitespace-nowrap text-right tabular-nums"},Ue={key:0,class:"max-w-[11rem]"},Ne=["title"],Ve=["title"],je={key:1,class:"text-slate-400"},Be={key:1},Te={class:"px-5 pb-4"},De=P({layout:X}),Oe=Object.assign(De,{__name:"Index",props:{usage:Object,totals:Object,byComponent:Array,components:Array,models:{type:Array,default:()=>[]},filters:Object}
1,setup(u){var C,S,I,M,U,N;const c=u,d=q({component_type:((C=c.filters)==null?void 0:C.component_type)??"",model_name:((S=c.filters)==null?void 0:S.model_name)??"",status:((I=c.filters)==null?void 0:I.status)??"",user:((M=c.filters)==null?void 0:M.user)??"",date_from:((U=c.filters)==null?void 0:U.date_from)??"",date_to:((N=c.filters)==null?void 0:N.date_to)??""}),D=()=>Object.fromEntries(Object.entries(d.data()).filter(([,a])=>a!==""&&a!==null)),y=()=>{B.get(route("admin.ai-usage.index"),D(),{preserveState:!0,preserveScroll:!0})},O=()=>{d.reset(),Object.keys(d.data()).forEach(a=>d[a]=""),B.get(route("admin.ai-usage.index"),{},{preserveScroll:!0})},F=a=>{d.component_type=a,y()},E=a=>{var n,e;return((e=(n=c.components)==null?void 0:n.find(b=>b.value===a))==null?void 0:e.label)??a},A=g(()=>{const a=c.filters??{},n=[];return a.component_type&&n.push({key:"component_type",label:E(a.component_type)}),a.model_name&&n.push({key:"model_name",label:a.model_name}),a.status&&n.push({key:"status",label:a.status==="failed"?o("Failed"):o("Successful")}),a.user&&n.push({key:"user",label:`${o("User")}: ${a.user}`}),a.date_from&&n.push({key:"date_from",label:`${o("From")} ${a.date_from}`}),a.date_to&&n.push({key:"date_to",label:`${o("To")} ${a.date_to}`}),n}),L=a=>{d[a]="",y()},G=new Intl.NumberFormat("en-GB"),_=a=>G.format(Number(a??0)),m=a=>{if(a==null||a==="")return null;const n=Number(a);if(n>0&&n<1e-4)return"<$0.0001";const e=n!==0&&Math.abs(n)<1?4:2;return`$${n.toLocaleString("en-GB",{minimumFractionDigits:e,maximumFractionDigits:e})}`},K=a=>{if(!a)return"—";const n=new Date(a.replace(" ","T"));if(Number.isNaN(n.getTime()))return a;const e=n.getFullYear()===new Date().getFullYear();return n.toLocaleString("en-GB",{day:"numeric",month:"short",...e?{}:{year:"numeric"},hour:"2-digit",minute:"2-digit"})},R=g(()=>[{label:o("Interactions"),value:_(c.totals.count),sub:c.totals.failed_count?`${_(c.totals.failed_count)} ${o("failed")}`:o("All successful"),icon:"bx-bar-chart-alt-2"},{label:o("Tokens"),value:_(c.totals.total_tokens),sub:`${_(c.totals.prompt_tokens)} ${o("in")} · ${_(c.totals.completion_tokens)} ${o("out")}`,icon:"bx-transfer-alt"},{label:o("Estimated Cost"),value:m(c.totals.total_cost)??"$0.00",sub:c.totals.unknown_cost_count?`${_(c.totals.unknown_cost_count)} ${o("with unknown cost, excluded")}`:o("All costs known"),icon:"bx-calculator"},{label:o("Actual Cost"),value:m(c.totals.total_actual_cost)??"$0.00",sub:o("As billed by the provider"),icon:"bx-dollar-circle"}]),Y=g(()=>Math.max(1,...(c.byComponent??[]).map(a=>a.count)));return(a,n)=>(i(),r("main",st,[f(J,{title:l(o)("AI Usage Analytics"),segments:[]},null,8,["title"]),t("div",null,[t("h1",ot,s(l(o)("AI Usage")),1),t("p",lt,s(l(o)("How much the AI features are used, what they cost, and by whom. Filters apply to everything on this page.")),1)]),t("section",at,[t("form",{class:"grid grid-cols-1 items-end gap-4 sm:grid-cols-2 xl:grid-cols-12",onSubmit:z(y,["prevent"])},[t("div",it,[t("label",rt,s(l(o)("Module")),1),p(t("select",{id:"ai-module","onUpdate:modelValue":n[0]||(n[0]=e=>l(d).component_type=e),class:"select"},[t("option",ct,s(l(o)("All modules")),1),(i(!0),r(x,null,h(u.components,e=>(i(),r("option",{key:e.value,value:e.value},s(e.label),9,dt))),128))],512),[[k,l(d).component_type]])]),t("div",ut,[t("label",_t,s(l(o)("Model")),1),p(t("select",{id:"ai-model","onUpdate:modelValue":n[1]||(n[1]=e=>l(d).model_name=e),class:"select"},[t("option",mt,s(l(o)("All models")),1),(i(!0),r(x,null,h(u.models,e=>(i(),r("option",{key:e,value:e},s(e),9,pt))),128))],512),[[k,l(d).model_name]])]),t("div",xt,[t("label",ht,s(l(o)("Status")),1),p(t("select",{id:"ai-status","onUpdate:modelValue":n[2]||(n[2]=e=>l(d).status=e),class:"select"},[t("option",bt,s(l(o)("Any status")),1),t("option",ft,s(l(o)("Successful")),1),t("option",yt,s(l(o)("Failed")),1)],512),[[k,l(d).status]])]),t("div",gt,[t("label",kt,s(l(o)("User")),1),t("div",vt,[wt,p(t("input",{id:"ai-user","onUpdate:modelValue":n[3]||(n[3]=e=>l(d).user=e),type:"search",class:"input !pl-10",placeholder:l(o)("Name or email")},null,8,$t),[[v,l(d).user]])])]),t("div",Ft,[t("label",At,s(l(o)("From")),1),p(t("input",{id:"ai-from","onUpdate:modelValue":n[4]||(n[4]=e=>l(d).date_from=e),type:"date",class:"input"},null,512),[[v,l(d).date_from]])]),t("div",Ct,[t("label",St,s(l(o)("To")),1),p(t("input",{id:"ai-to","onUpdate:modelValue":n[5]||(n[5]=e=>l(d).date_to=e),type:"date",class:"input",min:l(d).date_from||null},null,8,It),[[v,l(d).date_to]])]),t("div",Mt,[t("div",Ut,[t("span",Nt,s(_(u.totals.count))+" "+s(u.totals.count===1?l(o)("interaction"):l(o)("interactions")),1),(i(!0),r(x,null,h(A.value,e=>(i(),r("button",{key:e.key,type:"button",class:"inline-flex items-center gap-1 rounded-full bg-primary-50 px-3 py-1 text-xs font-medium text-primary-700 hover:bg-primary-100","aria-label":`${l(o)("Remove filter")}: ${e.label}`,onClick:b=>L(e.key)},[V(s(e.label)+" ",1),jt],8,Vt))),128))]),A.value.length?(i(),r("button",{key:0,t
1ype:"button",class:"btn btn-sm text-slate-500 hover:text-slate-700",onClick:O},s(l(o)("Reset")),1)):w("",!0),t("button",Bt,[Tt,V(" "+s(l(o)("Apply Filters")),1)])])],40,nt)]),t("section",Dt,[(i(!0),r(x,null,h(R.value,e=>(i(),r("article",{key:e.label,class:"rounded-xl border border-slate-100 bg-white p-5 dark:border-slate-700 dark:bg-slate-900"},[t("div",Ot,[t("span",Et,[t("i",{class:j(["bx",e.icon])},null,2)]),t("p",Lt,s(e.label),1)]),t("p",Gt,s(e.value),1),t("p",Kt,s(e.sub),1)]))),128))]),t("section",Rt,[t("header",Yt,[t("div",null,[t("h2",qt,s(l(o)("By Module")),1),t("p",zt,s(l(o)("Where the AI is used most. Select a module to filter the log.")),1)])]),t("div",Wt,[t("table",Ht,[t("thead",null,[t("tr",null,[t("th",null,s(l(o)("Module")),1),t("th",Pt,s(l(o)("Interactions")),1),t("th",Qt,s(l(o)("Tokens")),1),t("th",Zt,s(l(o)("Est. Cost")),1),t("th",Jt,s(l(o)("Actual Cost")),1)])]),u.byComponent.length?(i(),r("tbody",Xt,[(i(!0),r(x,null,h(u.byComponent,e=>(i(),r("tr",{key:e.component_type,class:"cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800",tabindex:"0",onClick:b=>F(e.component_type),onKeydown:W(b=>F(e.component_type),["enter"])},[t("td",null,[t("p",ee,s(e.label),1),t("p",se,s(e.component_type),1)]),t("td",null,[t("div",oe,[t("div",le,[t("div",{class:"h-full rounded-full bg-primary-500",style:H({width:`${Math.max(2,e.count/Y.value*100)}%`})},null,4)]),t("span",ae,s(_(e.count)),1)])]),t("td",ne,s(_(e.total_tokens)),1),t("td",ie,s(m(e.total_cost)??"—"),1),t("td",re,s(m(e.total_actual_cost)??"—"),1)],40,te))),128))])):(i(),r("tbody",ce,[f(T,{"for-table":"true"})]))])])]),t("section",de,[t("header",ue,[t("h2",_e,s(l(o)("Usage Log")),1),t("p",me,s(l(o)("Every AI request, newest first.")),1)]),t("div",pe,[t("table",xe,[t("thead",null,[t("tr",null,[t("th",null,s(l(o)("When")),1),t("th",null,s(l(o)("Module")),1),t("th",null,s(l(o)("Model")),1),t("th",he,s(l(o)("Tokens")),1),t("th",be,s(l(o)("Cost")),1),t("th",fe,s(l(o)("Credits")),1),t("th",null,s(l(o)("User")),1),t("th",null,s(l(o)("Status")),1)])]),u.usage.data.length?(i(),r("tbody",ye,[(i(!0),r(x,null,h(u.usage.data,e=>(i(),r("tr",{key:e.id},[t("td",ge,s(K(e.created_at)),1),t("td",null,[t("p",ke,s(e.component_label),1),e.action_type?(i(),r("p",ve,s(e.action_type),1)):w("",!0)]),t("td",null,[t("span",{class:"inline-block max-w-[9.5rem] truncate rounded-full bg-slate-100 px-2.5 py-0.5 font-mono text-xs text-slate-600 dark:bg-slate-800 dark:text-slate-300",title:e.model_name},s(e.model_name||"—"),9,we)]),t("td",$e,[t("p",null,s(_(e.total_tokens)),1),t("p",Fe,s(_(e.prompt_tokens))+" / "+s(_(e.completion_tokens)),1)]),t("td",Ae,[m(e.estimated_cost)?(i(),r("p",Ce,s(m(e.estimated_cost)),1)):(i(),r("p",Se,s(l(o)("Unknown")),1)),m(e.actual_cost)?(i(),r("p",Ie,s(l(o)("Actual"))+" "+s(m(e.actual_cost)),1)):w("",!0)]),t("td",Me,s(e.credits_charged??"—"),1),t("td",null,[e.user?(i(),r("div",Ue,[t("p",{class:"truncate font-medium text-slate-800 dark:text-slate-100",title:e.user.name},s(e.user.name),9,Ne),t("p",{class:"truncate text-xs text-slate-400",title:e.user.email},s(e.user.email),9,Ve)])):(i(),r("span",je,"—"))]),t("td",null,[t("span",{class:j(["inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",e.status==="failed"?"bg-rose-50 text-rose-600":"bg-emerald-50 text-emerald-700"])},s(e.status==="failed"?l(o)("Failed"):l(o)("Success")),3)])]))),128))])):(i(),r("tbody",Be,[f(T,{"for-table":"true"})]))])]),t("div",Te,[f(tt,{links:u.usage.links},null,8,["links"])])])]))}}),Ze=et(Oe,[["__scopeId","data-v-ea2ed1fc"]]);export{Ze 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.