mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PluginExtensions: Logs panel takes full height/width (#95825)
Making the log panel taking full space of page.
This commit is contained in:
parent
cd3a71e7cb
commit
df4a5aeaf1
@ -1,5 +1,6 @@
|
|||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { ReactElement, useState } from 'react';
|
import { ReactElement, useState } from 'react';
|
||||||
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||||
|
|
||||||
import { sceneUtils, VizConfigBuilders } from '@grafana/scenes';
|
import { sceneUtils, VizConfigBuilders } from '@grafana/scenes';
|
||||||
import {
|
import {
|
||||||
@ -21,7 +22,7 @@ const DATASOURCE_REF = {
|
|||||||
type: 'grafana-extensionslog-datasource',
|
type: 'grafana-extensionslog-datasource',
|
||||||
};
|
};
|
||||||
|
|
||||||
const logsViz = VizConfigBuilders.logs().build();
|
const logsViz = VizConfigBuilders.logs().setOption('wrapLogMessage', true).build();
|
||||||
|
|
||||||
sceneUtils.registerRuntimeDataSource({
|
sceneUtils.registerRuntimeDataSource({
|
||||||
dataSource: new ExtensionsLogDataSource(DATASOURCE_REF.type, DATASOURCE_REF.uid, log),
|
dataSource: new ExtensionsLogDataSource(DATASOURCE_REF.type, DATASOURCE_REF.uid, log),
|
||||||
@ -54,9 +55,13 @@ function LogViewScene(): ReactElement | null {
|
|||||||
navId="extensions"
|
navId="extensions"
|
||||||
actions={<LogViewFilters provider={data} filteredProvider={filteredData} filter={filter} onChange={setFilter} />}
|
actions={<LogViewFilters provider={data} filteredProvider={filteredData} filter={filter} onChange={setFilter} />}
|
||||||
>
|
>
|
||||||
<VizGridLayout>
|
<AutoSizer>
|
||||||
<VizPanel title="" viz={logsViz} dataProvider={filteredData} />
|
{({ height, width }) => (
|
||||||
</VizGridLayout>
|
<VizGridLayout minHeight={height} minWidth={width}>
|
||||||
|
<VizPanel title="" viz={logsViz} dataProvider={filteredData} />
|
||||||
|
</VizGridLayout>
|
||||||
|
)}
|
||||||
|
</AutoSizer>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user