@@ -573,39 +573,6 @@ function PaginatedJobTable({ jobs }) {
573573 ) ;
574574}
575575
576- function SuccessFailChart ( { data } ) {
577- const canvasRef = useRef ( null ) ;
578- useEffect ( ( ) => {
579- if ( ! canvasRef . current ) return ;
580- const ctx = canvasRef . current . getContext ( '2d' ) ;
581- const chart = new Chart ( ctx , {
582- type : 'bar' ,
583- data : {
584- labels : data . map ( d => d . date ) ,
585- datasets : [
586- {
587- label : 'Success' ,
588- data : data . map ( d => d . success ) ,
589- backgroundColor : '#4e79a7'
590- } ,
591- {
592- label : 'Fail' ,
593- data : data . map ( d => d . fail ) ,
594- backgroundColor : '#e15759'
595- }
596- ]
597- } ,
598- options : {
599- responsive : false ,
600- maintainAspectRatio : false ,
601- scales : { x : { stacked : true } , y : { stacked : true } }
602- }
603- } ) ;
604- return ( ) => chart . destroy ( ) ;
605- } , [ data ] ) ;
606- return React . createElement ( 'div' , { className : 'chart-container' } , React . createElement ( 'canvas' , { ref : canvasRef , width : 600 , height : 300 } ) ) ;
607- }
608-
609576function Summary ( { summary, details = [ ] , daily = [ ] , monthly = [ ] , yearly = [ ] } ) {
610577 const sparklineData = daily . map ( d => d . core_hours ) ;
611578 const gpuSparklineData = daily . map ( d => d . gpu_hours || 0 ) ;
@@ -775,7 +742,6 @@ function UserDetails({ users }) {
775742
776743function Details ( {
777744 details,
778- daily,
779745 partitions = [ ] ,
780746 accounts = [ ] ,
781747 users = [ ] ,
@@ -923,12 +889,6 @@ function Details({
923889 }
924890 }
925891
926- const successData = ( daily || [ ] ) . map ( d => ( {
927- date : d . date ,
928- success : Math . round ( d . core_hours * 0.8 ) ,
929- fail : Math . round ( d . core_hours * 0.2 )
930- } ) ) ;
931-
932892 return React . createElement (
933893 'div' ,
934894 null ,
@@ -1016,9 +976,7 @@ function Details({
1016976 } , [ ] )
1017977 )
1018978 )
1019- ) ,
1020- React . createElement ( 'h3' , null , 'Job success vs. failure rate' ) ,
1021- React . createElement ( SuccessFailChart , { data : successData } )
979+ )
1022980 ) ;
1023981}
1024982
@@ -2008,13 +1966,12 @@ function App() {
20081966 view === 'details' &&
20091967 React . createElement ( Details , {
20101968 details : data . details ,
2011- daily : data . daily ,
20121969 partitions : data . partitions ,
20131970 accounts : data . accounts ,
20141971 users : data . users ,
20151972 month,
20161973 onMonthChange : setMonth ,
2017- monthOptions
1974+ monthOptions : data . month_options
20181975 } ) ,
20191976 view === 'settings' && React . createElement ( Rates , { onRatesUpdated : reload } )
20201977 ) ;
0 commit comments