Skip to content

Commit d3a1c8d

Browse files
committed
Fix: different issues
1 parent 8c6c4bb commit d3a1c8d

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ You need:
1414

1515
### Building
1616

17+
### All the stack
18+
19+
```shell
20+
./build_and_start.sh
21+
```
22+
1723
#### Frontend
1824

1925
```bash
20-
$ yarn install
21-
$ yarn build
26+
$ npm install
27+
$ npm run build
2228
```
2329

24-
When developing the front, use `yarn dev`.
30+
When developing the front, use `npm run dev`.
2531

2632
#### Backend
2733

@@ -49,7 +55,6 @@ $ npm run test
4955
$ go test -v ./pkg/...
5056
```
5157

52-
5358
## Release
5459

5560
TODO

build_and_start.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
npm install
4+
npm run build
5+
mage -v
6+
docker-compose up --build --force-recreate

docker-compose.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ services:
1212
volumes:
1313
- ./:/var/lib/grafana/plugins/grafana-quickwit-datasource
1414
- ./provisioning:/etc/grafana/provisioning
15-
# - ./grafana/storage:/var/lib/grafana
16-
# - ./grafana/grafana.ini:/etc/grafana/grafana.ini
15+
- gquickwit:/var/lib/grafana
1716
extra_hosts:
1817
- "host.docker.internal:host-gateway"
18+
19+
volumes:
20+
gquickwit:

src/datasource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { cloneDeep, first as _first, map as _map, groupBy } from 'lodash';
22
import { Observable, lastValueFrom, from, isObservable, of } from 'rxjs';
33
import { catchError, mergeMap, map } from 'rxjs/operators';
44
import { intervalMap } from './IntervalMap';
5-
import { Interval } from './types';
65

76
import {
87
AbstractQuery,
@@ -33,7 +32,7 @@ import {
3332
SupplementaryQueryType,
3433
TimeRange,
3534
} from '@grafana/data';
36-
import { BucketAggregation, DataLinkConfig, ElasticsearchQuery, Field, FieldMapping, IndexMetadata, Logs, TermsQuery } from './types';
35+
import { BucketAggregation, DataLinkConfig, ElasticsearchQuery, Field, FieldMapping, IndexMetadata, Logs, TermsQuery, Interval } from './types';
3736
import { DataSourceWithBackend, getTemplateSrv, TemplateSrv } from '@grafana/runtime';
3837
import { LogRowContextOptions, LogRowContextQueryDirection, QuickwitOptions } from 'quickwit';
3938
import { ElasticQueryBuilder } from 'QueryBuilder';
@@ -437,6 +436,7 @@ export class QuickwitDataSource
437436

438437
private makeLogContextDataRequest = (row: LogRowModel, options?: LogRowContextOptions) => {
439438
const direction = options?.direction || LogRowContextQueryDirection.Backward;
439+
440440
const logQuery: Logs = {
441441
type: 'logs',
442442
id: '1',
@@ -445,7 +445,7 @@ export class QuickwitDataSource
445445
// Sorting of results in the context query
446446
sortDirection: direction === LogRowContextQueryDirection.Backward ? 'desc' : 'asc',
447447
// Used to get the next log lines before/after the current log line using sort field of selected log line
448-
searchAfter: row.dataFrame.fields.find((f) => f.name === 'sort')?.values[row.rowIndex] ?? [row.timeEpochMs],
448+
searchAfter: row.dataFrame.fields.find((f) => f.name === 'sort')?.values.get(row.rowIndex) ?? [row.timeEpochMs],
449449
},
450450
};
451451

@@ -501,7 +501,7 @@ export class QuickwitDataSource
501501
}
502502

503503
getLogRowContextUi?(row: LogRowModel, runContextQuery?: (() => void) | undefined): ReactNode {
504-
throw new Error('Method not implemented.');
504+
return true;
505505
}
506506

507507
/**

0 commit comments

Comments
 (0)