Commit aab224ef by Andrej Ocenas Committed by GitHub

Explore: elastic small fixes (#18879)

- Fix cancellation error showing in UI
- Fix display of object values in log rows
parent e0e3a4db
...@@ -425,6 +425,7 @@ export interface DataQueryError { ...@@ -425,6 +425,7 @@ export interface DataQueryError {
status?: string; status?: string;
statusText?: string; statusText?: string;
refId?: string; refId?: string;
cancelled?: boolean;
} }
export interface ScopedVar { export interface ScopedVar {
......
...@@ -260,7 +260,9 @@ export function logSeriesToLogsModel(logSeries: DataFrame[]): LogsModel { ...@@ -260,7 +260,9 @@ export function logSeriesToLogsModel(logSeries: DataFrame[]): LogsModel {
const timeLocal = time.format('YYYY-MM-DD HH:mm:ss'); const timeLocal = time.format('YYYY-MM-DD HH:mm:ss');
const timeUtc = toUtc(ts).format('YYYY-MM-DD HH:mm:ss'); const timeUtc = toUtc(ts).format('YYYY-MM-DD HH:mm:ss');
const message = stringField.values.get(j); let message = stringField.values.get(j);
// This should be string but sometimes isn't (eg elastic) because the dataFrame is not strongly typed.
message = typeof message === 'string' ? message : JSON.stringify(message);
let logLevel = LogLevel.unknown; let logLevel = LogLevel.unknown;
if (logLevelField) { if (logLevelField) {
......
...@@ -46,7 +46,7 @@ export default class Table extends PureComponent<TableProps> { ...@@ -46,7 +46,7 @@ export default class Table extends PureComponent<TableProps> {
show: text !== 'Time', show: text !== 'Time',
Cell: (row: any) => ( Cell: (row: any) => (
<span className={filterable ? 'link' : ''} title={text + ': ' + row.value}> <span className={filterable ? 'link' : ''} title={text + ': ' + row.value}>
{row.value} {typeof row.value === 'string' ? row.value : JSON.stringify(row.value)}
</span> </span>
), ),
})); }));
......
...@@ -589,6 +589,10 @@ export const processQueryResponse = ( ...@@ -589,6 +589,10 @@ export const processQueryResponse = (
const replacePreviousResults = action.type === queryEndedAction.type; const replacePreviousResults = action.type === queryEndedAction.type;
if (error) { if (error) {
if (error.cancelled) {
return state;
}
// For Angular editors // For Angular editors
state.eventBridge.emit('data-error', error); state.eventBridge.emit('data-error', error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment