mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Scenes: Minor fix to monitoring app (#67635)
This commit is contained in:
parent
35f649e530
commit
11446511c1
@ -1,16 +1,7 @@
|
||||
// Libraries
|
||||
import React, { useMemo, useState } from 'react';
|
||||
|
||||
import {
|
||||
SceneCanvasText,
|
||||
SceneFlexLayout,
|
||||
SceneApp,
|
||||
SceneAppPage,
|
||||
SceneRouteMatch,
|
||||
EmbeddedScene,
|
||||
SceneAppPageLike,
|
||||
SceneFlexItem,
|
||||
} from '@grafana/scenes';
|
||||
import { SceneApp, SceneAppPage, SceneRouteMatch, SceneAppPageLike } from '@grafana/scenes';
|
||||
import { usePageNav } from 'app/core/components/Page/usePageNav';
|
||||
import { PluginPageContext, PluginPageContextType } from 'app/features/plugins/components/PluginPageContext';
|
||||
|
||||
@ -104,44 +95,9 @@ export function getHandlerDrilldownPage(
|
||||
routePath: '/scenes/grafana-monitoring/handlers/:handler/logs',
|
||||
getScene: () => getHandlerLogsScene(handler),
|
||||
preserveUrlKeys: ['from', 'to', 'var-instance'],
|
||||
drilldowns: [
|
||||
{
|
||||
routePath: '/scenes/grafana-monitoring/handlers/:handler/logs/:secondLevel',
|
||||
getPage: getSecondLevelDrilldown,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
export function getSecondLevelDrilldown(
|
||||
match: SceneRouteMatch<{ handler: string; secondLevel: string }>,
|
||||
parent: SceneAppPageLike
|
||||
) {
|
||||
const handler = decodeURIComponent(match.params.handler);
|
||||
const secondLevel = decodeURIComponent(match.params.secondLevel);
|
||||
const baseUrl = `/scenes/grafana-monitoring/handlers/${encodeURIComponent(handler)}/logs/${secondLevel}`;
|
||||
|
||||
return new SceneAppPage({
|
||||
title: secondLevel,
|
||||
subTitle: 'Second level dynamic drilldown',
|
||||
url: baseUrl,
|
||||
getParentPage: () => parent,
|
||||
getScene: () => {
|
||||
return new EmbeddedScene({
|
||||
body: new SceneFlexLayout({
|
||||
children: [
|
||||
new SceneFlexItem({
|
||||
body: new SceneCanvasText({
|
||||
text: 'Drilldown: ' + secondLevel,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default GrafanaMonitoringApp;
|
||||
|
@ -164,7 +164,7 @@ export function getHttpHandlerListScene(): EmbeddedScene {
|
||||
// },
|
||||
title: getFrameDisplayName(frame),
|
||||
options: {
|
||||
legend: { displayMode: 'hidden' },
|
||||
legend: { showLegend: false },
|
||||
},
|
||||
}),
|
||||
}),
|
||||
@ -481,19 +481,6 @@ export function getHandlerLogsScene(handler: string): EmbeddedScene {
|
||||
body: new SceneFlexLayout({
|
||||
direction: 'column',
|
||||
children: [
|
||||
new SceneFlexItem({
|
||||
body: new VizPanel({
|
||||
pluginId: 'text',
|
||||
title: '',
|
||||
options: {
|
||||
mode: 'markdown',
|
||||
content: `
|
||||
[mupp](/scenes/grafana-monitoring/handlers/${encodeURIComponent(handler)}/logs/mupp)
|
||||
[mapp](/scenes/grafana-monitoring/handlers/${encodeURIComponent(handler)}/logs/mapp)
|
||||
`,
|
||||
},
|
||||
}),
|
||||
}),
|
||||
new SceneFlexItem({
|
||||
body: new VizPanel({
|
||||
$data: logsQuery,
|
||||
|
Loading…
Reference in New Issue
Block a user