Devops's Blog

Оптимизация zabbixv6 2

Делаем на примере widget.problems. Открываем фаил monitoring.widget.problems.view.php

Приводим код к такому виду

					    
       #   /*$problem_link = [
       #         (new CLinkAction($problem['name']))
       #                 ->setMenuPopup(CMenuPopupHelper::getTrigger($trigger['triggerid'], $problem['eventid']))
       #                 ->setAttribute('aria-label', _xs('%1$s, Severity, %2$s', 'screen reader',
       #                         $problem['name'], CSeverityHelper::getName((int) $problem['severity'])
       #                 ))
       #         ];*/
        $problem_link = [
                (new CLinkAction($problem['name']))
                ->setAjaxHint(CHintBoxHelper::getEventList($trigger['triggerid'], $eventid, $show_timeline,
                                        $data['fields']['show_tags'], $data['fields']['tags'], $data['fields']['tag_name_format'],
                                        $data['fields']['tag_priority']
                                ))

                        ];
					    

					    
				    

        $table->addRow(array_merge($row, [
                $show_recovery_data ? $cell_r_clock : null,
                $show_recovery_data ? $cell_status : null,
                makeInformationList($info_icons),
                $triggers_hosts[$trigger['triggerid']],
                $description,
                ($show_opdata == OPERATIONAL_DATA_SHOW_SEPARATELY ) ? $opdata : null,
              #  /*(new CCol(
              #          (new CLinkAction(zbx_date2age($problem['clock'], ($problem['r_eventid'] != 0) ? $problem['r_clock'] : 0)))
              #                  ->setAjaxHint(CHintBoxHelper::getEventList($trigger['triggerid'], $eventid, $show_timeline,
              #                          $data['fields']['show_tags'], $data['fields']['tags'], $data['fields']['tag_name_format'],
              #                          $data['fields']['tag_priority']
              #                  ))
              #  ))->addClass(ZBX_STYLE_NOWRAP),*/
                (new CCol(zbx_date2age($problem['clock'], ($problem['r_eventid'] != 0) ? $problem['r_clock'] : 0)))
                ->addClass(ZBX_STYLE_NOWRAP),
                $problem_update_link,
                makeEventActionsIcons($problem['eventid'], $data['data']['actions'], $data['data']['users']),
                $data['fields']['show_tags'] ? $data['data']['tags'][$problem['eventid']] : null
        ]));
				    

Теперь история триггера отображается в столбце проблема , а не длительность

image