Problems: Add operational data field, closes #1260
This commit is contained in:
@@ -174,6 +174,7 @@ export default class ProblemList extends PureComponent<ProblemListProps, Problem
|
||||
},
|
||||
{ Header: 'Status', accessor: 'value', show: options.statusField, width: 100, Cell: statusCell },
|
||||
{ Header: 'Problem', accessor: 'name', minWidth: 200, Cell: ProblemCell },
|
||||
{ Header: 'Operational data', accessor: 'opdata', show: options.opdataField, width: 150, Cell: OpdataCell },
|
||||
{
|
||||
Header: 'Ack',
|
||||
id: 'ack',
|
||||
@@ -362,6 +363,15 @@ function ProblemCell(props: RTCell<ProblemDTO>) {
|
||||
);
|
||||
}
|
||||
|
||||
function OpdataCell(props: RTCell<ProblemDTO>) {
|
||||
const problem = props.original;
|
||||
return (
|
||||
<div>
|
||||
<span>{problem.opdata}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AgeCell(props: RTCell<ProblemDTO>) {
|
||||
const problem = props.original;
|
||||
const timestamp = moment.unix(problem.timestamp);
|
||||
|
||||
@@ -195,6 +195,12 @@ export const plugin = new PanelPlugin<ProblemsPanelOptions, {}>(ProblemsPanel)
|
||||
defaultValue: defaultPanelOptions.ageField,
|
||||
category: ['Fields'],
|
||||
})
|
||||
.addBooleanSwitch({
|
||||
path: 'opdataField',
|
||||
name: 'Operational data',
|
||||
defaultValue: defaultPanelOptions.opdataField,
|
||||
category: ['Fields'],
|
||||
})
|
||||
.addBooleanSwitch({
|
||||
path: 'descriptionField',
|
||||
name: 'Description',
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface ProblemsPanelOptions {
|
||||
severityField?: boolean;
|
||||
ackField?: boolean;
|
||||
ageField?: boolean;
|
||||
opdataField?: boolean;
|
||||
descriptionField?: boolean;
|
||||
descriptionAtNewLine?: boolean;
|
||||
// Options
|
||||
@@ -66,6 +67,7 @@ export const defaultPanelOptions: Partial<ProblemsPanelOptions> = {
|
||||
severityField: true,
|
||||
ackField: true,
|
||||
ageField: false,
|
||||
opdataField: false,
|
||||
descriptionField: true,
|
||||
descriptionAtNewLine: false,
|
||||
// Options
|
||||
|
||||
Reference in New Issue
Block a user