1
1
import React , { useEffect , useMemo } from 'react' ;
2
2
import { PanelData , PanelProps } from '@grafana/data' ;
3
- import { Button } from '@grafana/ui' ;
3
+ import { Icon , TextLink } from '@grafana/ui' ;
4
4
import TraceDetail from './TraceDetail' ;
5
5
import { QueryClient , QueryClientProvider } from '@tanstack/react-query' ;
6
6
import { HelpModal } from './HelpModal' ;
@@ -71,22 +71,25 @@ export const TraceViewerPanel: React.FC<Props> = ({ options, data, width, height
71
71
if ( data . series . length === 0 || queries . length === 0 ) {
72
72
return (
73
73
< >
74
- < div className = "flex items-center justify-center h-full p-4 text-center" >
75
- < div className = "text-blue-500" >
76
- < h3 className = "text-lg font-semibold mb-2" > 📊 No trace data available</ h3 >
77
- < p > The current query returned no trace data.</ p >
78
- < p className = "text-sm text-gray-500 mt-1" > Try adjusting your query or time range to see traces.</ p >
79
- < Button
74
+ < div className = "flex flex-col items-center justify-center h-full p-4 text-center" >
75
+ < Icon name = "calendar-slash" size = "xxxl" className = "text-zinc-600 mb-5" />
76
+ < h3 className = "text-lg font-semibold mb-2 text-black dark:text-white" >
77
+ No trace data available for this query
78
+ </ h3 >
79
+ < p className = "text-md text-zinc-400 mt-1" >
80
+ Try adjusting your query or time range to see traces.{ ' ' }
81
+ < TextLink
80
82
onClick = { ( ) => {
81
83
setHelpModalType ( 'no-data' ) ;
82
84
setShowHelpModal ( true ) ;
83
85
} }
84
- variant = "primary"
85
- className = "mt-4"
86
+ inline = { true }
87
+ color = "disabled"
88
+ href = "#no-data"
86
89
>
87
- Get Help
88
- </ Button >
89
- </ div >
90
+ Learn more
91
+ </ TextLink >
92
+ </ p >
90
93
</ div >
91
94
< HelpModal
92
95
isOpen = { showHelpModal }
@@ -102,23 +105,25 @@ export const TraceViewerPanel: React.FC<Props> = ({ options, data, width, height
102
105
else if ( width < 600 || height < 300 ) {
103
106
return (
104
107
< >
105
- < div className = "flex items-center justify-center h-full p-4 text-center " >
106
- < div className = "text-orange-500 " >
107
- < h3 className = "text-lg font-semibold mb-2" > ⚠️ Panel too small for trace visualization </ h3 >
108
- < p > This panel requires a minimum size of 600x300 pixels. </ p >
109
- < p className = "text-sm text-gray-500 mt-1 " >
110
- Current size: { width } x { height } pixels
111
- </ p >
112
- < Button
108
+ < div className = "flex flex-col h-full" >
109
+ < p className = "bg-red-400 py-1 text-black text-md flex items-center justify-center gap-2 rounded " >
110
+ < Icon name = "exclamation-triangle" /> Current panel size is { Math . floor ( width ) } x { Math . floor ( height ) } pixels
111
+ </ p >
112
+ < div className = "text-center flex-1 flex flex-col justify-center " >
113
+ < h3 className = "text-lg font-semibold mb-2 text-black dark:text-white" > Panel too small </ h3 >
114
+ < p className = "text-zinc-400" > This panel requires a minimum size of 600x300 pixels. < /p >
115
+ < TextLink
113
116
onClick = { ( ) => {
114
117
setHelpModalType ( 'panel-too-small' ) ;
115
118
setShowHelpModal ( true ) ;
116
119
} }
117
- variant = "primary"
118
- className = "mt-4"
120
+ color = "disabled"
121
+ inline = { true }
122
+ href = "#panel-too-small"
123
+ style = { { display : 'block' } }
119
124
>
120
- Get Help
121
- </ Button >
125
+ Learn more
126
+ </ TextLink >
122
127
</ div >
123
128
</ div >
124
129
< HelpModal
0 commit comments