@@ -21,6 +21,19 @@ const formatTabletMetricsItem = createInfoFormatter({
2121 defaultValueFormatter : formatNumber ,
2222} ) ;
2323
24+ const formatFollowerGroupItem = createInfoFormatter ( {
25+ values : {
26+ FollowerCount : formatNumber ,
27+ } ,
28+ } ) ;
29+
30+ const formatPartitionConfigItem = createInfoFormatter ( {
31+ values : {
32+ FollowerCount : formatNumber ,
33+ CrossDataCenterFollowerCount : formatNumber ,
34+ } ,
35+ } ) ;
36+
2437const formatTableStatsItem = createInfoFormatter ( {
2538 values : {
2639 DataSize : formatBytes ,
@@ -57,7 +70,7 @@ class SchemaInfoViewer extends React.Component {
5770
5871 renderContent ( data ) {
5972 const { PathDescription = { } } = data ;
60- const { TableStats = { } , TabletMetrics = { } } = PathDescription ;
73+ const { TableStats = { } , TabletMetrics = { } , Table : { PartitionConfig = { } } = { } } = PathDescription ;
6174 const {
6275 PartCount,
6376 RowCount,
@@ -82,6 +95,7 @@ class SchemaInfoViewer extends React.Component {
8295
8396 ...restTableStats
8497 } = TableStats ;
98+ const { FollowerGroups, FollowerCount, CrossDataCenterFollowerCount} = PartitionConfig ;
8599
86100 const tableStatsInfo = [
87101 formatTableStats ( {
@@ -116,8 +130,25 @@ class SchemaInfoViewer extends React.Component {
116130 formatTabletMetricsItem ( key , TabletMetrics [ key ] )
117131 ) ;
118132
133+ const partitionConfigInfo = [ ] ;
134+
135+ if ( Array . isArray ( FollowerGroups ) && FollowerGroups . length > 0 ) {
136+ partitionConfigInfo . push ( ...Object . keys ( FollowerGroups [ 0 ] ) . map ( ( key ) =>
137+ formatFollowerGroupItem ( key , FollowerGroups [ 0 ] [ key ] )
138+ ) ) ;
139+ } else if ( FollowerCount !== undefined ) {
140+ partitionConfigInfo . push (
141+ formatPartitionConfigItem ( 'FollowerCount' , FollowerCount )
142+ ) ;
143+ } else if ( CrossDataCenterFollowerCount !== undefined ) {
144+ partitionConfigInfo . push (
145+ formatPartitionConfigItem ( 'CrossDataCenterFollowerCount' , CrossDataCenterFollowerCount )
146+ ) ;
147+ }
148+
119149 if ( [
120150 tabletMetricsInfo ,
151+ partitionConfigInfo ,
121152 tableStatsInfo . flat ( ) ,
122153 ] . flat ( ) . length === 0 ) {
123154 return (
@@ -127,9 +158,10 @@ class SchemaInfoViewer extends React.Component {
127158
128159 return (
129160 < div className = { b ( 'row' ) } >
130- { tabletMetricsInfo . length > 0 ? (
161+ { tabletMetricsInfo . length > 0 || partitionConfigInfo . length > 0 ? (
131162 < div className = { b ( 'col' ) } >
132163 { this . renderItem ( tabletMetricsInfo , 'Tablet Metrics' ) }
164+ { this . renderItem ( partitionConfigInfo , 'Partition Config' ) }
133165 </ div >
134166 ) : null }
135167 < div className = { b ( 'col' ) } >
0 commit comments