mirror of https://github.com/portainer/portainer
fix(logs-viewer): fail to search json logs [EE-4857] (#8482)
parent
6074d1fcb5
commit
085381e6fc
|
@ -119,15 +119,17 @@ export function formatKeyValuePair(
|
||||||
) {
|
) {
|
||||||
let nl = line;
|
let nl = line;
|
||||||
|
|
||||||
|
const strValue = typeof value !== 'string' ? JSON.stringify(value) : value;
|
||||||
|
|
||||||
spans.push(
|
spans.push(
|
||||||
{ fgColor: Colors.Blue, text: `${key}=` },
|
{ fgColor: Colors.Blue, text: `${key}=` },
|
||||||
{
|
{
|
||||||
fgColor: key === 'error' || key === 'ERR' ? Colors.Red : Colors.Magenta,
|
fgColor: key === 'error' || key === 'ERR' ? Colors.Red : Colors.Magenta,
|
||||||
text: value as string,
|
text: strValue,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (!isLastKey) spans.push(spaceSpan);
|
if (!isLastKey) spans.push(spaceSpan);
|
||||||
nl += `${key}=${value}${!isLastKey ? ' ' : ''}`;
|
nl += `${key}=${strValue}${!isLastKey ? ' ' : ''}`;
|
||||||
|
|
||||||
return nl;
|
return nl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue