PageSourceSearch

https://www.data.gouv.fr/_nuxt/B8U0hVnt.js

js data.gouv.fr collected 2026-09-24 08:28:13 UTC 11,890 bytes, 1 lines download raw bytes

1import rt from"./CsWix9Vj.js";import st from"./CREyIJxC.js";import{b2 as F,b8 as d,b9 as p,ba as u,be as e,bf as t,bd as r,bn as l,b1 as O,bm as T,bl as $,bQ as U,dD as at,dE as ot,bi as C,bc as f,bo as q,bD as lt,bb as w,cB as nt,bj as R,bk as j,aU as it,bK as dt,cp as ct,dj as ut,f4 as pt,bt as mt,f5 as bt,ec as xt,ea as gt,d6 as ht,f6 as _t,eq as vt,f7 as ft,dU as yt}from"./szcXUDxO.js";import{_ as wt}from"./DI3JosPA.js";import{_ as E}from"./DKAXJNwN.js";import{u as Pt}from"./8t0Cb_no.js";import{u as St}from"./DWvpKTj-.js";import{_ as Dt}from"./Bb3kcglz.js";import{f as $t,g as kt,r as zt,a as Mt,c as Ct,d as Ft}from"./CDSNyTT3.js";import"./vjNz0Kjj.js";import"./D9UOlKaQ.js";import"./xa67PyFm.js";import"./B3Ccnh5Q.js";const Nt={class:"flex items-center gap-2"},At={class:"text-xs tabular-nums"},It=F({__name:"PercentageMeter",props:{value:{default:0}},setup(_){const c=_,s=l(()=>{const n=Number(c.value??0);return Number.isFinite(n)?n:0}),m=l(()=>`${s.value.toFixed(1)}%`);return(n,P)=>(d(),p("div",Nt,[u(e(Dt),{value:e(s),max:100,"bar-class":"bg-gray-low",class:"flex-1 !min-w-0"},null,8,["value"]),t("span",At,r(e(m)),1)]))}}),V=Object.assign(It,{__name:"PreviewDashboardPercentageMeter"}),Bt={class:"sr-only"},Lt=F({__name:"DeltaIndicator",props:{value:{},unit:{}},setup(_){const c=_,{t:s}=O(),m=l(()=>kt(zt(c.value??0,c.unit))),n=l(()=>m.value==="up"?"text-new-success":m.value==="down"?"text-new-error":"text-gray-plain"),P=l(()=>m.value==="up"?s("en hausse"):m.value==="down"?s("en baisse"):s("stable"));return(N,A)=>_.value!=null?(d(),p("span",{key:0,class:T(["inline-flex items-center gap-1 text-xs font-medium",e(n)])},[e(m)!=="neutral"?(d(),$(U(e(m)==="up"?e(at):e(ot)),{key:0,class:"size-3","aria-hidden":"true"})):C("",!0),f(" "+r(e($t)(_.value,_.unit))+" ",1),t("span",Bt," ("+r(e(P))+")",1)],2)):C("",!0)}}),D=Object.assign(Lt,{__name:"PreviewDashboardDeltaIndicator"}),qt={class:"mt-2 text-sm text-gray-plain"},Rt={class:"list-disc space-y-1 pl-5 text-sm text-gray-plain"},jt={key:0,class:"mt-6 grid grid-cols-1 gap-4 md:grid-cols-2 !ps-0"},Et={class:"rounded-lg border border-gray-default bg-white px-4 py-5 sm:p-6"},Vt={class:"text-sm font-normal text-gray-plain"},Ot={class:"mt-1 text-2xl font-bold text-gray-title tabular-nums !ps-0"},Tt={class:"rounded-lg border border-gray-default bg-white px-4 py-5 sm:p-6"},Ut={class:"text-sm font-normal text-gray-plain"},Gt={class:"mt-1 text-2xl font-bold text-gray-title tabular-nums !ps-0"},Jt={class:"ml-2 text-sm font-medium text-gray-plain"},Kt={class:"mt-8 overflow-x-auto"},Xt={key:0,class:"py-8 text-center"},Zt={key:3,class:"flex flex-col items-center py-12"},Qt={class:"font-bold text-gray-title my-3"},Wt={class:"text-sm text-gray-plain"},Ht={key:4,class:"relative min-w-full"},Yt={class:"bg-white"},te={scope:"col",class:"py-3.5 pr-3 pl-4 text-left text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0 sm:pl-3"},ee={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0"},re={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0"},se={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0"},ae={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0"},oe={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0"},le={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-r border-gray-default last:border-r-0"},ne={scope:"col",class:"px-3 py-3.5 text-right text-sm font-semibold text-gray-title border-b border-gray-default last:border-r-0"},ie={class:"border-t border-gray-default hover:bg-gray-lowest"},de={class:"py-4 pr-3 pl-4 text-sm font-semibold text-gray-title border-r border-gray-default last:border-r-0 sm:pl-3"},ce=["aria-expanded","aria-controls","onClick"],ue={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},pe={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},me={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},be={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},xe={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},ge={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},he={class:"px-3 py-4 text-right text-sm text-gray-title border-r border-gray-default last:border-r-0"},_e=["id"],ve={class:"py-1 pr-3 pl-11 text-sm font-medium whitespace-nowrap text-gray-title border-r border-gray-default last:border-r-0 sm:pl-10"},fe={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},ye={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},we={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},Pe={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},Se={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},De={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},$e={class:"px-3 py-1 text-right text-sm whitespace-nowrap text-gray-plain border-r border-gray-default last:border-r-0"},ke=100,Ve=F({__name:"index",setup(_){const c=it(),{t:s}=O(),{formatDate:m}=Pt(),{formatNumber:n}=St(),P=l(()=>{const a=Math.round(c.public.maxJsonPreviewCharSize/1e6);return`${n(a)} Mo`}),N=l(()=>{const a=Math.round(c.public.maxPdfPreviewByteSize/1e6);return`${n(a)} Mo`}),A=l(()=>{const a=Math.round(c.public.maxXmlPreviewCharSize/1e3);return`${n(a)} Ko`}),G=l(()=>{const a=Math.round(c.public.maxImagePreviewByteSize/1e6);return`${n(a)} Mo`}),S=l(()=>Mt(new Date)),J=l(()=>m(new Date,{dateStyle:void 0,year:"numeric",month:"long"})),k=l(()=>Ct(S.value));async function I(a){if(!c.public.tabularApiPreviewStatsId)return[];const g=`${c.public.tabularApiUrl}/api/resources/${c.public.tabularApiPreviewStatsId}/data/`,x=[];for(let h=1;;h++){const M=new URLSearchParams({page:String(h),page_size:String(ke),mois__exact:a}),o=await $fetch(`${g}?${M.toString()}`);if(x.push(...o.data),o.data.length===0||x.length>=o.meta.total)return x}}const{data:K,error:X,pending:Z}=q(`preview-dashboard-stats-${S.value}`,()=>I(S.value)),{data:Q,error:W,pending:H}=q(`preview-dashboard-stats-${k.value}`,()=>I(k.value)),Y=l(()=>[...K.value??[],...Q.value??[]]),B=l(()=>X.value??W.value),L=l(()=>Z.value||H.value);lt(B,a=>{a&&console.error("[preview-dashboard] fetch error:",a)});const v=mt(new Set),y=l(()=>Ft(Y.value,S.value,k.value)),z=l(()=>{const a=y.value.reduce((x,h)=>x+h.count,0),g=y.value.reduce((x,h)=>x+h.withPreview,0);return{total:a,previewableCount:g,previewablePercentage:a>0?g/a*100:0}});function tt(a){v.value.has(a)?v.value.delete(a):v.value.add(a)}function et(a){switch(a.trim().toLowerCase()){case"données structurées":return yt;case"tabulaire":return ft;case"api":return vt;case"document":return _t;case"archive":return ht;case"image":return gt;case"liens":return xt;default:return bt}}function b(a){return`${Number(a??0).toFixed(1)}%`}return(a,g)=>{const x=rt,h=st,M=pt;return d(),p("div",null,[t("p",qt,r(e(s)("Répartition des ressources par famille de format et par format, avec le taux de prévisualisation.")),1),u(h,{class:"mt-4"},{default:w(()=>[u(x,{title:e(s)("Méthodologie et limites")},{default:w(()=>[t("ul",Rt,[t("li",null,r(e(s)("JSON : prévisualisation limitée à environ {size} de contenu texte.",{size:P.value})),1),t("li",null,r(e(s)("PDF : prévisualisation limitée aux fichiers de {size} maximum.",{size:N.value})),1),t("li",null,r(e(s)("XML : prévisualisation limitée à environ {size} de contenu texte.",{size:A.value})),1),t("li",null,r(e(s)("Images : prévisualisation limitée aux fichiers de {size} maximum.",{size:G.value})),1),t("li",null,r(e(s)("Seuls les formats représentant au moins 10 ressources sont affichés individuellement.")),1),t("li",null,r(e(s)("Certains formats très proches ont été regroupés pour rendre l’analyse plus lisible.")),1)])]),_:1},8,["title"])]),_:1}),!L.value&&y.value.length>0?(d(),p("dl",jt,[t("div",Et,[t("dt",Vt,r(e(s)("Nombre total de ressources anal
1ysées")),1),t("dd",Ot,r(e(n)(z.value.total)),1)]),t("div",Tt,[t("dt",Ut,r(e(s)("Ressources prévisualisables")),1),t("dd",Gt,[f(r(b(z.value.previewablePercentage))+" ",1),t("span",Jt," ("+r(e(n)(z.value.previewableCount))+") ",1)])])])):C("",!0),t("div",Kt,[L.value?(d(),p("div",Xt,[u(e(nt))])):e(c).public.tabularApiPreviewStatsId?B.value?(d(),$(e(E),{key:2,type:"warning",class:"mt-2"},{default:w(()=>[f(r(e(s)("Les statistiques n'ont pas pu être chargées.")),1)]),_:1})):y.value.length===0?(d(),p("div",Zt,[g[0]||(g[0]=t("img",{src:wt,class:"h-20",alt:""},null,-1)),t("p",Qt,r(e(s)("Aucune statistique pour {month}",{month:J.value})),1),t("p",Wt,r(e(s)("Les statistiques de ce mois n’ont pas encore été publiées.")),1)])):(d(),p("table",Ht,[t("thead",Yt,[t("tr",null,[t("th",te,r(e(s)("Famille / Format")),1),t("th",ee,r(e(s)("Nombre")),1),t("th",re,r(e(s)("% catalogue")),1),t("th",se,r(e(s)("% prévisualisation manquante")),1),t("th",ae,r(e(s)("% erreur")),1),t("th",oe,r(e(s)("% trop volumineux")),1),t("th",le,r(e(s)("Prévisualisable")),1),t("th",ne,r(e(s)("% prévisualisable")),1)])]),(d(!0),p(R,null,j(y.value,o=>(d(),p("tbody",{key:o.family,class:"bg-white"},[t("tr",ie,[t("td",de,[t("button",{type:"button",class:"flex w-full items-center gap-2 text-left cursor-pointer","aria-expanded":v.value.has(o.family),"aria-controls":o.formats.map(i=>`format-row-${i.__id}`).join(" "),onClick:i=>tt(o.family)},[u(e(dt),{class:T(["size-4 shrink-0 text-gray-low transition-transform",{"rotate-180":v.value.has(o.family)}]),"aria-hidden":"true"},null,8,["class"]),(d(),$(U(et(o.family)),{class:"size-4 shrink-0 text-gray-low","aria-hidden":"true"})),f(" "+r(o.family),1)],8,ce)]),t("td",ue,[t("div",null,r(e(n)(o.count)),1),u(D,{value:o.countDelta,unit:"count"},null,8,["value"])]),t("td",pe,r(b(o.percentageOfCatalog)),1),t("td",me,r(b(o.percentageMissingPreview)),1),t("td",be,r(b(o.percentageError)),1),t("td",xe,r(b(o.percentageTooBig)),1),t("td",ge,r(e(n)(o.withPreview)),1),t("td",he,[u(V,{value:o.percentageWithPreview},null,8,["value"]),u(D,{value:o.previewDelta,unit:"points"},null,8,["value"])])]),(d(!0),p(R,null,j(o.formats,i=>ct((d(),p("tr",{id:`format-row-${i.__id}`,key:i.__id,class:"border-t border-gray-default bg-gray-lowest-2"},[t("td",ve,[u(M,{class:"link",to:{path:"/admin/beta/preview-dashboard/fichiers",query:{format:i["format normalisé"]}}},{default:w(()=>[f(r(i["format normalisé"]),1)]),_:2},1032,["to"])]),t("td",fe,[t("div",null,r(e(n)(i.nombre)),1),u(D,{value:i.countDelta,unit:"count"},null,8,["value"])]),t("td",ye,r(b(i["% catalogue"])),1),t("td",we,r(b(i["% prévisualisation manquante"])),1),t("td",Pe,r(b(i["% erreur"])),1),t("td",Se,r(b(i["% trop volumineux"])),1),t("td",De,r(e(n)(i.prévisualisable)),1),t("td",$e,[u(V,{value:i["% prévisualisable"]},null,8,["value"]),u(D,{value:i.previewDelta,unit:"points"},null,8,["value"])])],8,_e)),[[ut,v.value.has(o.family)]])),128))]))),128))])):(d(),$(e(E),{key:1,type:"warning",class:"mt-2"},{default:w(()=>[f(r(e(s)("Statistiques de prévisualisations non disponibles.")),1)]),_:1}))])])}}});export{Ve 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.