problems panel: properly sort by time and severity

This commit is contained in:
Alexander Zobnin
2018-12-08 12:50:26 +03:00
parent ad661ca75b
commit d4ca1d5dbb

View File

@@ -45,11 +45,19 @@ export class ProblemList extends PureComponent<ProblemListProps, ProblemListStat
{ Header: 'Host (Technical Name)', accessor: 'hostTechName', show: options.hostTechNameField }, { Header: 'Host (Technical Name)', accessor: 'hostTechName', show: options.hostTechNameField },
{ Header: 'Host Groups', accessor: 'groups', show: options.hostGroups, Cell: GroupCell }, { Header: 'Host Groups', accessor: 'groups', show: options.hostGroups, Cell: GroupCell },
{ Header: 'Proxy', accessor: 'proxy', show: options.hostProxy }, { Header: 'Proxy', accessor: 'proxy', show: options.hostProxy },
{ Header: 'Severity', accessor: 'severity', show: options.severityField, className: 'problem-severity', width: 120, Cell: SeverityCell }, { Header: 'Severity', show: options.severityField, className: 'problem-severity', width: 120,
accessor: problem => problem.priority,
id: 'severity',
Cell: SeverityCell,
},
{ Header: 'Status', accessor: 'value', show: options.statusField, width: 100, Cell: statusCell }, { Header: 'Status', accessor: 'value', show: options.statusField, width: 100, Cell: statusCell },
{ Header: 'Problem', accessor: 'description', minWidth: 200, Cell: ProblemCell}, { Header: 'Problem', accessor: 'description', minWidth: 200, Cell: ProblemCell},
{ Header: 'Tags', accessor: 'tags', show: options.showTags, className: 'problem-tags', Cell: TagCell }, { Header: 'Tags', accessor: 'tags', show: options.showTags, className: 'problem-tags', Cell: TagCell },
{ Header: 'Time', accessor: 'lastchange', className: 'last-change', width: timeColWidth }, { Header: 'Time', className: 'last-change', width: timeColWidth,
accessor: 'lastchangeUnix',
id: 'lastchange',
Cell: row => row.original.lastchange,
},
{ Header: 'Details', className: 'custom-expander', width: 60, expander: true, Expander: CustomExpander }, { Header: 'Details', className: 'custom-expander', width: 60, expander: true, Expander: CustomExpander },
]; ];
for (const column of columns) { for (const column of columns) {
@@ -101,10 +109,9 @@ export class ProblemList extends PureComponent<ProblemListProps, ProblemListStat
// } // }
function SeverityCell(props) { function SeverityCell(props) {
// console.log(props);
return ( return (
<div className='severity-cell' style={{ background: props.original.color }}> <div className='severity-cell' style={{ background: props.original.color }}>
{props.value} {props.original.severity}
</div> </div>
); );
} }