Merge branch '2326-unificar-vistas-ux-y-wux-en-un-mismo-portal' into 'develop'

2326 unificar vistas ux y wux en un mismo portal

See merge request artica/pandorafms!1917
This commit is contained in:
vgilc 2018-10-30 16:20:26 +01:00
commit b1bf1d7b4b
2 changed files with 22 additions and 4 deletions

View File

@ -3968,8 +3968,14 @@ function ui_get_snapshot_link($params, $only_params = false) {
"id=" . $params['id_module'] .
"&label=" . rawurlencode(urlencode(io_safe_output($params['module_name']))).
"&id_node=" . $params['id_node'];
if ($params['timestamp'] != 0) $url .= "&timestamp=" . $parms['timestamp'];
if ($params['timestamp'] != 0) $url .= "&refr=" . $parms['interval'];
if ($params['timestamp'] != 0) {
$url .= "&timestamp=" . $params['timestamp'];
}
if ($params['interval'] != 0) {
$url .= "&refr=" . $params['interval'];
}
// Second parameter of js winopeng_var
$win_handle = dechex(crc32('snapshot_' . $params['id_module']));

View File

@ -50,11 +50,23 @@ if ($id_node > 0) {
}
}
$row_module = modules_get_agentmodule($id);
$row_state = db_get_row('tagente_estado', 'id_agente_modulo', $id);
// Retrieve data
$utimestamp = get_parameter("timestamp", '');
if($utimestamp == '') {
// Retrieve last data
$row_state = db_get_row('tagente_estado', 'id_agente_modulo', $id);
$last_timestamp = $row_state['timestamp'];
} else {
// Retrieve target data
$state = db_get_row('tagente_estado', 'id_agente_modulo', $id, array('id_agente'));
$row_state = db_get_row_filter('tagente_datos_string', array('id_agente_modulo' => $id, 'utimestamp' => $utimestamp));
$row_state['id_agente'] = $state['id_agente'];
$last_timestamp = date("Y-m-d H:i:s", $row_state['utimestamp']);
}
// Build the info
$label = get_parameter ("label", io_safe_output($row_module['module_name']));
$last_timestamp = get_parameter("timestamp", $row_state['timestamp']);
$last_data = io_safe_output($row_state["datos"]);
$refresh = (int) get_parameter ("refr", $row_state['current_interval']);