Problems: Add operational data field, closes #1260

This commit is contained in:
Alexander Zobnin
2023-01-20 16:51:54 +01:00
parent bc62e35477
commit 41d292c51d
5 changed files with 20 additions and 0 deletions

View File

@@ -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);