mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 00:34:46 +02:00
changes to show last status change of modules
This commit is contained in:
parent
6cea6f62c2
commit
014688468c
@ -1284,6 +1284,7 @@ ALTER TABLE `tagente_estado` MODIFY COLUMN `datos` mediumtext NOT NULL,
|
|||||||
MODIFY COLUMN `last_known_status` tinyint(4) NULL DEFAULT '0',
|
MODIFY COLUMN `last_known_status` tinyint(4) NULL DEFAULT '0',
|
||||||
MODIFY COLUMN `last_dynamic_update` bigint(20) NOT NULL DEFAULT '0',
|
MODIFY COLUMN `last_dynamic_update` bigint(20) NOT NULL DEFAULT '0',
|
||||||
MODIFY COLUMN `last_unknown_update` bigint(20) NOT NULL DEFAULT '0';
|
MODIFY COLUMN `last_unknown_update` bigint(20) NOT NULL DEFAULT '0';
|
||||||
|
ALTER TABLE `tagente_estado` ADD COLUMN `last_status_change` bigint(20) NOT NULL DEFAULT '0';
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `talert_actions`
|
-- Table `talert_actions`
|
||||||
|
@ -1028,7 +1028,7 @@ if (check_login()) {
|
|||||||
$title
|
$title
|
||||||
);
|
);
|
||||||
|
|
||||||
$data[5] = ui_print_status_image($status, htmlspecialchars($title), true);
|
$data[5] = ui_print_status_image($status, htmlspecialchars($title), true, false, false, false, $module['last_status_change']);
|
||||||
if (!$show_context_help_first_time) {
|
if (!$show_context_help_first_time) {
|
||||||
$show_context_help_first_time = true;
|
$show_context_help_first_time = true;
|
||||||
|
|
||||||
|
@ -2663,7 +2663,8 @@ function ui_print_status_image(
|
|||||||
$return=false,
|
$return=false,
|
||||||
$options=false,
|
$options=false,
|
||||||
$path=false,
|
$path=false,
|
||||||
$image_with_css=false
|
$image_with_css=false,
|
||||||
|
$module_last_status_change=''
|
||||||
) {
|
) {
|
||||||
if ($path === false) {
|
if ($path === false) {
|
||||||
$imagepath_array = ui_get_status_images_path();
|
$imagepath_array = ui_get_status_images_path();
|
||||||
@ -2678,9 +2679,15 @@ function ui_print_status_image(
|
|||||||
|
|
||||||
$imagepath .= '/'.$type;
|
$imagepath .= '/'.$type;
|
||||||
|
|
||||||
|
$title_extra_line = '';
|
||||||
|
|
||||||
|
if (!empty($module_last_status_change)) {
|
||||||
|
$title_extra_line = 'Time elapsed since last status change: '.date('h', $module_last_status_change).' '.__('hour').' '.date('i', $module_last_status_change).' '.__('min').' '.date('s', $module_last_status_change).' '.__('sec');
|
||||||
|
}
|
||||||
|
|
||||||
if ($image_with_css === true) {
|
if ($image_with_css === true) {
|
||||||
$shape_status = get_shape_status_set($type);
|
$shape_status = get_shape_status_set($type);
|
||||||
return ui_print_status_sets($type, $title, $return, $shape_status);
|
return ui_print_status_sets($type, $title, $return, $shape_status, $title_extra_line);
|
||||||
} else {
|
} else {
|
||||||
if ($options === false) {
|
if ($options === false) {
|
||||||
$options = [];
|
$options = [];
|
||||||
@ -2779,7 +2786,8 @@ function ui_print_status_sets(
|
|||||||
$status,
|
$status,
|
||||||
$title='',
|
$title='',
|
||||||
$return=false,
|
$return=false,
|
||||||
$options=false
|
$options=false,
|
||||||
|
$extra_line_title=''
|
||||||
) {
|
) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -2798,8 +2806,8 @@ function ui_print_status_sets(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($title != '') {
|
if ($title != '') {
|
||||||
$options['title'] = $title;
|
$options['title'] = empty($extra_line_title) ? $title : $title.'
'.$extra_line_title;
|
||||||
$options['data-title'] = $title;
|
$options['data-title'] = empty($extra_line_title) ? $title : $title.'<br>'.$extra_line_title;
|
||||||
$options['data-use_title_for_force_title'] = 1;
|
$options['data-use_title_for_force_title'] = 1;
|
||||||
if (isset($options['class'])) {
|
if (isset($options['class'])) {
|
||||||
$options['class'] .= ' forced_title';
|
$options['class'] .= ' forced_title';
|
||||||
|
@ -169,6 +169,7 @@ CREATE TABLE IF NOT EXISTS `tagente_estado` (
|
|||||||
`ff_critical` int(4) unsigned default '0',
|
`ff_critical` int(4) unsigned default '0',
|
||||||
`last_dynamic_update` bigint(20) NOT NULL default '0',
|
`last_dynamic_update` bigint(20) NOT NULL default '0',
|
||||||
`last_unknown_update` bigint(20) NOT NULL default '0',
|
`last_unknown_update` bigint(20) NOT NULL default '0',
|
||||||
|
`last_status_change` bigint(20) NOT NULL default '0',
|
||||||
PRIMARY KEY (`id_agente_estado`),
|
PRIMARY KEY (`id_agente_estado`),
|
||||||
KEY `status_index_1` (`id_agente_modulo`),
|
KEY `status_index_1` (`id_agente_modulo`),
|
||||||
KEY `idx_agente` (`id_agente`),
|
KEY `idx_agente` (`id_agente`),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user