mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
2012-12-21 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php include/functions_events.php: Adapt details view of events to metaconsole links git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7320 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
60290d0db4
commit
f0ee97536a
@ -1,3 +1,9 @@
|
|||||||
|
2012-12-21 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* include/functions_ui.php
|
||||||
|
include/functions_events.php: Adapt details view of events
|
||||||
|
to metaconsole links
|
||||||
|
|
||||||
2012-12-21 Junichi Satoh <junichi@rworks.jp>
|
2012-12-21 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
* include/help/ja/help_module_interval.php: Translated into Japanese.
|
* include/help/ja/help_module_interval.php: Translated into Japanese.
|
||||||
|
@ -1564,6 +1564,17 @@ function events_page_details ($event, $server = "") {
|
|||||||
global $img_sev;
|
global $img_sev;
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
// If server is provided, get the hash parameters
|
||||||
|
if (!empty($server)) {
|
||||||
|
$hashdata = metaconsole_get_server_hashdata($server);
|
||||||
|
$hashstring = "&loginhash=auto&loginhash_data=" . $hashdata . "&loginhash_user=" . $config["id_user"];
|
||||||
|
$serverstring = $server['server_url'] . "/";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$hashstring = "";
|
||||||
|
$serverstring = "";
|
||||||
|
}
|
||||||
|
|
||||||
/////////
|
/////////
|
||||||
// Details
|
// Details
|
||||||
/////////
|
/////////
|
||||||
@ -1600,7 +1611,7 @@ function events_page_details ($event, $server = "") {
|
|||||||
if (!empty($agent)) {
|
if (!empty($agent)) {
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
|
||||||
$data[1] = ui_print_agent_name ($event["id_agente"], true);
|
$data[1] = ui_print_agent_name ($event["id_agente"], true, 'agent_medium', '', false, $serverstring, $hashstring);
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
@ -1645,7 +1656,7 @@ function events_page_details ($event, $server = "") {
|
|||||||
// Module name
|
// Module name
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
|
||||||
$data[1] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=data"><b>';
|
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=data'.$hashstring.'"><b>';
|
||||||
$data[1] .= $module['nombre'];
|
$data[1] .= $module['nombre'];
|
||||||
$data[1] .= '</b></a>';
|
$data[1] .= '</b></a>';
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
@ -1659,7 +1670,7 @@ function events_page_details ($event, $server = "") {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
|
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
|
||||||
$data[1] = '<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&modulegroup=' . $id_module_group . '">';
|
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&modulegroup=' . $id_module_group . $hashstring.'">';
|
||||||
$data[1] .= $module_group;
|
$data[1] .= $module_group;
|
||||||
$data[1] .= '</a>';
|
$data[1] .= '</a>';
|
||||||
}
|
}
|
||||||
@ -1670,15 +1681,9 @@ function events_page_details ($event, $server = "") {
|
|||||||
$graph_type = return_graphtype ($module["module_type"]);
|
$graph_type = return_graphtype ($module["module_type"]);
|
||||||
|
|
||||||
$win_handle=dechex(crc32($module["id_agente_modulo"].$module["module_name"]));
|
$win_handle=dechex(crc32($module["id_agente_modulo"].$module["module_name"]));
|
||||||
|
|
||||||
if (!empty($server)) {
|
$link ="winopeng('".$serverstring."operation/agentes/stat_win.php?type=".$graph_type."&period=86400&id=" . $module["id_agente_modulo"] . "&label=" . base64_encode($module["module_name"].$hashstring) . "&refresh=600','day_".$win_handle."')";
|
||||||
$hashdata = metaconsole_get_server_hashdata($server);
|
|
||||||
$link ="winopeng('" . $server['server_url'] . "/operation/agentes/stat_win.php?type=".$graph_type."&period=86400&loginhash=auto&loginhash_data=" . $hashdata . "&loginhash_user=" . $config["id_user"] . "&id=".$module["id_agente_modulo"]."&label=".base64_encode($module["module_name"])."&refresh=600','day_".$win_handle."')";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$link ="winopeng('operation/agentes/stat_win.php?type=".$graph_type."&period=86400&id=" . $module["id_agentmodule"] . "&label=" . base64_encode($module["module_name"]) . "&refresh=600','day_".$win_handle."')";
|
|
||||||
}
|
|
||||||
|
|
||||||
$data[1] = '<a href="javascript:'.$link.'">';
|
$data[1] = '<a href="javascript:'.$link.'">';
|
||||||
$data[1] .= html_print_image('images/chart_curve.png',true);
|
$data[1] .= html_print_image('images/chart_curve.png',true);
|
||||||
$data[1] .= '</a>';
|
$data[1] .= '</a>';
|
||||||
@ -1693,7 +1698,7 @@ function events_page_details ($event, $server = "") {
|
|||||||
if($event["id_alert_am"] != 0) {
|
if($event["id_alert_am"] != 0) {
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Source').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Source').'</div>';
|
||||||
$data[1] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=alert">';
|
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=alert'.$hashstring.'">';
|
||||||
$standby = db_get_value('standby', 'talert_template_modules', 'id', $event["id_alert_am"]);
|
$standby = db_get_value('standby', 'talert_template_modules', 'id', $event["id_alert_am"]);
|
||||||
if(!$standby) {
|
if(!$standby) {
|
||||||
$data[1] .= html_print_image ("images/bell.png", true,
|
$data[1] .= html_print_image ("images/bell.png", true,
|
||||||
|
@ -603,16 +603,18 @@ function ui_print_os_icon ($id_os, $name = true, $return = false, $apply_skin =
|
|||||||
* @param bool Whether to return the string or echo it too
|
* @param bool Whether to return the string or echo it too
|
||||||
* @param int Now uses styles to accomplish this
|
* @param int Now uses styles to accomplish this
|
||||||
* @param string Style of name in css.
|
* @param string Style of name in css.
|
||||||
|
* @param string server url to concatenate at the begin of the link
|
||||||
|
* @param string extra parameters to concatenate in the link
|
||||||
*
|
*
|
||||||
* @return string HTML with agent name and link
|
* @return string HTML with agent name and link
|
||||||
*/
|
*/
|
||||||
function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_medium', $style = '', $cutname = false) {
|
function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_medium', $style = '', $cutname = false, $server_url = '', $extra_params = '') {
|
||||||
$agent_name = (string) agents_get_name ($id_agent);
|
$agent_name = (string) agents_get_name ($id_agent);
|
||||||
$agent_name_full = $agent_name;
|
$agent_name_full = $agent_name;
|
||||||
if ($cutname) {
|
if ($cutname) {
|
||||||
$agent_name = ui_print_truncate_text($agent_name, $cutoff, true, true, true, '[…]', $style);
|
$agent_name = ui_print_truncate_text($agent_name, $cutoff, true, true, true, '[…]', $style);
|
||||||
}
|
}
|
||||||
$output = '<a style="' . $style . '" href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.'" title="'.$agent_name_full.'"><b><span style="'.$style.'">'.$agent_name.'</span></b></a>';
|
$output = '<a style="' . $style . '" href="'.$server_url.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.$extra_params.'" title="'.$agent_name_full.'"><b><span style="'.$style.'">'.$agent_name.'</span></b></a>';
|
||||||
|
|
||||||
//TODO: Add a pretty javascript (using jQuery) popup-box with agent details
|
//TODO: Add a pretty javascript (using jQuery) popup-box with agent details
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user