mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Use ellipsis when trace view header url is too long (#86417)
* Limit url length * Update styles to use objects * Update width * Add url to tooltip
This commit is contained in:
parent
61f3d08c3f
commit
5cee521dc9
@ -3161,13 +3161,7 @@ exports[`better eslint`] = {
|
||||
"public/app/features/explore/TraceView/components/TracePageHeader/TracePageHeader.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "1"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "2"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "3"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "4"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "5"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "6"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "7"],
|
||||
[0, 0, 0, "Styles should be written using objects.", "8"]
|
||||
[0, 0, 0, "Styles should be written using objects.", "2"]
|
||||
],
|
||||
"public/app/features/explore/TraceView/components/TracePageHeader/index.tsx:5381": [
|
||||
[0, 0, 0, "Do not re-export imported variable (\`./TracePageHeader\`)", "0"]
|
||||
|
@ -117,6 +117,15 @@ export const TracePageHeader = memo((props: TracePageHeaderProps) => {
|
||||
}
|
||||
}
|
||||
|
||||
const urlTooltip = (url: string) => {
|
||||
return (
|
||||
<>
|
||||
<div>http.url or http.target or http.path</div>
|
||||
<div>({url})</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<div className={styles.titleRow}>
|
||||
@ -143,7 +152,7 @@ export const TracePageHeader = memo((props: TracePageHeaderProps) => {
|
||||
</Tooltip>
|
||||
)}
|
||||
{url && url.length > 0 && (
|
||||
<Tooltip content={'http.url or http.target or http.path'} interactive={true}>
|
||||
<Tooltip content={urlTooltip(url[0].value)} interactive={true}>
|
||||
<span className={styles.url}>{url[0].value}</span>
|
||||
</Tooltip>
|
||||
)}
|
||||
@ -230,33 +239,34 @@ const getNewStyles = (theme: GrafanaTheme2) => {
|
||||
lineHeight: '1em',
|
||||
margin: '-0.5em 0.5em 0.75em 0.5em',
|
||||
}),
|
||||
tag: css`
|
||||
margin: 0 0.5em 0 0;
|
||||
`,
|
||||
duration: css`
|
||||
color: #aaa;
|
||||
margin: 0 0.75em;
|
||||
`,
|
||||
timestamp: css`
|
||||
vertical-align: middle;
|
||||
`,
|
||||
tagMeta: css`
|
||||
margin: 0 0.75em;
|
||||
vertical-align: text-top;
|
||||
`,
|
||||
url: css`
|
||||
margin: -2.5px 0.3em;
|
||||
height: 15px;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
line-height: 20px;
|
||||
`,
|
||||
TracePageHeaderTraceId: css`
|
||||
label: TracePageHeaderTraceId;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 30%;
|
||||
display: inline-block;
|
||||
`,
|
||||
tag: css({
|
||||
margin: '0 0.5em 0 0',
|
||||
}),
|
||||
duration: css({
|
||||
color: '#aaa',
|
||||
margin: '0 0.75em',
|
||||
}),
|
||||
timestamp: css({
|
||||
verticalAlign: 'middle',
|
||||
}),
|
||||
tagMeta: css({
|
||||
margin: '0 0.75em',
|
||||
verticalAlign: 'text-top',
|
||||
}),
|
||||
url: css({
|
||||
margin: '-2.5px 0.3em',
|
||||
height: '15px',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
maxWidth: '700px',
|
||||
display: 'inline-block',
|
||||
}),
|
||||
TracePageHeaderTraceId: css({
|
||||
label: 'TracePageHeaderTraceId',
|
||||
whiteSpace: 'nowrap',
|
||||
textOverflow: 'ellipsis',
|
||||
maxWidth: '30%',
|
||||
display: 'inline-block',
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user