File tree Expand file tree Collapse file tree 5 files changed +43
-13
lines changed
Expand file tree Collapse file tree 5 files changed +43
-13
lines changed Original file line number Diff line number Diff line change 11import React from "react"
2- import { TextSmall , Flex } from "@netdata/netdata-ui"
32import { useAttributeValue } from "@/components/provider"
43import Row from "./row"
5-
6- const Info = ( { title, children } ) => (
7- < Flex gap = { 2 } >
8- < TextSmall color = "textDescription" > { title } </ TextSmall >
9- < Flex as = { TextSmall } background = "elementBackground" >
10- { children }
11- </ Flex >
12- </ Flex >
13- )
4+ import Info from "./info"
145
156const Context = ( ) => {
167 const contextScope = useAttributeValue ( "contextScope" )
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { useAttributeValue } from "@/components/provider"
55import Context from "./context"
66import Source from "./source"
77import Description from "./description"
8+ import Units from "./units"
89
910const Container = styled ( Flex ) . attrs ( {
1011 column : true ,
@@ -23,6 +24,7 @@ const Details = () => {
2324 < Description />
2425 { nodeName && < Source /> }
2526 < Context />
27+ < Units />
2628 </ Container >
2729 )
2830}
Original file line number Diff line number Diff line change 1+ import React from "react"
2+ import { TextSmall , Flex } from "@netdata/netdata-ui"
3+
4+ const Info = ( { title, children } ) => (
5+ < Flex gap = { 2 } >
6+ < TextSmall color = "textDescription" > { title } </ TextSmall >
7+ < Flex as = { TextSmall } background = "elementBackground" >
8+ { children }
9+ </ Flex >
10+ </ Flex >
11+ )
12+
13+ export default Info
Original file line number Diff line number Diff line change 1+ import React from "react"
2+ import { useUnitSign } from "@/components/provider"
3+ import Row from "./row"
4+ import Info from "./info"
5+
6+ const Units = ( ) => {
7+ const rawUnits = useUnitSign ( { withoutConversion : true , long : true } )
8+
9+ return (
10+ < Row title = "Units" color = "key" data-testid = "cartDetails-units" >
11+ < Info title = "Raw data units" > { rawUnits } </ Info >
12+ </ Row >
13+ )
14+ }
15+
16+ export default Units
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ import {
88 useIsMinimal ,
99 useAttributeValue ,
1010} from "@/components/provider"
11+ import { withTooltip } from "@/components/tooltip"
12+
13+ const TextWithTooltip = withTooltip ( TextSmall )
1114
1215export const Title = props => {
1316 const title = useTitle ( )
14- const units = useUnitSign ( { long : true } )
17+ const units = useUnitSign ( { withoutConversion : true , long : true } )
1518 const name = useName ( )
1619 const isMinimal = useIsMinimal ( )
1720 const contextScope = useAttributeValue ( "contextScope" )
@@ -39,9 +42,14 @@ export const Title = props => {
3942 </ CopyToClipboard >
4043 ) }
4144 { ! ! units && ! isMinimal && (
42- < TextSmall color = "textLite" whiteSpace = "nowrap" >
45+ < TextWithTooltip
46+ color = "textLite"
47+ whiteSpace = "nowrap"
48+ title = "Source unit (alerts)"
49+ tooltipProps = { { align : "top" } }
50+ >
4351 • [{ units } ]
44- </ TextSmall >
52+ </ TextWithTooltip >
4553 ) }
4654 </ Flex >
4755 )
You can’t perform that action at this time.
0 commit comments