Fix host maintenance label

This commit is contained in:
Alexander Zobnin
2022-12-29 16:48:03 +01:00
parent 89d33a868e
commit 445b46a6aa
2 changed files with 5 additions and 2 deletions

View File

@@ -99,6 +99,7 @@ export function joinTriggersWithEvents(
export function setMaintenanceStatus(triggers) {
_.each(triggers, (trigger) => {
trigger.hostInMaintenance = _.some(trigger.hosts, (host) => host.maintenance_status === '1');
trigger.maintenance = false;
if (trigger.suppressed === '1') {
trigger.maintenance = true;

View File

@@ -135,9 +135,11 @@ export default class ProblemList extends PureComponent<ProblemListProps, Problem
const highlightNewerThan = options.highlightNewEvents && options.highlightNewerThan;
const statusCell = (props) => StatusCell(props, highlightNewerThan);
const statusIconCell = (props) => StatusIconCell(props, highlightNewerThan);
const hostNameCell = (props) => <HostCell name={props.original.host} maintenance={props.original.maintenance} />;
const hostNameCell = (props) => (
<HostCell name={props.original.host} maintenance={props.original.hostInMaintenance} />
);
const hostTechNameCell = (props) => (
<HostCell name={props.original.hostTechName} maintenance={props.original.maintenance} />
<HostCell name={props.original.hostTechName} maintenance={props.original.hostInMaintenance} />
);
const columns = [