grafana/public/app/features/trails/SelectMetricAction.tsx
Torkel Ödegaard 1f1d348e17
DataTrails: Auto query, explore and breakdown/drilldown prototype (#77019)
* First try

* Update

* app with drilldowns

* Progres

* Progress

* update

* Update

* update

* Update

* Update

* Progress

* Update

* Progress

* Update

* Progress

* logs url sync

* related metrics

* Progress

* progress

* Progress

* Update

* Update

* Update

* Update

* Update

* fix

* Update

* update

* Update

* update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* update

* Update

* Update

* Settings

* Update

* Tweaks

* update

* Improve auto queries

* Update

* Update

* Fixes

* Update

* Update

* Update

* fix

* Update

* Removing logs view, cleanup

* Update

* Update

* disabled not implemented buttons

* Update

* Feature toggle on dashboard menu

* remove unused prometheus change

* removed bit

* Fix failing test

* chore: added `/public/app/features/trails/` to CODEOWNERS

* go mod tidy

* go mod tidy

* fix: added missing arg

* Moved panel action

* Moved panel action

---------

Co-authored-by: André Pereira <adrapereira@gmail.com>
Co-authored-by: Darren Janeczek <darren.janeczek@grafana.com>
2023-11-15 11:28:29 +00:00

26 lines
737 B
TypeScript

import React from 'react';
import { SceneObjectState, SceneObjectBase, SceneComponentProps } from '@grafana/scenes';
import { Button } from '@grafana/ui';
import { MetricSelectedEvent } from './shared';
export interface SelectMetricActionState extends SceneObjectState {
title: string;
metric: string;
}
export class SelectMetricAction extends SceneObjectBase<SelectMetricActionState> {
public onClick = () => {
this.publishEvent(new MetricSelectedEvent(this.state.metric), true);
};
public static Component = ({ model }: SceneComponentProps<SelectMetricAction>) => {
return (
<Button variant="primary" size="sm" fill="text" onClick={model.onClick}>
{model.state.title}
</Button>
);
};
}