mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* 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>
26 lines
737 B
TypeScript
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>
|
|
);
|
|
};
|
|
}
|