Fix maxwidth size for Grafana annotations

This commit is contained in:
Peter Hedenskog 2025-10-13 09:30:26 +02:00
parent b1566ba3ce
commit dbcdc72bed
1 changed files with 1 additions and 4 deletions

View File

@ -6,9 +6,6 @@ export function getAnnotationMessage(
usingBrowsertime,
options
) {
const screenshotSize = options.mobile
? 'height=200px'
: 'style="max-width:400px;height:auto;"';
const resultPageUrl = absolutePagePath + 'index.html';
let screenshotPath;
if (screenShotsEnabledInBrowsertime) {
@ -38,7 +35,7 @@ export function getAnnotationMessage(
let message =
screenShotsEnabledInBrowsertime && screenshotsEnabledForDatasource
? `<a href='${resultPageUrl}' target='_blank'><img src='${screenshotPath}' ${screenshotSize}></a><p><a href='${resultPageUrl}'>Result</a> - <a href='${harPath}'>Download HAR</a></p>`
? `<a href='${resultPageUrl}' target='_blank'><img src='${screenshotPath}' style='max-width:400px'></a><p><a href='${resultPageUrl}'>Result</a> - <a href='${harPath}'>Download HAR</a></p>`
: `<a href='${resultPageUrl}' target='_blank'>Result ${options.browsertime.iterations} run${s}</a>`;
if (extraMessage) {