|
@@ -1,11 +1,12 @@
|
|
|
// Libraries
|
|
// Libraries
|
|
|
-import React, { PureComponent, SFC } from 'react';
|
|
|
|
|
|
|
+import React, { PureComponent } from 'react';
|
|
|
|
|
|
|
|
// Services & Utils
|
|
// Services & Utils
|
|
|
import { AngularComponent, getAngularLoader } from 'app/core/services/AngularLoader';
|
|
import { AngularComponent, getAngularLoader } from 'app/core/services/AngularLoader';
|
|
|
import appEvents from 'app/core/app_events';
|
|
import appEvents from 'app/core/app_events';
|
|
|
|
|
|
|
|
// Components
|
|
// Components
|
|
|
|
|
+import { LoadingPlaceholder } from '@grafana/ui';
|
|
|
import { EditorTabBody, EditorToolbarView } from '../dashboard/dashgrid/EditorTabBody';
|
|
import { EditorTabBody, EditorToolbarView } from '../dashboard/dashgrid/EditorTabBody';
|
|
|
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
|
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
|
|
import StateHistory from './StateHistory';
|
|
import StateHistory from './StateHistory';
|
|
@@ -14,7 +15,7 @@ import 'app/features/alerting/AlertTabCtrl';
|
|
|
// Types
|
|
// Types
|
|
|
import { DashboardModel } from '../dashboard/dashboard_model';
|
|
import { DashboardModel } from '../dashboard/dashboard_model';
|
|
|
import { PanelModel } from '../dashboard/panel_model';
|
|
import { PanelModel } from '../dashboard/panel_model';
|
|
|
-import { TestRuleButton } from './TestRuleButton';
|
|
|
|
|
|
|
+import { TestRuleResult } from './TestRuleResult';
|
|
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
|
angularPanel?: AngularComponent;
|
|
angularPanel?: AngularComponent;
|
|
@@ -22,16 +23,6 @@ interface Props {
|
|
|
panel: PanelModel;
|
|
panel: PanelModel;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-interface LoadingPlaceholderProps {
|
|
|
|
|
- text: string;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const LoadingPlaceholder: SFC<LoadingPlaceholderProps> = ({ text }) => (
|
|
|
|
|
- <div className="gf-form-group">
|
|
|
|
|
- {text} <i className="fa fa-spinner fa-spin" />
|
|
|
|
|
- </div>
|
|
|
|
|
-);
|
|
|
|
|
-
|
|
|
|
|
export class AlertTab extends PureComponent<Props> {
|
|
export class AlertTab extends PureComponent<Props> {
|
|
|
element: any;
|
|
element: any;
|
|
|
component: AngularComponent;
|
|
component: AngularComponent;
|
|
@@ -120,14 +111,14 @@ export class AlertTab extends PureComponent<Props> {
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- renderTestRuleButton = () => {
|
|
|
|
|
|
|
+ renderTestRuleResult = () => {
|
|
|
const { panel, dashboard } = this.props;
|
|
const { panel, dashboard } = this.props;
|
|
|
- return <TestRuleButton panelId={panel.id} dashboard={dashboard} LoadingPlaceholder={LoadingPlaceholder} />;
|
|
|
|
|
|
|
+ return <TestRuleResult panelId={panel.id} dashboard={dashboard} LoadingPlaceholder={LoadingPlaceholder} />;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
testRule = (): EditorToolbarView => ({
|
|
testRule = (): EditorToolbarView => ({
|
|
|
title: 'Test Rule',
|
|
title: 'Test Rule',
|
|
|
- render: () => this.renderTestRuleButton(),
|
|
|
|
|
|
|
+ render: () => this.renderTestRuleResult(),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
onAddAlert = () => {
|
|
onAddAlert = () => {
|