11import React , { useState , useEffect , useRef } from 'react' ;
2- import { Select , Form , Utils , AppContainer , Input , Button , ProTable , Badge , Tag , SearchInput , IconFont , Divider } from 'knowdesign' ;
2+ import { Select , Form , Utils , AppContainer , Input , Button , ProTable , Badge , Tag , SearchInput , Divider } from 'knowdesign' ;
3+ import { IconFont } from '@knowdesign/icons' ;
34import BalanceDrawer from './BalanceDrawer' ;
45import HistoryDrawer from './HistoryDrawer' ;
56import DBreadcrumb from 'knowdesign/es/extend/d-breadcrumb' ;
@@ -133,7 +134,7 @@ const LoadBalance: React.FC = (props: any) => {
133134 key : 'disk_spec' ,
134135 width : '150px' ,
135136 render : ( text : any , row : any ) => {
136- return text !== null ? `${ text } GB` : '-' ;
137+ return text !== null ? `${ text . toLocaleString ( ) } GB` : '-' ;
137138 } ,
138139 } ,
139140 {
@@ -145,7 +146,10 @@ const LoadBalance: React.FC = (props: any) => {
145146 return text !== null ? (
146147 < span >
147148 < Badge status = { row ?. disk_status === 0 ? 'success' : 'error' } />
148- { `${ getSizeAndUnit ( text , 'B' ) . valueWithUnit } (${ ( ( row . disk_avg * 100 ) / Utils . transGBToB ( row . disk_spec ) ) . toFixed ( 2 ) } %)` }
149+ { `${ getSizeAndUnit ( text , 'B' ) . valueWithUnit . toLocaleString ( ) } (${ (
150+ ( row . disk_avg * 100 ) /
151+ Utils . transGBToB ( row . disk_spec )
152+ ) . toFixed ( 2 ) } %)`}
149153 </ span >
150154 ) : (
151155 '-'
@@ -158,7 +162,7 @@ const LoadBalance: React.FC = (props: any) => {
158162 key : 'bytesIn_spec' ,
159163 width : '150px' ,
160164 render : ( text : any , row : any ) => {
161- return text !== null ? `${ text } MB/s` : '-' ;
165+ return text !== null ? `${ text . toLocaleString ( ) } MB/s` : '-' ;
162166 } ,
163167 } ,
164168 {
@@ -170,7 +174,10 @@ const LoadBalance: React.FC = (props: any) => {
170174 return text !== null ? (
171175 < span >
172176 < Badge status = { row ?. bytesIn_status === 0 ? 'success' : 'error' } />
173- { `${ getSizeAndUnit ( text , 'B/s' ) . valueWithUnit } (${ ( ( row . bytesIn_avg * 100 ) / ( row . bytesIn_spec * 1024 * 1024 ) ) . toFixed ( 2 ) } %)` }
177+ { `${ getSizeAndUnit ( text , 'B/s' ) . valueWithUnit . toLocaleString ( ) } (${ (
178+ ( row . bytesIn_avg * 100 ) /
179+ ( row . bytesIn_spec * 1024 * 1024 )
180+ ) . toFixed ( 2 ) } %)`}
174181 </ span >
175182 ) : (
176183 '-'
@@ -183,7 +190,7 @@ const LoadBalance: React.FC = (props: any) => {
183190 key : 'bytesOut_spec' ,
184191 width : '150px' ,
185192 render : ( text : any , row : any ) => {
186- return text !== null ? `${ text } MB/s` : '-' ;
193+ return text !== null ? `${ text . toLocaleString ( ) } MB/s` : '-' ;
187194 } ,
188195 } ,
189196 {
@@ -196,7 +203,10 @@ const LoadBalance: React.FC = (props: any) => {
196203 return text !== null ? (
197204 < span >
198205 < Badge status = { row ?. bytesOut_status === 0 ? 'success' : 'error' } />
199- { `${ getSizeAndUnit ( text , 'B/s' ) . valueWithUnit } (${ ( ( row . bytesOut_avg * 100 ) / ( row . bytesOut_spec * 1024 * 1024 ) ) . toFixed ( 2 ) } %)` }
206+ { `${ getSizeAndUnit ( text , 'B/s' ) . valueWithUnit . toLocaleString ( ) } (${ (
207+ ( row . bytesOut_avg * 100 ) /
208+ ( row . bytesOut_spec * 1024 * 1024 )
209+ ) . toFixed ( 2 ) } %)`}
200210 </ span >
201211 ) : (
202212 '-'
0 commit comments