@airporting/tech-app 0.0.110 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mf/@mf-types/compiled-types/apps/usage/AbandonedChart.d.ts +5 -0
- package/dist/mf/@mf-types/compiled-types/apps/usage/usage.types.d.ts +5 -0
- package/dist/mf/@mf-types.zip +0 -0
- package/dist/mf/__federation_expose_usage.js +1 -1
- package/dist/mf/index.css +73 -73
- package/dist/mf/index.js +3 -3
- package/dist/mf/mf-manifest.json +2 -2
- package/dist/mf/mf-stats.json +6 -6
- package/dist/mf/tech_app.js +3 -3
- package/package.json +1 -1
|
@@ -12,6 +12,8 @@ export type UsageKpis = {
|
|
|
12
12
|
noopTasks: number;
|
|
13
13
|
rowsSynced: number;
|
|
14
14
|
worksheetTasks: number;
|
|
15
|
+
abandonedTasks: number;
|
|
16
|
+
abandonedFabricatedHours: number;
|
|
15
17
|
maxConcurrent: number | null;
|
|
16
18
|
};
|
|
17
19
|
export type UsageBucket = {
|
|
@@ -24,6 +26,7 @@ export type UsageBucket = {
|
|
|
24
26
|
noopHours: number;
|
|
25
27
|
worksheetTasks: number;
|
|
26
28
|
rowsSynced: number;
|
|
29
|
+
abandonedTasks: number;
|
|
27
30
|
companies: number | null;
|
|
28
31
|
distinctJobs: number | null;
|
|
29
32
|
waitMaxMinutes: number | null;
|
|
@@ -41,6 +44,7 @@ export type UsageTopCompany = {
|
|
|
41
44
|
tasks: number;
|
|
42
45
|
computeHours: number;
|
|
43
46
|
erroredHours: number;
|
|
47
|
+
abandonedTasks: number;
|
|
44
48
|
};
|
|
45
49
|
export type UsageTopJob = {
|
|
46
50
|
jobName: string;
|
|
@@ -48,6 +52,7 @@ export type UsageTopJob = {
|
|
|
48
52
|
companies: number;
|
|
49
53
|
computeHours: number;
|
|
50
54
|
erroredHours: number;
|
|
55
|
+
abandonedTasks: number;
|
|
51
56
|
};
|
|
52
57
|
export type UsageChargeResponse = {
|
|
53
58
|
view: UsageView;
|
package/dist/mf/@mf-types.zip
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["4927"],{1354:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>PageHeader});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9632);var react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3106);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"\xe0 l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,leading,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(()=>Date.now());(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[leading,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"\xe9chec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{label:"Rafra\xeechir",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconRefresh,{size:16})})}),actions]})]})}},7324:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Usage});var jsx_runtime=__webpack_require__(5893);var index_js_=__webpack_require__(3106);var providers=__webpack_require__(7034);var index_mjs_=__webpack_require__(207);var tabler_icons_react_mjs_=__webpack_require__(9632);var modern_index_js_=__webpack_require__(6197);var useApi=__webpack_require__(4148);const STALE_MS=6e4;const DAY_REFETCH_MS=3e5;function chargeKey(view,trigger,at){return["tech","usage","charge",view,trigger,at??null]}function chargeParams(view,trigger,at){return{view,..."all"===trigger?{}:{trigger},...at?{at}:{}}}function useUsageCharge(view,trigger,at){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:chargeKey(view,trigger,at),queryFn:async()=>{const response=await api.http.request({path:"/v1/usage/charge",method:"GET",query:chargeParams(view,trigger,at),format:"json"});return response.data},placeholderData:modern_index_js_.keepPreviousData,staleTime:STALE_MS,refetchInterval:"day"===view?DAY_REFETCH_MS:false,refetchOnWindowFocus:false})}function useUsageChargePrefetch(){const api=(0,useApi.h)();const queryClient=(0,modern_index_js_.useQueryClient)();return(view,trigger,at)=>{queryClient.prefetchQuery({queryKey:chargeKey(view,trigger,at),queryFn:async()=>{const response=await api.http.request({path:"/v1/usage/charge",method:"GET",query:chargeParams(view,trigger,at),format:"json"});return response.data},staleTime:STALE_MS})}}var PageHeader=__webpack_require__(1354);const OPTIONS=[{value:"all",label:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Tout"})},{value:"auto",label:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconRobot,{size:16,stroke:1.5}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Robots"})]})},{value:"human",label:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconUser,{size:16,stroke:1.5}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Humains"})]})}];const HINT="Robots = planificateur et crons d\xe9di\xe9s. Humains = run lanc\xe9 depuis l’app ; c’est un plancher, les runs pass\xe9s par l’ancienne API sont compt\xe9s comme planifi\xe9s.";function TriggerFilter(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:HINT,multiline:true,w:320,withArrow:true,position:"bottom",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:props.value,onChange:next=>props.onChange(next),data:OPTIONS,size:"xs"})})}const USAGE_COLORS={productive:"#3987e5",errored:"#d03b3b",noop:"#fab219"};const AXIS_INK="#898781";function formatHours(hours){if(hours>=100)return`${Math.round(hours)} h`;return`${hours.toFixed(1).replace(".",",")} h`}function formatCount(value){return new Intl.NumberFormat("fr-FR").format(value)}function formatCompactCount(value){return new Intl.NumberFormat("fr-FR",{notation:"compact",maximumFractionDigits:1}).format(value)}function wastePercent(kpis){if(kpis.computeHours<=0)return 0;return Math.round((kpis.erroredHours+kpis.noopHours)/kpis.computeHours*100)}function UsageKpiRow(props){const{kpis}=props;const tiles=[{key:"compute",label:"Compute",value:formatHours(kpis.computeHours),hint:`${formatCount(kpis.tasks)} t\xe2ches, dont ${formatCount(kpis.worksheetTasks)} worksheets`},{key:"companies",label:"Entreprises actives",value:formatCount(kpis.companies),hint:`${formatCount(kpis.distinctJobs)} connecteurs distincts`},{key:"waste",label:"Compute non productif",value:`${formatHours(kpis.erroredHours+kpis.noopHours)} \xb7 ${wastePercent(kpis)} %`,hint:`${formatHours(kpis.erroredHours)} en erreur (${formatCount(kpis.erroredTasks)} t\xe2ches), ${formatHours(kpis.noopHours)} sans r\xe9sultat`,accent:USAGE_COLORS.errored},{key:"concurrency",label:"Concurrence max",value:null===kpis.maxConcurrent?"—":`${formatCount(kpis.maxConcurrent)} t\xe2ches`,hint:null===kpis.maxConcurrent?"Non calcul\xe9 sur 12 mois : trop co\xfbteux \xe0 recouvrir":"Pic de t\xe2ches simultan\xe9es, dur\xe9e born\xe9e \xe0 110 min"},{key:"rows",label:"Lignes synchronis\xe9es",value:formatCompactCount(kpis.rowsSynced),hint:"Somme des compteurs renvoy\xe9s par les jobs — proxy de tendance"}];return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,sm:3,lg:5},spacing:"md",children:tiles.map(tile=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,align:"center",mb:6,children:[tile.accent?/*#__PURE__*/(0,jsx_runtime.jsx)("span",{"aria-hidden":true,style:{width:8,height:8,borderRadius:2,background:tile.accent,display:"inline-block"}}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",tt:"uppercase",fw:700,children:tile.label})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:tile.hint,withArrow:true,multiline:true,w:260,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:26,fw:600,lh:1.1,children:tile.value})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",mt:6,lineClamp:2,children:tile.hint})]},tile.key))})}var esm_index_mjs_=__webpack_require__(7183);const PARIS_TZ="Europe/Paris";const minuteFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,hour:"2-digit",minute:"2-digit"});const weekDayFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,weekday:"short",day:"numeric"});const monthFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,month:"short",year:"2-digit"});const fullDayFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,weekday:"long",day:"numeric",month:"long"});function bucketDate(t){if(7===t.length)return new Date(`${t}-15T12:00:00Z`);return new Date(`${t}T12:00:00Z`)}function formatMinuteTick(iso){return minuteFormatter.format(new Date(iso))}function formatBucketTick(t,view){if("year"===view)return monthFormatter.format(bucketDate(t));if("month"===view)return String(bucketDate(t).getUTCDate());return weekDayFormatter.format(bucketDate(t))}function formatBucketLong(t,view){if("year"===view)return monthFormatter.format(bucketDate(t));return fullDayFormatter.format(bucketDate(t))}function formatWindow(from,to,view){if("day"===view)return fullDayFormatter.format(new Date(from));if("year"===view){const start=monthFormatter.format(new Date(from));const end=monthFormatter.format(new Date(new Date(to).getTime()-1));return`${start} \u{2192} ${end}`}const start=fullDayFormatter.format(new Date(from));const end=fullDayFormatter.format(new Date(new Date(to).getTime()-1));return`${start} \u{2192} ${end}`}function ConcurrencyTooltip({payload}){const point=payload?.[0]?.payload;if(!point)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatMinuteTick(point.t)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[point.concurrent," t\xe2che",point.concurrent>1?"s":""," en cours"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:[point.started," d\xe9marrage",point.started>1?"s":""]}),point.errored>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:[point.errored," en erreur"]}):null]})}function ConcurrencyChart(props){const{data}=props;if(0===data.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Aucune t\xe2che sur la journ\xe9e."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.AreaChart,{h:260,data:data,dataKey:"t",withDots:false,strokeWidth:2,curveType:"linear",gridAxis:"y",tickLine:"none",series:[{name:"concurrent",label:"T\xe2ches en cours",color:USAGE_COLORS.productive}],xAxisProps:{tickFormatter:formatMinuteTick,minTickGap:48,stroke:AXIS_INK},yAxisProps:{allowDecimals:false,stroke:AXIS_INK,width:32},tooltipProps:{content:ConcurrencyTooltip},tooltipAnimationDuration:0})}const SURFACE="var(--mantine-color-body)";const SERIES=[{name:"productiveHours",label:"Productif",color:USAGE_COLORS.productive},{name:"noopHours",label:"Sans r\xe9sultat",color:USAGE_COLORS.noop},{name:"erroredHours",label:"En erreur",color:USAGE_COLORS.errored}];const TOP_SERIES=SERIES[SERIES.length-1].name;function makeTooltip(view){return function({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,view)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[formatHours(bucket.computeHours)," de compute"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:["dont ",formatHours(bucket.erroredHours)," en erreur (",formatCount(bucket.erroredTasks)," t\xe2ches)"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["dont ",formatHours(bucket.noopHours)," sans r\xe9sultat"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",mt:4,children:[formatCount(bucket.tasks)," t\xe2ches \xb7 ",formatCount(bucket.worksheetTasks)," ","worksheets"]}),bucket.waitMaxMinutes?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["attente max ",Math.round(bucket.waitMaxMinutes)," min"]}):null]})}}function ChargeStack(props){const{buckets,view}=props;if(0===buckets.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Aucune t\xe2che sur la p\xe9riode."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.BarChart,{h:300,data:buckets,dataKey:"t",type:"stacked",withLegend:true,legendProps:{verticalAlign:"top",height:32},gridAxis:"y",tickLine:"none",unit:" h",series:SERIES,barProps:item=>({stroke:SURFACE,strokeWidth:1.5,strokeOpacity:1,radius:item.name===TOP_SERIES?[4,4,0,0]:0}),xAxisProps:{tickFormatter:t=>formatBucketTick(t,view),stroke:AXIS_INK,minTickGap:4},yAxisProps:{stroke:AXIS_INK,width:44},tooltipProps:{content:makeTooltip(view)},tooltipAnimationDuration:0})}const TRACTION_SERIES=[{name:"companies",label:"Entreprises actives",color:"#3987e5"},{name:"distinctJobs",label:"Connecteurs distincts",color:"#d95926"}];function TractionTooltip({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,"year")}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[bucket.companies??0," entreprises actives"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[bucket.distinctJobs??0," connecteurs distincts"]})]})}function TractionChart(props){const{buckets}=props;if(0===buckets.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Pas d'historique sur la p\xe9riode."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.LineChart,{h:240,data:buckets,dataKey:"t",withLegend:true,legendProps:{verticalAlign:"top",height:32},strokeWidth:2,dotProps:{r:4},activeDotProps:{r:6},gridAxis:"y",tickLine:"none",series:TRACTION_SERIES,xAxisProps:{tickFormatter:t=>formatBucketTick(t,"year"),stroke:AXIS_INK},yAxisProps:{allowDecimals:false,stroke:AXIS_INK,width:40},tooltipProps:{content:TractionTooltip},tooltipAnimationDuration:0})}function ShareBar(props){const{hours,erroredHours,max}=props;if(max<=0)return null;const total=hours/max*100;const errored=Math.min(erroredHours,hours)/max*100;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Progress.Root,{size:"md",w:140,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Progress.Section,{value:Math.max(total-errored,0),color:USAGE_COLORS.productive}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Progress.Section,{value:errored,color:USAGE_COLORS.errored})]})}function TopCompaniesTable(props){const{rows,totalHours}=props;const max=rows.length>0?rows[0].computeHours:0;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,striped:false,verticalSpacing:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:32,children:"#"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Entreprise"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:150,children:"Part"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:90,ta:"right",children:"Compute"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:70,ta:"right",children:"% total"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:100,ta:"right",children:"T\xe2ches"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map((row,index)=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{c:"dimmed",children:index+1}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:500,children:row.displayName??row.slug??`#${row.companyId}`}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:row.slug??`company ${row.companyId}`})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{withArrow:true,label:`${formatHours(row.erroredHours)} en erreur sur ${formatHours(row.computeHours)}`,children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ShareBar,{hours:row.computeHours,erroredHours:row.erroredHours,max:max})})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums"},children:formatHours(row.computeHours)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:totalHours>0?`${Math.round(row.computeHours/totalHours*100)} %`:"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:formatCount(row.tasks)})]},row.companyId))})]})}function TopJobsTable(props){const{rows,totalHours}=props;const max=rows.length>0?rows[0].computeHours:0;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,verticalSpacing:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:32,children:"#"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Connecteur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:150,children:"Part"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:90,ta:"right",children:"Compute"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:70,ta:"right",children:"% total"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:110,ta:"right",children:"h / entreprise"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map((row,index)=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{c:"dimmed",children:index+1}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:500,children:row.jobName}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"xs",c:"dimmed",children:[formatCount(row.companies)," entreprise",row.companies>1?"s":""," \xb7 ",formatCount(row.tasks)," t\xe2ches"]})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{withArrow:true,label:`${formatHours(row.erroredHours)} en erreur sur ${formatHours(row.computeHours)}`,children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ShareBar,{hours:row.computeHours,erroredHours:row.erroredHours,max:max})})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums"},children:formatHours(row.computeHours)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:totalHours>0?`${Math.round(row.computeHours/totalHours*100)} %`:"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:row.companies>0?formatHours(row.computeHours/row.companies):"—"})]},row.jobName))})]})}var date_fns_index_js_=__webpack_require__(4365);function shiftPeriod(view,at,direction){if("week"===view)return(0,date_fns_index_js_.addWeeks)(at,direction);if("month"===view)return(0,date_fns_index_js_.addMonths)(at,direction);if("year"===view)return(0,date_fns_index_js_.addMonths)(at,12*direction);return(0,date_fns_index_js_.addDays)(at,direction)}function canGoForward(view,at,now){return shiftPeriod(view,at,1).getTime()<=now.getTime()}const RESET_LABEL={day:"Aujourd'hui",week:"Cette semaine",month:"Ce mois",year:"12 derniers mois"};const VIEW_OPTIONS=[{value:"day",label:"Jour"},{value:"week",label:"Semaine"},{value:"month",label:"Mois"},{value:"year",label:"12 mois"}];const CHART_TITLES={day:"T\xe2ches simultan\xe9es, minute par minute",week:"Compute par jour (lundi → dimanche)",month:"Compute par jour du mois",year:"Compute par mois"};function SectionTitle(props){return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"baseline",mb:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:600,children:props.children}),props.hint?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:props.hint}):null]})}function UsageApp(){const[view,setView]=(0,index_js_.useState)("day");const[at,setAt]=(0,index_js_.useState)(null);const[trigger,setTrigger]=(0,index_js_.useState)("all");const charge=useUsageCharge(view,trigger,at?at.toISOString():void 0);const prefetch=useUsageChargePrefetch();const data=charge.data;const reference=at??new Date;const forwardDisabled=null===at||!canGoForward(view,reference,new Date);(0,index_js_.useEffect)(()=>{if(charge.isFetching)return;const previous=shiftPeriod(view,at??new Date,-1);prefetch(view,trigger,previous.toISOString())},[view,at,trigger,charge.isFetching]);const goto=direction=>{const next=shiftPeriod(view,reference,direction);setAt(next)};const changeView=next=>{setView(next);setAt(null)};return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Container,{fluid:true,my:"md",children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"lg",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(PageHeader.m,{title:"Usage & charge",updatedAt:charge.dataUpdatedAt,isFetching:charge.isFetching,isError:charge.isError,onRefresh:()=>charge.refetch()}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"center",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"md",align:"center",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:view,onChange:value=>changeView(value),data:VIEW_OPTIONS}),/*#__PURE__*/(0,jsx_runtime.jsx)(TriggerFilter,{value:trigger,onChange:setTrigger})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",align:"center",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default",size:"lg","aria-label":"P\xe9riode pr\xe9c\xe9dente",onClick:()=>goto(-1),children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronLeft,{size:18})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",c:"dimmed",ta:"center",miw:280,children:data?`${formatWindow(data.from,data.to,data.view)} \xb7 heure de Paris`:"…"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default",size:"lg","aria-label":"P\xe9riode suivante",disabled:forwardDisabled,onClick:()=>goto(1),children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronRight,{size:18})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",color:"gray",size:"xs",disabled:null===at,onClick:()=>setAt(null),children:RESET_LABEL[view]})]})]}),charge.isError?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Alert,{color:"red",title:"Impossible de charger la charge",children:String(charge.error)}):null,data?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"lg",style:{opacity:charge.isPlaceholderData?.45:1,transition:"opacity 150ms ease",pointerEvents:charge.isPlaceholderData?"none":void 0},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(UsageKpiRow,{kpis:data.kpis}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"day"===view?"dur\xe9e born\xe9e \xe0 110 min — au-del\xe0, une t\xe2che est perdue, pas en cours":"heures de compute, d\xe9compos\xe9es par issue",children:CHART_TITLES[view]}),"day"===view?/*#__PURE__*/(0,jsx_runtime.jsx)(ConcurrencyChart,{data:data.concurrency}):/*#__PURE__*/(0,jsx_runtime.jsx)(ChargeStack,{buckets:data.buckets,view:data.view})]}),"year"===view?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"deux d\xe9nombrements, un seul axe",children:"Traction — entreprises actives et connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TractionChart,{buckets:data.buckets})]}):null,"day"===view&&data.buckets.length>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"d\xe9composition du compute de la journ\xe9e",children:"Compute de la journ\xe9e"}),/*#__PURE__*/(0,jsx_runtime.jsx)(ChargeStack,{buckets:data.buckets,view:data.view})]}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Divider,{}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Grid,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:6},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",h:"100%",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"classement, pas de moyenne",children:"Top consommateurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TopCompaniesTable,{rows:data.topCompanies,totalHours:data.kpis.computeHours})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:6},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",h:"100%",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"brique de tarification du free",children:"Co\xfbt par connecteur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TopJobsTable,{rows:data.topJobs,totalHours:data.kpis.computeHours})]})})]})]}):/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:96}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:300})]})]})})}function Usage(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.C,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(UsageApp,{})})})}}}]);
|
|
1
|
+
"use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["4927"],{1354:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>PageHeader});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9632);var react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3106);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"\xe0 l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,leading,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(()=>Date.now());(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[leading,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"\xe9chec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{label:"Rafra\xeechir",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconRefresh,{size:16})})}),actions]})]})}},4055:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Usage});var jsx_runtime=__webpack_require__(5893);var index_js_=__webpack_require__(3106);var providers=__webpack_require__(7034);var index_mjs_=__webpack_require__(207);var tabler_icons_react_mjs_=__webpack_require__(9632);var modern_index_js_=__webpack_require__(6197);var useApi=__webpack_require__(4148);const STALE_MS=6e4;const DAY_REFETCH_MS=3e5;function chargeKey(view,trigger,at){return["tech","usage","charge",view,trigger,at??null]}function chargeParams(view,trigger,at){return{view,..."all"===trigger?{}:{trigger},...at?{at}:{}}}function useUsageCharge(view,trigger,at){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:chargeKey(view,trigger,at),queryFn:async()=>{const response=await api.http.request({path:"/v1/usage/charge",method:"GET",query:chargeParams(view,trigger,at),format:"json"});return response.data},placeholderData:modern_index_js_.keepPreviousData,staleTime:STALE_MS,refetchInterval:"day"===view?DAY_REFETCH_MS:false,refetchOnWindowFocus:false})}function useUsageChargePrefetch(){const api=(0,useApi.h)();const queryClient=(0,modern_index_js_.useQueryClient)();return(view,trigger,at)=>{queryClient.prefetchQuery({queryKey:chargeKey(view,trigger,at),queryFn:async()=>{const response=await api.http.request({path:"/v1/usage/charge",method:"GET",query:chargeParams(view,trigger,at),format:"json"});return response.data},staleTime:STALE_MS})}}var PageHeader=__webpack_require__(1354);const OPTIONS=[{value:"all",label:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Tout"})},{value:"auto",label:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconRobot,{size:16,stroke:1.5}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Robots"})]})},{value:"human",label:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconUser,{size:16,stroke:1.5}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Humains"})]})}];const HINT="Robots = planificateur et crons d\xe9di\xe9s. Humains = run lanc\xe9 depuis l’app ; c’est un plancher, les runs pass\xe9s par l’ancienne API sont compt\xe9s comme planifi\xe9s.";function TriggerFilter(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:HINT,multiline:true,w:320,withArrow:true,position:"bottom",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:props.value,onChange:next=>props.onChange(next),data:OPTIONS,size:"xs"})})}const USAGE_COLORS={productive:"#3987e5",errored:"#d03b3b",noop:"#fab219"};const AXIS_INK="#898781";function formatHours(hours){if(hours>=100)return`${Math.round(hours)} h`;return`${hours.toFixed(1).replace(".",",")} h`}function formatCount(value){return new Intl.NumberFormat("fr-FR").format(value)}function formatCompactCount(value){return new Intl.NumberFormat("fr-FR",{notation:"compact",maximumFractionDigits:1}).format(value)}function wastePercent(kpis){if(kpis.computeHours<=0)return 0;return Math.round((kpis.erroredHours+kpis.noopHours)/kpis.computeHours*100)}function UsageKpiRow(props){const{kpis}=props;const tiles=[{key:"compute",label:"Compute",value:formatHours(kpis.computeHours),hint:`${formatCount(kpis.tasks)} t\xe2ches, dont ${formatCount(kpis.worksheetTasks)} worksheets`},{key:"companies",label:"Entreprises actives",value:formatCount(kpis.companies),hint:`${formatCount(kpis.distinctJobs)} connecteurs distincts`},{key:"waste",label:"Compute non productif",value:`${formatHours(kpis.erroredHours+kpis.noopHours)} \xb7 ${wastePercent(kpis)} %`,hint:`${formatHours(kpis.erroredHours)} en erreur (${formatCount(kpis.erroredTasks)} t\xe2ches), ${formatHours(kpis.noopHours)} sans r\xe9sultat`,accent:USAGE_COLORS.errored},{key:"concurrency",label:"Concurrence max",value:null===kpis.maxConcurrent?"—":`${formatCount(kpis.maxConcurrent)} t\xe2ches`,hint:null===kpis.maxConcurrent?"Non calcul\xe9 sur 12 mois : trop co\xfbteux \xe0 recouvrir":"Pic de t\xe2ches simultan\xe9es, dur\xe9e born\xe9e \xe0 110 min"},{key:"abandoned",label:"Synchros perdues",value:formatCount(kpis.abandonedTasks),hint:0===kpis.abandonedTasks?"Aucune synchro abandonn\xe9e sur la p\xe9riode":`Abandonn\xe9es apr\xe8s 3 d\xe9blocages, sans jamais avoir tourn\xe9. ${formatHours(kpis.abandonedFabricatedHours)} de dur\xe9e fictive exclues du compute.`,accent:kpis.abandonedTasks>0?USAGE_COLORS.errored:void 0},{key:"rows",label:"Lignes synchronis\xe9es",value:formatCompactCount(kpis.rowsSynced),hint:"Somme des compteurs renvoy\xe9s par les jobs — proxy de tendance"}];return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,sm:2,md:3,lg:6},spacing:"md",children:tiles.map(tile=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,align:"center",mb:6,children:[tile.accent?/*#__PURE__*/(0,jsx_runtime.jsx)("span",{"aria-hidden":true,style:{width:8,height:8,borderRadius:2,background:tile.accent,display:"inline-block"}}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",tt:"uppercase",fw:700,children:tile.label})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:tile.hint,withArrow:true,multiline:true,w:260,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:26,fw:600,lh:1.1,children:tile.value})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",mt:6,lineClamp:2,children:tile.hint})]},tile.key))})}var esm_index_mjs_=__webpack_require__(7183);const PARIS_TZ="Europe/Paris";const minuteFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,hour:"2-digit",minute:"2-digit"});const weekDayFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,weekday:"short",day:"numeric"});const monthFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,month:"short",year:"2-digit"});const fullDayFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,weekday:"long",day:"numeric",month:"long"});function bucketDate(t){if(7===t.length)return new Date(`${t}-15T12:00:00Z`);return new Date(`${t}T12:00:00Z`)}function formatMinuteTick(iso){return minuteFormatter.format(new Date(iso))}function formatBucketTick(t,view){if("year"===view)return monthFormatter.format(bucketDate(t));if("month"===view)return String(bucketDate(t).getUTCDate());return weekDayFormatter.format(bucketDate(t))}function formatBucketLong(t,view){if("year"===view)return monthFormatter.format(bucketDate(t));return fullDayFormatter.format(bucketDate(t))}function formatWindow(from,to,view){if("day"===view)return fullDayFormatter.format(new Date(from));if("year"===view){const start=monthFormatter.format(new Date(from));const end=monthFormatter.format(new Date(new Date(to).getTime()-1));return`${start} \u{2192} ${end}`}const start=fullDayFormatter.format(new Date(from));const end=fullDayFormatter.format(new Date(new Date(to).getTime()-1));return`${start} \u{2192} ${end}`}function ConcurrencyTooltip({payload}){const point=payload?.[0]?.payload;if(!point)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatMinuteTick(point.t)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[point.concurrent," t\xe2che",point.concurrent>1?"s":""," en cours"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:[point.started," d\xe9marrage",point.started>1?"s":""]}),point.errored>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:[point.errored," en erreur"]}):null]})}function ConcurrencyChart(props){const{data}=props;if(0===data.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Aucune t\xe2che sur la journ\xe9e."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.AreaChart,{h:260,data:data,dataKey:"t",withDots:false,strokeWidth:2,curveType:"linear",gridAxis:"y",tickLine:"none",series:[{name:"concurrent",label:"T\xe2ches en cours",color:USAGE_COLORS.productive}],xAxisProps:{tickFormatter:formatMinuteTick,minTickGap:48,stroke:AXIS_INK},yAxisProps:{allowDecimals:false,stroke:AXIS_INK,width:32},tooltipProps:{content:ConcurrencyTooltip},tooltipAnimationDuration:0})}const SURFACE="var(--mantine-color-body)";const SERIES=[{name:"productiveHours",label:"Productif",color:USAGE_COLORS.productive},{name:"noopHours",label:"Sans r\xe9sultat",color:USAGE_COLORS.noop},{name:"erroredHours",label:"En erreur",color:USAGE_COLORS.errored}];const TOP_SERIES=SERIES[SERIES.length-1].name;function makeTooltip(view){return function({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,view)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[formatHours(bucket.computeHours)," de compute"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:["dont ",formatHours(bucket.erroredHours)," en erreur (",formatCount(bucket.erroredTasks)," t\xe2ches)"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["dont ",formatHours(bucket.noopHours)," sans r\xe9sultat"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",mt:4,children:[formatCount(bucket.tasks)," t\xe2ches \xb7"," ",formatCount(bucket.worksheetTasks)," worksheets"]}),bucket.waitMaxMinutes?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["attente max ",Math.round(bucket.waitMaxMinutes)," min"]}):null]})}}function ChargeStack(props){const{buckets,view}=props;if(0===buckets.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Aucune t\xe2che sur la p\xe9riode."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.BarChart,{h:300,data:buckets,dataKey:"t",type:"stacked",withLegend:true,legendProps:{verticalAlign:"top",height:32},gridAxis:"y",tickLine:"none",unit:" h",series:SERIES,barProps:item=>({stroke:SURFACE,strokeWidth:1.5,strokeOpacity:1,radius:item.name===TOP_SERIES?[4,4,0,0]:0}),xAxisProps:{tickFormatter:t=>formatBucketTick(t,view),stroke:AXIS_INK,minTickGap:4},yAxisProps:{stroke:AXIS_INK,width:44},tooltipProps:{content:makeTooltip(view)},tooltipAnimationDuration:0})}function AbandonedChart_makeTooltip(view){return function({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,view)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:[formatCount(bucket.abandonedTasks)," synchro",bucket.abandonedTasks>1?"s":""," perdue",bucket.abandonedTasks>1?"s":""]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["sur ",formatCount(bucket.tasks)," t\xe2ches cr\xe9\xe9es"]})]})}}function AbandonedChart(props){const{buckets,view}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.BarChart,{h:180,data:buckets,dataKey:"t",gridAxis:"y",tickLine:"none",series:[{name:"abandonedTasks",label:"Synchros perdues",color:USAGE_COLORS.errored}],barProps:{radius:[4,4,0,0]},xAxisProps:{tickFormatter:t=>formatBucketTick(t,view),stroke:AXIS_INK,minTickGap:4},yAxisProps:{stroke:AXIS_INK,width:44,allowDecimals:false},tooltipProps:{content:AbandonedChart_makeTooltip(view)},tooltipAnimationDuration:0})}const TRACTION_SERIES=[{name:"companies",label:"Entreprises actives",color:"#3987e5"},{name:"distinctJobs",label:"Connecteurs distincts",color:"#d95926"}];function TractionTooltip({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,"year")}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[bucket.companies??0," entreprises actives"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[bucket.distinctJobs??0," connecteurs distincts"]})]})}function TractionChart(props){const{buckets}=props;if(0===buckets.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Pas d'historique sur la p\xe9riode."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.LineChart,{h:240,data:buckets,dataKey:"t",withLegend:true,legendProps:{verticalAlign:"top",height:32},strokeWidth:2,dotProps:{r:4},activeDotProps:{r:6},gridAxis:"y",tickLine:"none",series:TRACTION_SERIES,xAxisProps:{tickFormatter:t=>formatBucketTick(t,"year"),stroke:AXIS_INK},yAxisProps:{allowDecimals:false,stroke:AXIS_INK,width:40},tooltipProps:{content:TractionTooltip},tooltipAnimationDuration:0})}function ShareBar(props){const{hours,erroredHours,max}=props;if(max<=0)return null;const total=hours/max*100;const errored=Math.min(erroredHours,hours)/max*100;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Progress.Root,{size:"md",w:140,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Progress.Section,{value:Math.max(total-errored,0),color:USAGE_COLORS.productive}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Progress.Section,{value:errored,color:USAGE_COLORS.errored})]})}function LostCell(props){if(0===props.count)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",children:"—"});return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums",color:USAGE_COLORS.errored,fontWeight:600},children:formatCount(props.count)})}function TopCompaniesTable(props){const{rows,totalHours}=props;const max=rows.length>0?rows[0].computeHours:0;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,striped:false,verticalSpacing:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:32,children:"#"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Entreprise"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:150,children:"Part"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:90,ta:"right",children:"Compute"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:70,ta:"right",children:"% total"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:100,ta:"right",children:"T\xe2ches"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:80,ta:"right",children:"Perdues"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map((row,index)=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{c:"dimmed",children:index+1}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:500,children:row.displayName??row.slug??`#${row.companyId}`}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:row.slug??`company ${row.companyId}`})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{withArrow:true,label:`${formatHours(row.erroredHours)} en erreur sur ${formatHours(row.computeHours)}`,children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ShareBar,{hours:row.computeHours,erroredHours:row.erroredHours,max:max})})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums"},children:formatHours(row.computeHours)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:totalHours>0?`${Math.round(row.computeHours/totalHours*100)} %`:"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:formatCount(row.tasks)}),/*#__PURE__*/(0,jsx_runtime.jsx)(LostCell,{count:row.abandonedTasks})]},row.companyId))})]})}function TopJobsTable(props){const{rows,totalHours}=props;const max=rows.length>0?rows[0].computeHours:0;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,verticalSpacing:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:32,children:"#"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Connecteur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:150,children:"Part"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:90,ta:"right",children:"Compute"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:70,ta:"right",children:"% total"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:110,ta:"right",children:"h / entreprise"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:80,ta:"right",children:"Perdues"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map((row,index)=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{c:"dimmed",children:index+1}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:500,children:row.jobName}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"xs",c:"dimmed",children:[formatCount(row.companies)," entreprise",row.companies>1?"s":""," \xb7 ",formatCount(row.tasks)," t\xe2ches"]})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{withArrow:true,label:`${formatHours(row.erroredHours)} en erreur sur ${formatHours(row.computeHours)}`,children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ShareBar,{hours:row.computeHours,erroredHours:row.erroredHours,max:max})})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums"},children:formatHours(row.computeHours)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:totalHours>0?`${Math.round(row.computeHours/totalHours*100)} %`:"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:row.companies>0?formatHours(row.computeHours/row.companies):"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(LostCell,{count:row.abandonedTasks})]},row.jobName))})]})}var date_fns_index_js_=__webpack_require__(4365);function shiftPeriod(view,at,direction){if("week"===view)return(0,date_fns_index_js_.addWeeks)(at,direction);if("month"===view)return(0,date_fns_index_js_.addMonths)(at,direction);if("year"===view)return(0,date_fns_index_js_.addMonths)(at,12*direction);return(0,date_fns_index_js_.addDays)(at,direction)}function canGoForward(view,at,now){return shiftPeriod(view,at,1).getTime()<=now.getTime()}const RESET_LABEL={day:"Aujourd'hui",week:"Cette semaine",month:"Ce mois",year:"12 derniers mois"};const VIEW_OPTIONS=[{value:"day",label:"Jour"},{value:"week",label:"Semaine"},{value:"month",label:"Mois"},{value:"year",label:"12 mois"}];const CHART_TITLES={day:"T\xe2ches simultan\xe9es, minute par minute",week:"Compute par jour (lundi → dimanche)",month:"Compute par jour du mois",year:"Compute par mois"};function SectionTitle(props){return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"baseline",mb:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:600,children:props.children}),props.hint?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:props.hint}):null]})}function UsageApp(){const[view,setView]=(0,index_js_.useState)("day");const[at,setAt]=(0,index_js_.useState)(null);const[trigger,setTrigger]=(0,index_js_.useState)("all");const charge=useUsageCharge(view,trigger,at?at.toISOString():void 0);const prefetch=useUsageChargePrefetch();const data=charge.data;const reference=at??new Date;const forwardDisabled=null===at||!canGoForward(view,reference,new Date);(0,index_js_.useEffect)(()=>{if(charge.isFetching)return;const previous=shiftPeriod(view,at??new Date,-1);prefetch(view,trigger,previous.toISOString())},[view,at,trigger,charge.isFetching]);const goto=direction=>{const next=shiftPeriod(view,reference,direction);setAt(next)};const changeView=next=>{setView(next);setAt(null)};return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Container,{fluid:true,my:"md",children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"lg",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(PageHeader.m,{title:"Usage & charge",updatedAt:charge.dataUpdatedAt,isFetching:charge.isFetching,isError:charge.isError,onRefresh:()=>charge.refetch()}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"center",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"md",align:"center",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:view,onChange:value=>changeView(value),data:VIEW_OPTIONS}),/*#__PURE__*/(0,jsx_runtime.jsx)(TriggerFilter,{value:trigger,onChange:setTrigger})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",align:"center",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default",size:"lg","aria-label":"P\xe9riode pr\xe9c\xe9dente",onClick:()=>goto(-1),children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronLeft,{size:18})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",c:"dimmed",ta:"center",miw:280,children:data?`${formatWindow(data.from,data.to,data.view)} \xb7 heure de Paris`:"…"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default",size:"lg","aria-label":"P\xe9riode suivante",disabled:forwardDisabled,onClick:()=>goto(1),children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronRight,{size:18})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",color:"gray",size:"xs",disabled:null===at,onClick:()=>setAt(null),children:RESET_LABEL[view]})]})]}),charge.isError?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Alert,{color:"red",title:"Impossible de charger la charge",children:String(charge.error)}):null,data?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"lg",style:{opacity:charge.isPlaceholderData?.45:1,transition:"opacity 150ms ease",pointerEvents:charge.isPlaceholderData?"none":void 0},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(UsageKpiRow,{kpis:data.kpis}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"day"===view?"dur\xe9e born\xe9e \xe0 110 min — au-del\xe0, une t\xe2che est perdue, pas en cours":"heures de compute, d\xe9compos\xe9es par issue",children:CHART_TITLES[view]}),"day"===view?/*#__PURE__*/(0,jsx_runtime.jsx)(ConcurrencyChart,{data:data.concurrency}):/*#__PURE__*/(0,jsx_runtime.jsx)(ChargeStack,{buckets:data.buckets,view:data.view})]}),"year"===view?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"deux d\xe9nombrements, un seul axe",children:"Traction — entreprises actives et connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TractionChart,{buckets:data.buckets})]}):null,"day"===view&&data.buckets.length>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"d\xe9composition du compute de la journ\xe9e",children:"Compute de la journ\xe9e"}),/*#__PURE__*/(0,jsx_runtime.jsx)(ChargeStack,{buckets:data.buckets,view:data.view})]}):null,data.kpis.abandonedTasks>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"abandonn\xe9es apr\xe8s 3 d\xe9blocages, sans jamais avoir tourn\xe9",children:"Synchros perdues"}),/*#__PURE__*/(0,jsx_runtime.jsx)(AbandonedChart,{buckets:data.buckets,view:data.view})]}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Divider,{}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Grid,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:6},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",h:"100%",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"classement, pas de moyenne",children:"Top consommateurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TopCompaniesTable,{rows:data.topCompanies,totalHours:data.kpis.computeHours})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:6},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",h:"100%",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"brique de tarification du free",children:"Co\xfbt par connecteur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TopJobsTable,{rows:data.topJobs,totalHours:data.kpis.computeHours})]})})]})]}):/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:96}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:300})]})]})})}function Usage(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.C,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(UsageApp,{})})})}}}]);
|