1
1
import React , { useCallback , useState } from "react" ;
2
2
import { PieChart , Pie , Cell , Legend , BarChart , Bar , LabelList } from 'recharts' ;
3
- import { Table , Row , Col , Statistic , Tooltip , Space , Typography } from 'antd' ;
3
+ import { Table , Row , Col , Statistic , Tooltip , Space } from 'antd' ;
4
4
import type { StatisticProps , TableColumnsType } from "antd/lib" ;
5
5
import CountUp from 'react-countup' ;
6
6
import { ActionCacheStatistics , ActionSummary , MissDetail } from "@/graphql/__generated__/graphql" ;
@@ -10,6 +10,7 @@ import { renderActiveShape } from "../Utilities/renderShape"
10
10
import { nullPercent } from "../Utilities/nullPercent" ;
11
11
import "./index.module.css"
12
12
import MissDetailTag , { MissDetailEnum } from "./ActionCacheMissTag" ;
13
+ import styles from "../../theme/theme.module.css"
13
14
interface MissDetailDisplayDataType {
14
15
key : React . Key ;
15
16
name : string ;
@@ -23,13 +24,13 @@ const formatter: StatisticProps['formatter'] = (value) => (
23
24
24
25
var ac_colors =
25
26
[
26
- "grey" , //unknown
27
- "blue" , //different action key
28
- "pink" , //different deps
29
- "purple" , //different env
30
- "cyan" , //diff files
31
- "orange" , //corrupted cache entry
32
- "red" ] //not cached
27
+ "grey" , //unknown
28
+ "blue" , //different action key
29
+ "pink" , //different deps
30
+ "purple" , //different env
31
+ "cyan" , //diff files
32
+ "orange" , //corrupted cache entry
33
+ "red" ] //not cached
33
34
34
35
const ac_columns : TableColumnsType < MissDetailDisplayDataType > = [
35
36
{
@@ -41,11 +42,16 @@ const ac_columns: TableColumnsType<MissDetailDisplayDataType> = [
41
42
{
42
43
title : "Count" ,
43
44
dataIndex : "value" ,
45
+ align : "right" ,
46
+ defaultSortOrder : "descend" ,
47
+ render : ( _ , record ) => < span className = { styles . numberFormat } > { record . value } </ span > ,
44
48
sorter : ( a , b ) => a . value - b . value ,
45
49
} ,
46
50
{
47
51
title : "Rate (%)" ,
48
52
dataIndex : "rate" ,
53
+ align : "right" ,
54
+ render : ( _ , record ) => < span className = { styles . numberFormat } > { record . rate } </ span > ,
49
55
sorter : ( a , b ) => parseFloat ( a . rate ) - parseFloat ( b . rate ) ,
50
56
}
51
57
]
@@ -94,7 +100,7 @@ const AcMetrics: React.FC<{ acMetrics: ActionSummary | undefined; }> = ({ acMetr
94
100
95
101
return (
96
102
< Space direction = "vertical" size = "middle" style = { { display : 'flex' } } >
97
- < PortalCard icon = { < DashboardOutlined /> } titleBits = { acTitle } >
103
+ < PortalCard type = "inner" icon = { < DashboardOutlined /> } titleBits = { acTitle } >
98
104
< Row >
99
105
< Space size = "large" >
100
106
< BarChart width = { 170 } height = { 150 } data = { hits_data } margin = { { top : 0 , left : 10 , bottom : 10 , right : 10 } } >
@@ -117,7 +123,7 @@ const AcMetrics: React.FC<{ acMetrics: ActionSummary | undefined; }> = ({ acMetr
117
123
</ Row >
118
124
< Row justify = "space-around" align = "top" >
119
125
< Col span = "12" >
120
- < PortalCard icon = { < PieChartOutlined /> } titleBits = { [ "Miss Detail Breakdown" ] } >
126
+ < PortalCard type = "inner" icon = { < PieChartOutlined /> } titleBits = { [ "Miss Detail Breakdown" ] } >
121
127
< PieChart width = { 600 } height = { 500 } >
122
128
123
129
< Pie
@@ -143,7 +149,7 @@ const AcMetrics: React.FC<{ acMetrics: ActionSummary | undefined; }> = ({ acMetr
143
149
144
150
</ Col >
145
151
< Col span = "12" >
146
- < PortalCard icon = { < HddOutlined /> } titleBits = { [ "Miss Detail Data" ] } >
152
+ < PortalCard type = "inner" icon = { < HddOutlined /> } titleBits = { [ "Miss Detail Data" ] } >
147
153
< Table
148
154
columns = { ac_columns }
149
155
dataSource = { ac_data }
0 commit comments