9962-Omnishell in agent view
This commit is contained in:
parent
35aa64b281
commit
6d85b912e2
Binary file not shown.
After Width: | Height: | Size: 606 B |
|
@ -84,6 +84,27 @@ function html_debug_print($var, $file='', $oneline=false)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Console log.
|
||||
*/
|
||||
function jslog($var)
|
||||
{
|
||||
$more_info = '';
|
||||
if (is_string($var)) {
|
||||
$more_info = 'size: '.strlen($var);
|
||||
} else if (is_bool($var)) {
|
||||
$more_info = 'val: '.($var ? 'true' : 'false');
|
||||
} else if (is_null($var)) {
|
||||
$more_info = 'is null';
|
||||
} else if (is_array($var)) {
|
||||
$more_info = count($var);
|
||||
}
|
||||
|
||||
echo '<script>console.log("'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info.'");</script>'."\n";
|
||||
echo '<script>console.log('.json_encode($var).');</script>';
|
||||
}
|
||||
|
||||
|
||||
// Alias for "html_debug_print"
|
||||
function html_debug($var, $file='', $oneline=false)
|
||||
{
|
||||
|
|
|
@ -7084,3 +7084,21 @@ function ui_get_inventory_module_add_form(
|
|||
}
|
||||
|
||||
|
||||
function ui_print_status_div($status)
|
||||
{
|
||||
switch ((int) $status) {
|
||||
case 0:
|
||||
$return = '<div class="status_rounded_rectangles forced_title" style="display: inline-block; background: #82b92e;" title="OK" data-title="OK" data-use_title_for_force_title="1"> </div>';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$return = '<div class="status_rounded_rectangles forced_title" style="display: inline-block; background: #e63c52;" title="FAILED" data-title="FAILED" data-use_title_for_force_title="1"> </div>';
|
||||
break;
|
||||
|
||||
default:
|
||||
$return = '<div class="status_rounded_rectangles forced_title" style="display: inline-block; background: #fff;" title="UNDEFINED" data-title="UNDEFINED" data-use_title_for_force_title="1"> </div>';
|
||||
break;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
|
@ -37,6 +37,7 @@ require_once $config['homedir'].'/include/functions_groups.php';
|
|||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
enterprise_include_once('include/functions_omnishell.php');
|
||||
|
||||
ui_require_javascript_file('openlayers.pandora');
|
||||
ui_require_css_file('agent_view');
|
||||
|
@ -1485,6 +1486,17 @@ if ($policyTab == -1) {
|
|||
$policyTab = '';
|
||||
}
|
||||
|
||||
|
||||
// Omnishell.
|
||||
$tasks = count_tasks_agent($id_agente);
|
||||
|
||||
if ($tasks === true) {
|
||||
$omnishellTab = enterprise_hook('omnishell_tab');
|
||||
if ($omnishellTab == -1) {
|
||||
$omnishellTab = '';
|
||||
}
|
||||
}
|
||||
|
||||
// WUX Console.
|
||||
$modules_wux = enterprise_hook('get_wux_modules', [$id_agente]);
|
||||
if ($modules_wux) {
|
||||
|
@ -1747,6 +1759,7 @@ $onheader = [
|
|||
'ncm_view' => ($ncm_tab ?? null),
|
||||
'external_tools' => ($external_tools ?? null),
|
||||
'incident' => ($incidenttab ?? null),
|
||||
'omnishell' => ($omnishellTab ?? null),
|
||||
];
|
||||
|
||||
|
||||
|
@ -1871,6 +1884,10 @@ switch ($tab) {
|
|||
$tab_name = 'Policies';
|
||||
break;
|
||||
|
||||
case 'omnishell':
|
||||
$tab_name = 'Omnishell';
|
||||
break;
|
||||
|
||||
case 'ux_console_tab':
|
||||
$tab_name = 'UX Console';
|
||||
break;
|
||||
|
@ -2009,6 +2026,10 @@ switch ($tab) {
|
|||
enterprise_include('operation/agentes/policy_view.php');
|
||||
break;
|
||||
|
||||
case 'omnishell':
|
||||
enterprise_include('operation/agentes/omnishell_view.php');
|
||||
break;
|
||||
|
||||
case 'ux_console_tab':
|
||||
enterprise_include('operation/agentes/ux_console_view.php');
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue