File tree 3 files changed +14
-5
lines changed
web-frontend/src/main/v3/packages
ui/src/components/Inspector/agent-info
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
import { useGetInspectorAgentInfoData } from '@pinpoint-fe/hooks' ;
13
13
import { InspectorAgentInfoServiceType } from './InspectorAgentInfoServiceType' ;
14
14
import { LuChevronsUpDown } from 'react-icons/lu' ;
15
+ import { insertIf } from '@pinpoint-fe/utils' ;
15
16
16
17
export type InfoDefinition = {
17
18
key : string ;
@@ -48,11 +49,15 @@ export const InspectorAgentInfoFetcher = () => {
48
49
label : 'Hostname' ,
49
50
value : data . hostName ,
50
51
} ,
51
- {
52
- key : 'jvmInfo' ,
53
- label : 'JVM (GC Type)' ,
54
- value : `${ data . jvmInfo . jvmVersion } (${ data . jvmInfo . gcTypeName } )` ,
55
- } ,
52
+ ...insertIf ( ! ! data . jvmInfo , ( ) => {
53
+ return [
54
+ {
55
+ key : 'jvmInfo' ,
56
+ label : 'JVM (GC Type)' ,
57
+ value : `${ data . jvmInfo . jvmVersion } (${ data . jvmInfo . gcTypeName } )` ,
58
+ } ,
59
+ ] ;
60
+ } ) ,
56
61
{
57
62
key : 'ip' ,
58
63
label : 'IP' ,
Original file line number Diff line number Diff line change
1
+ export function insertIf < T > ( condition : boolean | ( ( ) => boolean ) , element : ( ) => T [ ] ) : T [ ] {
2
+ return ( typeof condition === 'function' ? condition ( ) : condition ) ? element ( ) : [ ] ;
3
+ }
Original file line number Diff line number Diff line change
1
+ export * from './array' ;
1
2
export * from './date' ;
2
3
export * from './dom' ;
3
4
export * from './format' ;
You can’t perform that action at this time.
0 commit comments