File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed 
Containers/Monitoring/StorageUsedChartBar Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ import classes from './StorageBar.module.css';
33
44export  default  function  StorageBar ( props )  { 
55  //Var 
6-   //storageUsed is in octet, storageSize is in GB. Round to 1 decimal for %. 
7-   const  storageUsedPercent  =  ( ( ( props . storageUsed  /  1000000 )  *  100 )  /  props . storageSize ) . toFixed ( 1 ) ; 
6+   //storageUsed is in kB, storageSize is in GB. Round to 1 decimal for %. 
7+   const  storageUsedPercent  =  ( ( ( props . storageUsed  /  1024  **  2 )  *  100 )  /  props . storageSize ) . toFixed ( 
8+     1 
9+   ) ; 
810
911  return  ( 
1012    < div  className = { classes . barContainer } > 
@@ -19,8 +21,8 @@ export default function StorageBar(props) {
1921          < div  className = { classes . progressionStyle }  /> 
2022        </ div > 
2123        < div  className = { classes . tooltip } > 
22-           { storageUsedPercent } % ({ ( props . storageUsed  /  1000000 ) . toFixed ( 1 ) }  GB /  { props . storageSize } { ' ' } 
23-           GB)
24+           { storageUsedPercent } % ({ ( props . storageUsed  /  1024   **   2 ) . toFixed ( 1 ) }  GB /{ ' ' } 
25+           { props . storageSize }   GB)
2426        </ div > 
2527      </ div > 
2628    </ div > 
Original file line number Diff line number Diff line change @@ -71,9 +71,9 @@ export default function StorageUsedChartBar() {
7171    datasets : [ 
7272      { 
7373        label : 'Storage used (%)' , 
74-         //storageUsed is in octet , storageSize is in GB. Round to 1 decimal for %. 
74+         //storageUsed is in kB , storageSize is in GB. Round to 1 decimal for %. 
7575        data : data . map ( ( repo )  => 
76-           ( ( ( repo . storageUsed  /  1000000 )  *  100 )  /  repo . storageSize ) . toFixed ( 1 ) 
76+           ( ( ( repo . storageUsed  /  1024   **   2 )  *  100 )  /  repo . storageSize ) . toFixed ( 1 ) 
7777        ) , 
7878        backgroundColor : '#704dff' , 
7979      } , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments