Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/module.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{"name": "Log Dashboard", "path": "img/log-visualisation.png"}
],
"version": "1.0.0",
"updated": "2023-01-12"
"updated": "2023-01-14"
},
"routes": [
{
Expand Down
Binary file modified releases/parseable-datasource-1.0.0.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion releases/parseable-datasource-1.0.0.zip.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5b8ea6ec14ae03fef6d647897117747404f754fd
988a5ad54250dc271688bc975cebe778ac8ac4d4
43 changes: 21 additions & 22 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
DataSourceInstanceSettings,
MutableDataFrame,
DataFrame,
FieldType,
guessFieldTypeFromValue,
} from '@grafana/data';
import { lastValueFrom, of } from 'rxjs';
Expand Down Expand Up @@ -101,27 +100,27 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
return { name: field, type: guessFieldTypeFromValue(array[0][field]) };
});

let timeFieldFound = false;
for (const field of fields) {
// Check for p_timestamp first
// because if it is present we want to use this field
// as we know the format (ISO8601)
if (field.name.toLowerCase() === 'p_timestamp') {
field.type = FieldType.time;
timeFieldFound = true;
break;
}
}
// fallback to other possible time fields
// if p_timestamp is not present
if (!timeFieldFound) {
for (const field of fields) {
if (field.name.toLowerCase() === 'time' || 'datetime' || 'timestamp' || 'date') {
field.type = FieldType.time;
break;
}
}
}
// let timeFieldFound = false;
// for (const field of fields) {
// // Check for p_timestamp first
// // because if it is present we want to use this field
// // as we know the format (ISO8601)
// if (field.name.toLowerCase() === 'p_timestamp') {
// field.type = FieldType.time;
// timeFieldFound = true;
// break;
// }
// }
// // fallback to other possible time fields
// // if p_timestamp is not present
// if (!timeFieldFound) {
// for (const field of fields) {
// if (field.name.toLowerCase() === 'time' || 'datetime' || 'timestamp' || 'date') {
// field.type = FieldType.time;
// break;
// }
// }
// }

dataFrame = new MutableDataFrame({ fields });
array.forEach((row, index) => {
Expand Down