WIP Cluster references updated
This commit is contained in:
parent
b0e8287c61
commit
e66f33fd37
|
@ -556,9 +556,18 @@ if ($agents !== false) {
|
|||
$agent['alias'] = $agent['nombre'];
|
||||
}
|
||||
|
||||
if ($agent['id_os'] == 100) {
|
||||
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
|
||||
echo '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$cluster['id'].'&step=1&update=1">'.$agent['alias'].'</a>';
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
if (enterprise_installed()) {
|
||||
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
|
||||
$url .= '/operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=update&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.$agent['alias'].'</a>';
|
||||
}
|
||||
} else {
|
||||
echo '<a alt ='.$agent['nombre']." href='index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=$main_tab&
|
||||
|
@ -594,10 +603,18 @@ if ($agents !== false) {
|
|||
|
||||
echo '</span><div class="left actions" style="visibility: hidden; clear: left">';
|
||||
if ($check_aw) {
|
||||
if ($agent['id_os'] == 100) {
|
||||
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
|
||||
echo '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$cluster['id'].'&step=1&update=1">'.__('Edit').'</a>';
|
||||
echo ' | ';
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
if (enterprise_installed()) {
|
||||
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
|
||||
$url .= '/operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=update&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.__('Edit').'</a>';
|
||||
}
|
||||
} else {
|
||||
echo '<a href="index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=main&
|
||||
|
@ -618,8 +635,18 @@ if ($agents !== false) {
|
|||
id_agente='.$agent['id_agente'].'">'.__('Alerts').'</a>';
|
||||
echo ' | ';
|
||||
|
||||
if ($agent['id_os'] == 100) {
|
||||
echo '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id='.$cluster['id'].'">'.__('View').'</a>';
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
if (enterprise_installed()) {
|
||||
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
|
||||
$url .= '/operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=view&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.__('View').'</a>';
|
||||
}
|
||||
} else {
|
||||
echo '<a href="index.php?sec=estado
|
||||
&sec2=operation/agentes/ver_agente
|
||||
|
|
|
@ -1537,14 +1537,15 @@ class NetworkMap
|
|||
/**
|
||||
* Returns target color to be used based on the status received.
|
||||
*
|
||||
* @param integer $status Source information.
|
||||
* @param integer $status Source information.
|
||||
* @param boolean $force_module It's a module.
|
||||
*
|
||||
* @return string HTML tag for color.
|
||||
*/
|
||||
public static function getColorByStatus($status)
|
||||
public static function getColorByStatus($status, ?bool $force_module=false)
|
||||
{
|
||||
include_once __DIR__.'/../functions_modules.php';
|
||||
return modules_get_color_status($status);
|
||||
return modules_get_color_status($status, $force_module);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1661,6 +1662,10 @@ class NetworkMap
|
|||
|
||||
case NODE_MODULE:
|
||||
$item['id_module'] = $node['source_data'];
|
||||
$item['color'] = self::getColorByStatus(
|
||||
$source_data['status'],
|
||||
true
|
||||
);
|
||||
break;
|
||||
|
||||
case NODE_PANDORA:
|
||||
|
@ -1687,7 +1692,8 @@ class NetworkMap
|
|||
$item['color'] = $source_data['color'];
|
||||
} else {
|
||||
$item['color'] = self::getColorByStatus(
|
||||
$node['status']
|
||||
$node['status'],
|
||||
(bool) $node['id_module']
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -667,13 +667,22 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
if ($user_access_node && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
|
||||
$go_to_agent = '<div style="text-align: right;">';
|
||||
|
||||
if ($agent['id_os'] != 100) {
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
if (enterprise_installed()) {
|
||||
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
|
||||
$url .= '/operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=update&id='.$cluster->id()
|
||||
);
|
||||
$go_to_agent .= '<a target="_blank" href="'.$url.'">';
|
||||
$go_to_agent .= html_print_submit_button(__('Edit cluster'), 'upd_button', false, 'class="sub config"', true);
|
||||
}
|
||||
} else {
|
||||
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">';
|
||||
$go_to_agent .= html_print_submit_button(__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
|
||||
} else {
|
||||
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$id_agente);
|
||||
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$cluster['id'].'&step=1&update=1='.$id_agente.'">';
|
||||
$go_to_agent .= html_print_submit_button(__('Edit cluster'), 'upd_button', false, 'class="sub config"', true);
|
||||
}
|
||||
|
||||
$go_to_agent .= '</a>';
|
||||
|
|
|
@ -88,17 +88,6 @@ class Agent extends Entity
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns current object as array.
|
||||
*
|
||||
* @return array Of fields.
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overrides Entity method.
|
||||
*
|
||||
|
|
|
@ -131,6 +131,17 @@ abstract class Entity
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns current object as array.
|
||||
*
|
||||
* @return array Of fields.
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves current object definition to database.
|
||||
*
|
||||
|
|
|
@ -791,8 +791,18 @@ foreach ($agents as $agent) {
|
|||
|
||||
$data[0] .= '<div class="agentleft_'.$agent['id_agente'].'" style="visibility: hidden; clear: left;">';
|
||||
|
||||
if ($agent['id_os'] == 100) {
|
||||
$data[0] .= '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id='.$cluster['id'].'">'.__('View').'</a>';
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
if (enterprise_installed()) {
|
||||
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
|
||||
$url .= '/operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=view&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.__('View').'</a>';
|
||||
}
|
||||
} else {
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'">'.__('View').'</a>';
|
||||
}
|
||||
|
@ -800,8 +810,18 @@ foreach ($agents as $agent) {
|
|||
if (check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
|
||||
$data[0] .= ' | ';
|
||||
|
||||
if ($agent['id_os'] == 100) {
|
||||
$data[0] .= '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$cluster['id'].'&step=1&update=1">'.__('Edit').'</a>';
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
if (enterprise_installed()) {
|
||||
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
|
||||
$url .= '/operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=update&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.__('Edit').'</a>';
|
||||
}
|
||||
} else {
|
||||
$data[0] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$agent['id_agente'].'">'.__('Edit').'</a>';
|
||||
}
|
||||
|
|
|
@ -148,8 +148,10 @@ $sort = get_parameter('sort', 'up');
|
|||
|
||||
|
||||
$modules_not_init = agents_monitor_notinit($id_agente);
|
||||
if (!empty($modules_not_init)) {
|
||||
$help_not_init = clippy_context_help('modules_not_init');
|
||||
if (empty($modules_not_init) === false) {
|
||||
$help_not_init = ui_print_warning_message(
|
||||
__('No initialized modules found.')
|
||||
);
|
||||
} else {
|
||||
$help_not_init = '';
|
||||
}
|
||||
|
|
|
@ -463,7 +463,7 @@ $autorefresh_list_out['operation/snmpconsole/snmp_view'] = 'SNMP console';
|
|||
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map';
|
||||
$autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console';
|
||||
$autorefresh_list_out['operation/events/events'] = 'Events';
|
||||
$autorefresh_list_out['enterprise/godmode/reporting/cluster_view'] = 'Cluster view';
|
||||
$autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view';
|
||||
if (enterprise_installed()) {
|
||||
$autorefresh_list_out['general/sap_view'] = 'SAP view';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue