mirror of
https://github.com/portainer/portainer.git
synced 2025-08-01 20:05:23 +02:00
fix(logs-viewer): fail to search json logs [EE-4857] (#8482)
This commit is contained in:
parent
6074d1fcb5
commit
085381e6fc
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue