Explore: elastic small fixes (#18879)

- Fix cancellation error showing in UI
- Fix display of object values in log rows
This commit is contained in:
Andrej Ocenas
2019-09-04 10:49:09 +02:00
committed by GitHub
parent e0e3a4db54
commit aab224ef29
4 changed files with 9 additions and 2 deletions

View File

@@ -425,6 +425,7 @@ export interface DataQueryError {
status?: string;
statusText?: string;
refId?: string;
cancelled?: boolean;
}
export interface ScopedVar {

View File

@@ -260,7 +260,9 @@ export function logSeriesToLogsModel(logSeries: DataFrame[]): LogsModel {
const timeLocal = time.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;
if (logLevelField) {

View File

@@ -46,7 +46,7 @@ export default class Table extends PureComponent<TableProps> {
show: text !== 'Time',
Cell: (row: any) => (
<span className={filterable ? 'link' : ''} title={text + ': ' + row.value}>
{row.value}
{typeof row.value === 'string' ? row.value : JSON.stringify(row.value)}
</span>
),
}));

View File

@@ -589,6 +589,10 @@ export const processQueryResponse = (
const replacePreviousResults = action.type === queryEndedAction.type;
if (error) {
if (error.cancelled) {
return state;
}
// For Angular editors
state.eventBridge.emit('data-error', error);