problems panel: enable acknowledges

This commit is contained in:
Alexander Zobnin
2018-12-24 16:55:20 +03:00
parent d3488becdd
commit 2fefa11aea
4 changed files with 22 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import * as utils from '../../datasource-zabbix/utils';
import { ProblemsPanelOptions, Trigger, ZBXEvent, GFTimeRange, RTCell } from '../types';
import EventTag from './EventTag';
import ProblemDetails from './ProblemDetails';
import { AckProblemData } from './Modal';
export interface ProblemListProps {
problems: Trigger[];
@@ -11,6 +12,7 @@ export interface ProblemListProps {
loading?: boolean;
timeRange?: GFTimeRange;
getProblemEvents: (ids: string[]) => ZBXEvent[];
onProblemAck: (problem: Trigger, data: AckProblemData) => void;
}
interface ProblemListState {
@@ -34,6 +36,10 @@ export class ProblemList extends PureComponent<ProblemListProps, ProblemListStat
this.rootRef = ref;
}
handleProblemAck = (problem: Trigger, data: AckProblemData) => {
return this.props.onProblemAck(problem, data);
}
buildColumns() {
const result = [];
const options = this.props.panelOptions;
@@ -99,6 +105,7 @@ export class ProblemList extends PureComponent<ProblemListProps, ProblemListStat
rootWidth={this.rootWidth}
timeRange={this.props.timeRange}
getProblemEvents={this.props.getProblemEvents}
onProblemAck={this.handleProblemAck}
/>
}
expanded={this.getExpandedPage(this.state.page)}