Merge branch 'ent-9662-second-round' into 'develop'

Ent 9662 second round

See merge request artica/pandorafms!5589
This commit is contained in:
daniel 2023-03-09 19:03:28 +00:00
commit 30a28c7432
40 changed files with 1210 additions and 573 deletions

View File

@ -195,140 +195,183 @@ function extension_api_checker()
);
}
ui_print_page_header(
__('API checker'),
// Header.
ui_print_standard_header(
__('Extensions'),
'images/extensions.png',
false,
'',
true,
''
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('API checker'),
],
]
);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$row = [];
$row[] = __('IP');
$row[] = html_print_input_text('ip', $ip, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('IP'),
html_print_input_text('ip', $ip, '', 50, 255, true)
);
$row[] = html_print_label_input_block(
__('%s Console URL', get_product_name()),
html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true)
);
$table->data[] = $row;
$row = [];
$row[] = __('%s Console URL', get_product_name());
$row[] = html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('API Token').ui_print_help_tip(__('Use API Token instead API Pass, User and Password.'), true),
html_print_input_text('token', $token, '', 50, 255, true)
);
$row[] = html_print_label_input_block(
__('API Pass'),
html_print_input_password('apipass', $apipass, '', 50, 255, true)
);
$table->data[] = $row;
$row = [];
$row[] = __('API Token').ui_print_help_tip(__('Use API Token instead API Pass, User and Password.'), true);
$row[] = html_print_input_text('token', $token, '', 50, 255, true);
$table->data[] = $row;
$row[] = html_print_label_input_block(
__('User'),
html_print_input_text('user', $user, '', 50, 255, true)
);
$row = [];
$row[] = __('API Pass');
$row[] = html_print_input_password('apipass', $apipass, '', 50, 255, true);
$table->data[] = $row;
$row = [];
$row[] = __('User');
$row[] = html_print_input_text('user', $user, '', 50, 255, true);
$table->data[] = $row;
$row = [];
$row[] = __('Password');
$row[] = html_print_input_password('password', $password, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('Password'),
html_print_input_password('password', $password, '', 50, 255, true)
);
$table->data[] = $row;
$table2 = new stdClass();
$table2->width = '100%';
$table2->class = 'databox filters filter-table-adv';
$table2->size[0] = '50%';
$table2->size[1] = '50%';
$table2->data = [];
$row = [];
$row[] = __('Action (get or set)');
$row[] = html_print_input_text('op', $op, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('Action (get or set)'),
html_print_input_text('op', $op, '', 50, 255, true)
);
$row[] = html_print_label_input_block(
__('Operation'),
html_print_input_text('op2', $op2, '', 50, 255, true)
);
$table2->data[] = $row;
$row = [];
$row[] = __('Operation');
$row[] = html_print_input_text('op2', $op2, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('ID'),
html_print_input_text('id', $id, '', 50, 255, true)
);
$row[] = html_print_label_input_block(
__('ID 2'),
html_print_input_text('id2', $id2, '', 50, 255, true)
);
$table2->data[] = $row;
$row = [];
$row[] = __('ID');
$row[] = html_print_input_text('id', $id, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('Return Type'),
html_print_input_text('return_type', $return_type, '', 50, 255, true)
);
$row[] = html_print_label_input_block(
__('Other'),
html_print_input_text('other', $other, '', 50, 255, true)
);
$table2->data[] = $row;
$row = [];
$row[] = __('ID 2');
$row[] = html_print_input_text('id2', $id2, '', 50, 255, true);
$table2->data[] = $row;
$row = [];
$row[] = __('Return Type');
$row[] = html_print_input_text('return_type', $return_type, '', 50, 255, true);
$table2->data[] = $row;
$row = [];
$row[] = __('Other');
$row[] = html_print_input_text('other', $other, '', 50, 255, true);
$table2->data[] = $row;
$row = [];
$row[] = __('Other Mode');
$row[] = html_print_input_text('other_mode', $other_mode, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('Other Mode'),
html_print_input_text('other_mode', $other_mode, '', 50, 255, true)
);
$table2->data[] = $row;
$table3 = new stdClass();
$table3->width = '100%';
$table3->class = 'databox filters filter-table-adv';
$table3->size[0] = '50%';
$table3->size[1] = '50%';
$table3->data = [];
$row = [];
$row[] = __('Raw URL');
$row[] = html_print_input_text('url', $url, '', 50, 2048, true);
$row[] = html_print_label_input_block(
__('Raw URL'),
html_print_input_text('url', $url, '', 50, 2048, true)
);
$table3->data[] = $row;
echo "<form method='post'>";
echo '<fieldset>';
echo "<form method='post' class='max_floating_element_size'>";
echo '<fieldset class="mrgn_btn_10px">';
echo '<legend>'.__('Credentials').'</legend>';
html_print_table($table);
echo '</fieldset>';
echo '<fieldset>';
echo '<fieldset class="mrgn_btn_10px">';
echo '<legend>'.__('Call parameters').' '.ui_print_help_tip(__('Action: get Operation: module_last_value id: 63'), true).'</legend>';
html_print_table($table2);
echo '</fieldset>';
echo "<div class='right'>";
echo '</div>';
echo '<fieldset>';
echo '<fieldset class="mrgn_btn_10px">';
echo '<legend>'.__('Custom URL').'</legend>';
html_print_table($table3);
echo '</fieldset>';
html_print_input_hidden('api_execute', 1);
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Call'),
'submit',
false,
[ 'icon' => 'next' ],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Call'),
'submit',
false,
[ 'icon' => 'next' ],
true
)
);
echo '</form>';
if ($api_execute === true) {
echo '<fieldset>';
echo '<fieldset class="mrgn_0px mrgn_btn_10px pdd_15px" style="max-width: 1122px;">';
echo '<legend>'.__('Result').'</legend>';
echo __('URL').'<br />';
html_print_input_password('url', $return_call_api['url'], '', 150, 255, false, true);
echo "&nbsp;<a id='show_icon' title='".__('Show URL')."' href='javascript: show_url();'>";
html_print_image('images/input_zoom.png');
echo '</a>';
echo html_print_label_input_block(
__('URL'),
html_print_input_password('url', $return_call_api['url'], '', 150, 255, true, true, false, 'mrgn_top_10px'),
['label_class' => 'font-title-font']
);
echo '<br />';
echo __('Result').'<br />';
html_print_textarea('result', 30, 20, $return_call_api['result'], 'readonly="readonly"');
echo html_print_label_input_block(
__('Result'),
html_print_textarea('result', 30, 20, $return_call_api['result'], 'readonly="readonly"', true, 'w100p mrgn_top_10px'),
['label_class' => 'font-title-font']
);
echo '</fieldset>';
}
?>

View File

@ -21,13 +21,23 @@ function extension_db_status()
$db_name = get_parameter('db_name', '');
$db_status_execute = (bool) get_parameter('db_status_execute', false);
ui_print_page_header(
ui_print_standard_header(
__('DB Schema check'),
'images/extensions.png',
false,
'db_status_tab',
true,
''
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Run test'),
],
]
);
if (!is_user_admin($config['id_user'])) {
@ -46,38 +56,86 @@ function extension_db_status()
__('At the moment the checks is for MySQL/MariaDB.')
);
echo "<form method='post'>";
echo "<form method='post' class='max_floating_element_size'>";
echo '<fieldset>';
echo '<legend>'.__('DB settings').'</legend>';
$table = new stdClass();
$table->data = [];
$row = [];
$row[] = __('DB User with privileges');
$row[] = html_print_input_text('db_user', $db_user, '', 50, 255, true);
$row[] = __('DB Password for this user');
$row[] = html_print_input_password('db_password', $db_password, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('DB User with privileges'),
html_print_input_text(
'db_user',
$db_user,
'',
50,
255,
true,
false,
false,
'',
'w100p mrgn_top_10px'
)
);
$row[] = html_print_label_input_block(
__('DB Password for this user'),
html_print_input_password(
'db_password',
$db_password,
'',
50,
255,
true,
false,
false,
'w100p mrgn_top_10px'
)
);
$table->data[] = $row;
$row = [];
$row[] = __('DB Hostname');
$row[] = html_print_input_text('db_host', $db_host, '', 50, 255, true);
$row[] = __('DB Name (temporal for testing)');
$row[] = html_print_input_text('db_name', $db_name, '', 50, 255, true);
$row[] = html_print_label_input_block(
__('DB Hostname'),
html_print_input_text(
'db_host',
$db_host,
'',
50,
255,
true,
false,
false,
'',
'w100p mrgn_top_10px'
)
);
$row[] = html_print_label_input_block(
__('DB Name (temporal for testing)'),
html_print_input_text(
'db_name',
$db_name,
'',
50,
255,
true,
false,
false,
'',
'w100p mrgn_top_10px'
)
);
$table->data[] = $row;
html_print_table($table);
echo '</fieldset>';
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute Test'),
'submit',
false,
[ 'icon' => 'cog' ],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Execute Test'),
'submit',
false,
[ 'icon' => 'cog' ],
true
)
);
html_print_input_hidden('db_status_execute', 1);

View File

@ -132,47 +132,37 @@ function dbmgr_extension_main()
echo $warning_message;
}
ui_print_warning_message(
__(
"This is an advanced extension to interface with %s database directly from WEB console
using native SQL sentences. Please note that <b>you can damage</b> your %s installation
if you don't know </b>exactly</b> what are you are doing,
this means that you can severily damage your setup using this extension.
This extension is intended to be used <b>only by experienced users</b>
with a depth knowledge of %s internals.",
get_product_name(),
get_product_name(),
get_product_name()
)
);
echo "<form method='post' action=''>";
$table = new stdClass();
$table->id = 'db_interface';
$table->class = 'databox';
$table->class = 'databox no_border filter-table-adv';
$table->width = '100%';
$table->data = [];
$table->head = [];
$table->colspan = [];
$table->rowstyle = [];
$table->style[0] = 'width: 30%;';
$table->style[1] = 'width: 70%;';
$table->colspan[0][0] = 2;
$table->colspan[1][0] = 2;
$table->rowspan[2][0] = 3;
$table->rowclass[0] = 'notify';
$table->rowclass[3] = 'pdd_5px';
$table->rowclass[3] = 'flex-content-right';
$table->rowclass[4] = 'flex-content-right';
$data[0][0] = __(
"This is an advanced extension to interface with %s database directly from WEB console
using native SQL sentences. Please note that <b>you can damage</b> your %s installation
if you don't know </b>exactly</b> what are you are doing,
this means that you can severily damage your setup using this extension.
This extension is intended to be used <b>only by experienced users</b>
with a depth knowledge of %s internals.",
get_product_name(),
get_product_name(),
get_product_name()
);
$data[1][0] = "Some samples of usage: <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
$data[2][0] = html_print_textarea(
'sql',
5,
50,
html_entity_decode($sql, ENT_QUOTES),
'',
true
$data[0][0] = "<b>Some samples of usage:</b> <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
$data[0][0] = html_print_label_input_block(
__('Some samples of usage:'),
"<blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>"
);
if (is_metaconsole() === true) {
@ -191,35 +181,57 @@ function dbmgr_extension_main()
$servers = [];
}
$data[3][2] = html_print_input(
[
'name' => 'node_id',
'type' => 'select',
'fields' => $servers,
'selected' => $node_id,
'nothing' => __('This metaconsole'),
'nothing_value' => -1,
'return' => true,
'label' => _('Select query target'),
]
$data[0][1] = html_print_label_input_block(
__('Select query target'),
html_print_select(
$servers,
'node_id',
$node_id,
'',
__('This metaconsole'),
-1,
true,
false,
false,
'w40p',
false,
'width: 40%;'
)
);
}
$data[4][2] = html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute SQL'),
'',
false,
[ 'icon' => 'cog' ],
true
),
]
$data[1][0] = html_print_textarea(
'sql',
3,
50,
html_entity_decode($sql, ENT_QUOTES),
'placeholder="'.__('Type your query here...').'"',
true,
'w100p'
);
$execute_button = html_print_submit_button(
__('Execute SQL'),
'',
false,
[ 'icon' => 'cog' ],
true
);
$table->data = $data;
html_print_table($table);
// html_print_table($table);
html_print_action_buttons($execute_button);
ui_toggle(
html_print_table($table, true),
'<span class="subsection_header_title">'.__('SQL query').'</span>',
__('SQL query'),
'query',
false,
false,
'',
'white-box-content no_border',
'box-flat white_table_graph fixed_filter_bar'
);
echo '</form>';
// Processing SQL Code.
@ -227,10 +239,6 @@ function dbmgr_extension_main()
return;
}
echo '<br />';
echo '<hr />';
echo '<br />';
try {
if (\is_metaconsole() === true && $node_id !== -1) {
$node = new Node($node_id);

View File

@ -24,7 +24,6 @@ table.dbmanager th {
}
textarea {
min-height: 50px;
height: 50px;
width: 95%;
width: 100% !important;
max-width: 100% !important;
}

View File

@ -25,13 +25,28 @@ function extension_uploader_extensions()
return;
}
ui_print_page_header(
__('Uploader extension'),
// Header.
ui_print_standard_header(
__('Extensions'),
'images/extensions.png',
false,
'',
true,
''
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Uploader extension'),
],
]
);
$upload = (bool) get_parameter('upload', 0);
@ -77,20 +92,52 @@ function extension_uploader_extensions()
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->size[0] = '20%';
$table->size[1] = '20%';
$table->size[2] = '60%';
$table->data = [];
$table->data[0][0] = __('Upload extension');
$table->data[0][1] = html_print_input_file('extension', true).ui_print_help_tip(__('Upload the extension as a zip file.'), true);
$table->data[0][0] = html_print_label_input_block(
__('Upload extension').ui_print_help_tip(__('Upload the extension as a zip file.'), true),
html_print_input_file(
'extension',
true,
[
'required' => true,
'accept' => '.zip',
]
)
);
if (enterprise_installed()) {
$table->data[0][2] = __('Upload enterprise extension').'&nbsp;'.html_print_checkbox('upload_enterprise', 1, false, true);
$table->data[0][1] = html_print_label_input_block(
__('Upload enterprise extension'),
html_print_checkbox(
'upload_enterprise',
1,
false,
true
)
);
} else {
$table->data[0][1] = '';
}
$table->data[0][2] = '';
echo "<form method='post' enctype='multipart/form-data'>";
html_print_table($table);
echo "<div class='right' style='width: ".$table->width."'>";
html_print_input_hidden('upload', 1);
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"');
echo '</div>';
html_print_action_buttons(
html_print_submit_button(
__('Upload'),
'submit',
false,
['icon' => 'wand'],
true
)
);
echo '</form>';
}

View File

@ -126,8 +126,30 @@ function pandora_files_repo_godmode()
'godmode' => $godmode,
'operation' => $operation,
];
// Header.
ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader);
ui_print_standard_header(
__('Extensions'),
'images/extensions.png',
false,
'',
true,
$onheader,
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Files repository manager'),
],
]
);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';

View File

@ -32,17 +32,15 @@ if (isset($file_id) && $file_id > 0) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'text-align: center;';
$table->colspan = [];
$table->class = 'databox filters filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
// GROUPS
// GROUPS.
$groups = groups_get_all();
// Add the All group to the beginning to be always the first
// Use this instead array_unshift to keep the array keys
// Add the All group to the beginning to be always the first.
// Use this instead array_unshift to keep the array keys.
$groups = ([0 => __('All')] + $groups);
$groups_selected = [];
foreach ($groups as $id => $name) {
@ -52,66 +50,110 @@ foreach ($groups as $id => $name) {
}
$row = [];
$row[0] = __('Groups');
$row[1] = '<div class="w290px">'.html_print_select_groups(
// Id_user.
false,
// Privilege.
'AR',
// ReturnAllGroup.
true,
// Name.
'groups[]',
// Selected.
$groups_selected,
// Script.
'',
// Nothing.
'',
// Nothing_value.
0,
// Return.
true,
// Multiple.
true
).'</div>';
$table->data[] = $row;
$table->colspan[][1] = 3;
$row[0] = html_print_label_input_block(
__('Groups'),
html_print_select_groups(
// Id_user.
false,
// Privilege.
'AR',
// ReturnAllGroup.
true,
// Name.
'groups[]',
// Selected.
$groups_selected,
// Script.
'',
// Nothing.
'',
// Nothing_value.
0,
// Return.
true,
// Multiple.
true
)
);
// DESCRIPTION
$row = [];
$row[0] = __('Description');
$row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true);
$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'class="file_repo_description"', true);
// DESCRIPTION.
$row[1] = html_print_label_input_block(
__('Description').ui_print_help_tip(__('Only 200 characters are permitted'), true),
html_print_textarea(
'description',
4,
20,
$file['description'],
'class="file_repo_description" style="min-height: 60px; max-height: 60px;"',
true
)
);
$table->data[] = $row;
$table->colspan[][1] = 3;
// FILE and SUBMIT BUTTON
// FILE and SUBMIT BUTTON.
$row = [];
// Public checkbox
// Public checkbox.
$checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true);
$style = 'class="inline padding-2-10"';
$row[0] = __('File');
if ($file_id > 0) {
$row[1] = $file['name'];
$row[2] = "<div $style>".__('Public link')."&nbsp;$checkbox</div>";
$row[3] = html_print_submit_button(__('Update'), 'submit', false, 'class="sub upd"', true);
$row[3] .= html_print_input_hidden('update_file', 1, true);
$row[3] .= html_print_input_hidden('file_id', $file_id, true);
$submit_button = html_print_submit_button(
__('Update'),
'submit',
false,
['icon' => 'wand'],
true
);
$row[0] = html_print_label_input_block(
__('File'),
$file['name']
);
$row[1] = html_print_label_input_block(
__('Public link'),
$checkbox.html_print_input_hidden(
'file_id',
$file_id,
true
)
);
} else {
$row[1] = html_print_input_file('upfile', true);
$row[2] = "<div $style>".__('Public link')."&nbsp;$checkbox</div>";
$row[3] = html_print_submit_button(__('Add'), 'submit', false, 'class="sub add"', true);
$row[3] .= html_print_input_hidden('add_file', 1, true);
$submit_button = html_print_submit_button(
__('Add'),
'submit',
false,
['icon' => 'wand'],
true
);
$row[0] = html_print_label_input_block(
__('File'),
html_print_input_file(
'upfile',
true
)
);
$row[1] = html_print_label_input_block(
__('Public link'),
$checkbox.html_print_input_hidden(
'add_file',
1,
true
)
);
}
$table->data[] = $row;
$table->colspan[][1] = 1;
$url = ui_get_full_url('index.php?sec=godmode/extensions&sec2=extensions/files_repo');
echo "<form method='post' action='$url' enctype='multipart/form-data'>";
html_print_table($table);
html_print_action_buttons($submit_button);
echo '</form>';
?>

View File

@ -11,11 +11,12 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
function view_logfile($file_name)
function view_logfile($file_name, $toggle=false)
{
global $config;
$memory_limit = ini_get('memory_limit');
$code = '';
if (strstr($memory_limit, 'M') !== false) {
$memory_limit = str_replace('M', '', $memory_limit);
@ -31,21 +32,37 @@ function view_logfile($file_name)
$file_size = filesize($file_name);
if ($memory_limit < $file_size) {
echo "<h2>$file_name (".__('File is too large than PHP memory allocated in the system.').')</h2>';
echo '<h2>'.__('The preview file is imposible.').'</h2>';
$code .= '<pre><h2>'.$file_name.' ('.__('File is too large than PHP memory allocated in the system.').')</h2>';
$code .= '<h2>'.__('The preview file is imposible.').'</h2>';
} else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents($file_name, false, null, ($file_size - ($config['max_log_size'] * 1000)));
echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
echo "<textarea class='pandora_logs' name='$file_name'>";
echo '... ';
echo $data;
echo '</textarea><br><br>';
$code .= "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
$code .= "<textarea class='pandora_logs' name='$file_name'>";
$code .= '... ';
$code .= $data;
$code .= '</textarea><br><br>';
} else {
$data = file_get_contents($file_name);
echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
echo "<textarea class='pandora_logs' name='$file_name'>";
echo $data;
echo '</textarea><br><br>';
$code .= "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
$code .= "<textarea class='pandora_logs' name='$file_name'>";
$code .= $data;
$code .= '</textarea><br><br></pre>';
}
if ($toggle === true) {
ui_toggle(
$code,
'<span class="subsection_header_title">'.$file_name.'</span>',
$file_name,
'a',
false,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
} else {
echo $code;
}
}
}
@ -64,21 +81,45 @@ function pandoralogs_extension_main()
return;
}
ui_print_page_header(__('System logfile viewer'), 'images/extensions.png', false, '', true, '');
// Header.
ui_print_standard_header(
__('Extensions'),
'images/extensions.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('System logfile viewer'),
],
]
);
echo '<p>'.__('Use this tool to view your %s logfiles directly on the console', get_product_name()).'</p>';
echo '<p>'.__('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), '.($config['max_log_size'] * 1000).'B at the moment').'</p>';
ui_print_info_message(
__('Use this tool to view your %s logfiles directly on the console', get_product_name()).'<br>
'.__('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), '.($config['max_log_size'] * 1000).'B at the moment')
);
$logs_directory = (!empty($config['server_log_dir'])) ? io_safe_output($config['server_log_dir']) : '/var/log/pandora';
// Do not attempt to show console log if disabled.
if ($config['console_log_enabled']) {
view_logfile($config['homedir'].'/log/console.log');
view_logfile($config['homedir'].'/log/console.log', true);
}
view_logfile($logs_directory.'/pandora_server.log');
view_logfile($logs_directory.'/pandora_server.error');
view_logfile($logs_directory.'/pandora_server.log', true);
view_logfile($logs_directory.'/pandora_server.error', true);
}

View File

@ -98,6 +98,7 @@ echo '</div>';
?>
<script type="text/javascript">
$(document).ready(function() {
menuActionButtonResizing();
const menuTypeClass = '<?php echo $menuTypeClass; ?>';
if (menuTypeClass === 'classic' && menuTypeClass !== localStorage.getItem('menuType')) {
localStorage.setItem('menuType', 'classic');

View File

@ -462,11 +462,11 @@ if ($id_agente) {
// Inventory.
$inventorytab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
'images/page_white_text.png',
'images/hardware-software-component@svg.svg',
true,
[
'title' => __('Inventory'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
@ -476,11 +476,6 @@ if ($id_agente) {
$inventorytab['active'] = false;
}
$inventorytab = enterprise_hook('inventory_tab');
if ($inventorytab === ENTERPRISE_NOT_HOOK) {
$inventorytab = '';
}
$has_remote_conf = enterprise_hook(
'config_agents_has_remote_configuration',
[$id_agente]

View File

@ -1070,13 +1070,57 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
);
echo '</form>';
}
$modalCreateModule = '<form name="create_module_form" method="post">';
$input_type = html_print_input_hidden('edit_module', 1, true);
$input_type .= html_print_select(
policies_type_modules_availables($sec2),
'moduletype',
'',
'',
'',
'',
true,
false,
false,
'',
false,
'max-width:300px;'
);
$modalCreateModule .= $input_type;
$modalCreateModule .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Create'),
'create_module',
false,
[
'icon' => 'next',
'mode' => 'mini secondary',
],
true
),
],
true
);
$modalCreateModule .= '</form>';
html_print_div(
[
'id' => 'modal',
'style' => 'display: none',
'content' => $modalCreateModule,
]
);
?>
<script type="text/javascript">
function create_module_dialog(){
$('#modal')
.dialog({
console.log('Entra');
$('#modal').dialog({
title: '<?php echo __('Create Module'); ?>',
resizable: true,
draggable: true,

View File

@ -243,11 +243,7 @@ $submitButtons .= html_print_submit_button(
);
html_print_action_buttons(
$submitButtons,
[
'type' => 'form_action',
'id' => 'list-events-filters',
]
$submitButtons
);
?>

View File

@ -24,8 +24,29 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
exit;
}
// Header
ui_print_page_header(__('Extensions').' &raquo; '.__('Defined extensions'), 'images/extensions.png', false, '', true, '');
// Header.
ui_print_standard_header(
__('Extensions'),
'images/extensions.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Defined extensions'),
],
]
);
if (count($config['extensions']) == 0) {
$extensions = extensions_get_extension_info();
@ -132,7 +153,7 @@ if ($disabled != '') {
$extensions = extensions_get_extension_info();
$table = new StdClass;
$table->width = '98%';
$table->width = '100%';
$table->head = [];
$table->head[] = __('File');
@ -146,7 +167,7 @@ $table->head[] = __('Login Function');
$table->head[] = __('Agent operation tab');
$table->head[] = __('Agent godmode tab');
$table->head[] = __('Operation');
$table->width = '100%';
$table->class = 'info_table';
$table->align = [];
@ -254,9 +275,39 @@ foreach ($extensions as $file => $extension) {
if ($file != 'update_manager.php') {
$table->cellclass[][10] = 'table_action_buttons';
if (!$extension['enabled']) {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true, ['class' => 'filter_none']).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true, ['class' => 'filter_none']).'</a>';
$data[] = html_print_menu_button(
[
'href' => 'index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file,
'image' => 'images/cross.disabled.png',
'title' => __('Delete'),
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
],
true
).html_print_menu_button(
[
'href' => 'index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file,
'image' => 'images/lightbulb_off.png',
'title' => __('Delete'),
],
true
);
} else {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>'.' <a title="'.__('Disable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file.'" class="mn">'.html_print_image('images/lightbulb.png', true).'</a>';
$data[] = html_print_menu_button(
[
'href' => 'index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file,
'image' => 'images/cross.png',
'title' => __('Delete'),
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
],
true
).html_print_menu_button(
[
'href' => 'index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file,
'image' => 'images/lightbulb.png',
'title' => __('Delete'),
],
true
);
}
} else {
$data[] = '';

View File

@ -43,7 +43,7 @@ if (is_metaconsole() === true) {
ui_print_standard_header(
__('Inventory modules'),
'images/page_white_text.png',
'images/hardware-software-component@svg.svg',
false,
'',
true,
@ -293,6 +293,7 @@ $table->head[3] = __('Interpreter');
if ($management_allowed === true) {
$table->head[4] = __('Action').html_print_checkbox('all_delete', 0, false, true, false);
$table->size[4] = '80px';
}
$result = inventory_get_modules_list($offset);
@ -414,30 +415,14 @@ if (is_metaconsole() === true) {
?>
<script type="text/javascript">
$( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');
}
else{
$(this).parent().parent().addClass('checkselected');
}
});
$('[id^=checkbox-all_delete]').change(function() {
if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
$(".check_delete").prop("checked", true);
if ($("input[name=all_delete]").prop("checked")) {
$(".custom_checkbox_input").prop("checked", true);
}
else {
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
$(".check_delete").prop("checked", false);
$(".custom_checkbox_input").prop("checked", false);
}
});
});
</script>

View File

@ -2639,7 +2639,8 @@ $class = 'databox filters';
'render_definition',
3,
25,
$render_definition
$render_definition,
'style=width:100%'
);
?>
</td>

View File

@ -80,7 +80,7 @@ if (empty($directory) === true) {
$real_directory = realpath($config['homedir'].'/'.$directory);
echo '<h4>'.__('Index of %s', io_safe_input($directory)).'</h4>';
echo '<h4 class="mrgn_0px">'.__('Index of %s', io_safe_input($directory)).'</h4>';
$upload_file = (bool) get_parameter('upload_file');
$create_text_file = (bool) get_parameter('create_text_file');

View File

@ -170,46 +170,118 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
$table->id = 'news';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->head = [];
$table->data = [];
$table->style[0] = 'font-weight: bold;';
$table->style[1] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold;';
$table->style[3] = 'font-weight: bold;';
$table->style[4] = 'font-weight: bold;';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->colspan[2][0] = 2;
$table->rowclass[2] = 'w100p';
$data = [];
$data[0] = __('Subject').'<br>';
$data[0] .= '<input type="text" class="text_input" name="subject" size="35" value="'.$subject.'" >';
$data[0] = html_print_label_input_block(
__('Subject'),
html_print_input_text(
'subject',
$subject,
'',
35,
255,
true
)
);
$data[1] = __('Group').'<br>';
$data[1] .= '<div class="w250px">';
$data[1] .= html_print_select_groups($config['id_user'], 'ER', users_can_manage_group_all(), 'id_group', $id_group, '', '', 0, true, false, false, '');
$data[1] .= '</div>';
$data[1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
$config['id_user'],
'ER',
users_can_manage_group_all(),
'id_group',
$id_group,
'',
'',
0,
true,
false,
false,
'w100p',
false,
'width: 100%;'
)
);
$table->data[] = $data;
$data[2] = __('Modal screen').'<br>';
$data[2] .= html_print_checkbox_extended('modal', 1, $modal, false, '', 'class="mrgn_top_5 mrg_btt_7"', true);
$data = [];
$data[0] = html_print_label_input_block(
__('Modal screen'),
html_print_checkbox_extended(
'modal',
1,
$modal,
false,
'',
'class="w100p"',
true
)
);
$data[3] = __('Expire').'<br>';
$data[3] .= html_print_checkbox_extended('expire', 1, $expire, false, '', 'class="mrgn_top_5 mrg_btt_7"', true);
$data[4] = __('Expiration').'<br>';
$data[4] .= html_print_input_text('expire_date', $expire_date, '', 12, 10, true).' ';
$data[4] .= html_print_input_text('expire_time', $expire_time, '', 10, 7, true).' ';
$data[1] = '<div style="display: inline-flex; flex-direction: row;">'.html_print_label_input_block(
__('Expire'),
html_print_checkbox_extended(
'expire',
1,
$expire,
false,
'',
'class="w100p"',
true
),
['div_class' => 'display-grid']
);
$data[1] .= html_print_label_input_block(
__('Expiration'),
'<div>'.html_print_input_text(
'expire_date',
$expire_date,
'',
12,
10,
true
).' '.html_print_input_text(
'expire_time',
$expire_time,
'',
10,
7,
true
).'</div>',
[
'div_class' => 'display-grid mrgn_lft_20px',
'div_id' => 'news-0-4',
]
).'</div>';
$table->rowclass[] = '';
$table->data[] = $data;
$data = [];
$data[0] = __('Text').'<br>';
$data[0] .= html_print_textarea('text', 25, 15, $text, '', true);
$table->rowclass[] = '';
$table->colspan[1][0] = 5;
$data[0] = html_print_label_input_block(
__('Text'),
html_print_textarea(
'text',
25,
100,
$text,
'',
true,
'w100p'
)
);
$table->data[] = $data;
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news" class="max_floating_element_size">';
if ($creation_mode == 1) {
echo "<input type='hidden' name='create' value='1'>";
} else {
@ -228,11 +300,25 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
echo "<table width='".$table->width."'>";
echo "<tr><td align='right'>";
if (isset($_GET['form_add'])) {
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>";
$submit_button = html_print_submit_button(
__('Create'),
'crtbutton',
false,
['icon' => 'wand'],
true
);
} else {
echo "<input name='crtbutton' type='submit' class='sub upd' value='".__('Update')."'>";
$submit_button = html_print_submit_button(
__('Update'),
'crtbutton',
false,
['icon' => 'wand'],
true
);
}
html_print_action_buttons($submit_button);
echo '</form></td></tr></table>';
} else {
$rows = db_get_all_rows_in_table('tnews', 'timestamp');
@ -293,11 +379,17 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
echo '</table>';
}
echo "<table width='100%'>";
echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/news&form_add=1'>";
echo "<input type='submit' class='sub next' name='form_add' value='".__('Add')."'>";
echo '</form></table>';
html_print_action_buttons(
html_print_submit_button(
__('Add'),
'form_add',
false,
['icon' => 'wand'],
true
)
);
echo '</form>';
}
/*

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 14 / info@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-14-/-info" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Icons/Elements/Help-mini" fill="#e63c52">
<path d="M7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 Z M7,6 C6.44771525,6 6,6.44771525 6,7 L6,7 L6,10 C6,10.5522847 6.44771525,11 7,11 C7.55228475,11 8,10.5522847 8,10 L8,10 L8,7 C8,6.44771525 7.55228475,6 7,6 Z M7,3 C6.44771525,3 6,3.44771525 6,4 C6,4.55228475 6.44771525,5 7,5 C7.55228475,5 8,4.55228475 8,4 C8,3.44771525 7.55228475,3 7,3 Z" id="Elements-/-Help-mini"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 959 B

View File

@ -791,6 +791,10 @@ if ($save_filter_modal) {
$table->rowid[1] = 'save_filter_row1';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->rowclass[1] = 'flex';
$table->rowclass[2] = 'flex';
$table->rowclass[3] = 'flex';
$table->rowclass[4] = 'flex';
$data[0] = '<b>'.__('Filter name').'</b>'.$jump;
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
if (is_metaconsole()) {

View File

@ -47,6 +47,7 @@ if (json_last_error() === JSON_ERROR_NONE) {
$data = $data_decoded['data'];
$session_id = $data_decoded['session_id'];
$type_graph_pdf = $data_decoded['type_graph_pdf'];
$id_user = $data_decoded['id_user'];
$data_combined = [];
if (isset($data_decoded['data_combined']) === true) {
@ -62,6 +63,10 @@ if (json_last_error() === JSON_ERROR_NONE) {
// Initialize session.
global $config;
// Care whit this!!! check_login not working if you remove this.
$config['id_user'] = $id_user;
$_SESSION['id_usuario'] = $id_user;
// Try to initialize session using existing php session id.
$user = new PandoraFMS\User(['phpsessionid' => $session_id]);
if (check_login(false) === false) {
@ -82,6 +87,7 @@ if (check_login(false) === false) {
</head>
<body>
<h1>Access is not granted</h1>
<div id="container-chart-generator-item" style="display:none; margin:0px;">
</body>
</html>

View File

@ -239,38 +239,53 @@ class EventSound extends HTML
ui_require_css_file('discovery');
if ($tab === 'add') {
echo '<form method="post" enctype="multipart/form-data" action="index.php?sec=eventos&sec2=godmode/events/configuration_sounds&tab=add&action=create">';
echo '<form method="post" enctype="multipart/form-data" action="index.php?sec=eventos&sec2=godmode/events/configuration_sounds&tab=add&action=create"
class="max_floating_element_size">';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->data = [];
$table->data[0][0] = __('Name:');
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[0][1] = html_print_input_text(
'name',
'',
'',
80,
100,
true,
false,
true
$table->data[0][0] = html_print_label_input_block(
__('Name:'),
html_print_input_text(
'name',
'',
'',
80,
100,
true,
false,
true
)
);
$table->data[1][0] = __('WAV Sound');
$table->data[1][1] = html_print_input_file('file', true, ['required' => true]);
$table->data[0][1] = html_print_label_input_block(
__('WAV Sound'),
html_print_input_file(
'file',
true,
[
'required' => true,
'accept' => 'audio/*',
]
)
);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(
__('Create'),
'save_sound',
false,
'class="sub wand"'
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'save_sound',
false,
['icon' => 'wand'],
true
)
);
echo '</div>';
echo '</form>';
// Load own javascript file.
@ -305,7 +320,7 @@ class EventSound extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,
@ -321,7 +336,7 @@ class EventSound extends HTML
[
'label' => __('Free search').ui_print_help_tip(__('Search filter by Name or Sound fields content'), true),
'type' => 'text',
'class' => 'w200px',
'class' => 'w70p',
'id' => 'filter_text',
'name' => 'filter_text',
],
@ -333,12 +348,13 @@ class EventSound extends HTML
'0' => __('No'),
'1' => __('Yes'),
],
'class' => 'w100px',
'class' => 'w100p',
'id' => 'active',
'name' => 'active',
],
],
],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
]
);
} catch (Exception $e) {
@ -350,6 +366,7 @@ class EventSound extends HTML
close_meta_frame();
}
html_print_action_buttons('');
// Load own javascript file.
echo $this->loadJS();
}

View File

@ -4264,12 +4264,14 @@ function generator_chart_to_pdf(
'type_graph_pdf' => $type_graph_pdf,
'data_module_list' => $module_list,
'data_combined' => $params_combined,
'id_user' => $config['id_user'],
];
} else {
$data = [
'data' => $params,
'session_id' => $session_id,
'type_graph_pdf' => $type_graph_pdf,
'id_user' => $config['id_user'],
];
}

View File

@ -495,7 +495,8 @@ function html_print_select_groups(
$size=false,
$simple_multiple_options=false,
$required=false,
$inverse=''
$inverse='',
$form=''
) {
$output = '';
@ -609,7 +610,12 @@ function html_print_select_groups(
'',
false,
$simple_multiple_options,
$required
$required,
false,
true,
false,
false,
$form
);
if ($required !== false) {
@ -761,7 +767,8 @@ function html_print_select(
$truncate_size=false,
$select2_enable=true,
$select2_multiple_enable=false,
$select2_multiple_enable_all=false
$select2_multiple_enable_all=false,
$form=''
) {
$output = "\n";
@ -802,6 +809,10 @@ function html_print_select(
$attributes .= ' class="'.$class.'"';
}
if (!empty($form)) {
$attributes .= ' form="'.$form.'"';
}
if (!empty($disabled)) {
$attributes .= ' disabled="disabled"';
}
@ -4773,6 +4784,10 @@ function html_print_input_file($name, $return=false, $options=false)
if (isset($options['style']) === true) {
$output .= ' style="'.$options['style'].'"';
}
if (isset($options['accept']) === true) {
$output .= ' accept="'.$options['accept'].'"';
}
}
// Close input.
@ -5231,9 +5246,13 @@ function html_print_switch($attributes=[])
*
* @return string With HTML code.
*/
function html_print_link_with_params($text, $params=[], $type='text', $style='')
function html_print_link_with_params($text, $params=[], $type='text', $style='', $formStyle='')
{
$html = '<form method=post>';
if (empty($formStyle) === false) {
$formStyle = ' style="'.$formStyle.'"';
}
$html = '<form method="POST"'.$formStyle.'>';
switch ($type) {
case 'image':
$html .= html_print_input_image($text, $text, $text, $style, true);
@ -5241,7 +5260,7 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
case 'text':
default:
if (!empty($style)) {
if (empty($style) === false) {
$style = ' style="'.$style.'"';
}
@ -5249,7 +5268,10 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
$text,
$text,
false,
'class="button-as-link"'.$style,
[
'mode' => 'link',
'style' => $style,
],
true
);
break;
@ -5583,7 +5605,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
);
case 'submit':
$width = (isset($data['width']) === true) ? 'width: '.$data['width'] : 'width: 100%';
$width = (isset($data['width']) === true) ? 'width: '.$data['width'] : '';
$output .= '<'.$wrapper.' class="action-buttons" style="'.$width.'">'.html_print_submit_button(
((isset($data['label']) === true) ? $data['label'] : 'OK'),
((isset($data['name']) === true) ? $data['name'] : ''),

View File

@ -2618,6 +2618,10 @@ function reporting_agents_inventory($report, $content)
$es_agents_inventory_display_options = [];
}
if ($es_agent_custom_fields === '') {
$es_agent_custom_fields = [];
}
$custom_field_sql = '';
$search_sql = '';
$sql_order_by = 'ORDER BY tagente.id_agente ASC';

View File

@ -532,6 +532,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
if (isset($item['data']) === true) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->align = [];
$table1->align[0] = 'left';
@ -567,6 +568,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
// Second_table for time globals.
$table2 = new stdClass();
$table2->width = '99%';
$table2->class = 'info_table';
$table2->align = [];
$table2->align[0] = 'left';
@ -600,6 +602,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
// Third_table for time globals.
$table3 = new stdClass();
$table3->width = '99%';
$table3->class = 'info_table';
$table3->align = [];
$table3->align[0] = 'left';
@ -926,6 +929,7 @@ function reporting_html_top_n($table, $item, $pdf=0)
} else {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->align = [];
$table1->align[0] = 'left';
@ -1034,6 +1038,7 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
if ($item['total_events']) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->align = [];
$table1->align[0] = 'center';
@ -1305,6 +1310,7 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
foreach ($item['data'] as $item) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->data = [];
$table1->head = [];
$table1->align = [];
@ -1531,7 +1537,7 @@ function reporting_html_agents_inventory($table, $item, $pdf=0)
$table1->width = '100%';
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
$table1->class = 'databox data';
$table1->class = 'info_table';
$table1->cellpadding = 1;
$table1->cellspacing = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;';
@ -1749,7 +1755,7 @@ function reporting_html_modules_inventory($table, $item, $pdf=0)
$table1->width = '100%';
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
$table1->class = 'databox data';
$table1->class = 'info_table';
$table1->cellpadding = 1;
$table1->cellspacing = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;';
@ -1919,6 +1925,7 @@ function reporting_html_inventory_changes($table, $item, $pdf=0)
foreach ($item['data'] as $module_item) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->cellstyle = [];
$table1->cellstyle[0][0] = 'background: #373737; color: #FFF;';
@ -2013,6 +2020,7 @@ function reporting_html_inventory($table, $item, $pdf=0)
foreach ($type_modules as $key_type_module => $type_module) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->data = [];
$table1->head = [];
$table1->cellstyle = [];
@ -2103,7 +2111,7 @@ function reporting_html_agent_module($table, $item)
if (!empty($item['failed'])) {
$table->data['agent_module']['cell'] = $item['failed'];
} else {
$table_data = '<table class="border_table" cellpadding="0" cellspacing="0" cellspacing="0">';
$table_data = '<table class="info_table" cellpadding="0" cellspacing="0" cellspacing="0">';
$table_data .= '<tr class="border_th">';
$table_data .= '<th class="bg_th">'.__('Agents').' / '.__('Modules').'</th>';
@ -2452,6 +2460,7 @@ function reporting_html_exception($table, $item, $pdf=0)
} else {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->align = [];
$table1->align['agent'] = 'left';
@ -2569,7 +2578,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
$table->colspan['group_report']['cell'] = 3;
$table->cellstyle['group_report']['cell'] = 'text-align: center;';
$data = "<table class='databox' width='100%'>
$data = "<table class='info_table' width='100%'>
<tbody><tr>
<td></td>
<td colspan='3' class='cellBold cellCenter'>".__('Total')."</td>
@ -2631,6 +2640,7 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
if ($item['total_events'] != 0) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->align = [];
$table1->align[0] = 'center';
$table1->align[1] = 'center';
@ -2853,6 +2863,7 @@ function reporting_html_historical_data($table, $item, $pdf=0)
$table1 = new stdClass();
$table1->width = '100%';
$table1->class = 'info_table';
$table1->head = [
__('Date'),
__('Data'),
@ -2937,6 +2948,7 @@ function reporting_html_database_serialized($table, $item, $pdf=0)
$table1 = new stdClass();
$table1->width = '100%';
$table1->class = 'info_table';
$table1->head = [
__('Date'),
__('Data'),
@ -3005,6 +3017,7 @@ function reporting_html_last_value($table, $item, $pdf=0)
if (empty($item['data']) === false) {
$table_data = new stdClass();
$table_data->width = '100%';
$table_data->class = 'info_table';
$table_data->headstyle = [];
$table_data->headstyle[0] = 'text-align: left;';
$table_data->style = [];
@ -3167,6 +3180,7 @@ function reporting_html_group_configuration($table, $item, $pdf=0)
if ($pdf === 0) {
$table2 = new stdClass();
$table2->width = '100%';
$table2->class = 'info_table';
$table2->data = [];
reporting_html_agent_configuration(
$table2,
@ -3317,6 +3331,7 @@ function reporting_html_network_interfaces_report($table, $item, $pdf=0)
foreach ($item['data'] as $agent) {
$table_agent = new StdCLass();
$table_agent->width = '100%';
$table_agent->class = 'info_table';
$table_agent->data = [];
$table_agent->head = [];
$table_agent->head[0] = __('Agent').' '.$agent['agent'];
@ -3440,6 +3455,7 @@ function reporting_html_alert_report($table, $item, $pdf=0)
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->head = [];
$table1->data = [];
$table1->rowspan = [];
@ -3564,6 +3580,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->head = [];
$table1->data = [];
if ($item['data']['unknown'] == 1) {
@ -3663,6 +3680,7 @@ function reporting_html_agent_configuration(
$table1 = new stdClass();
$table1->width = '99%';
$table1->head = [];
$table1->class = 'info_table';
$table1->head['name'] = __('Agent name');
$table1->head['group'] = __('Group');
$table1->head['os'] = __('OS');
@ -3837,6 +3855,7 @@ function reporting_html_value(
) {
$table2 = new stdClass();
$table2->width = '100%';
$table2->class = 'info_table';
switch ($item['type']) {
case 'max_value':
$table2->head = [
@ -4143,6 +4162,7 @@ function reporting_html_availability($table, $item, $pdf=0)
if (empty($item['data']) === false) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->data = [];
$table1->head = [];
@ -4726,6 +4746,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
) {
$table1 = new stdClass();
$table1->width = '100%';
$table1->class = 'info_table';
$table1->autosize = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;';
$table1->data = [];
@ -4746,7 +4767,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table1->data[$k_chart][0] .= ' (24 x 7)';
}
$total_values += $sla_value;
$total_values .= $sla_value;
$count_total_charts++;
$table1->data[$k_chart][1] = $chart['chart'];
$table1->data[$k_chart][2] = "<span style = 'font-weight: bold; font-size: ".$font_size.'; color: '.$color."'>".$sla_value.'</span><br/>';
@ -4823,7 +4844,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
case 'result':
default:
$total_values += $sla_value;
$total_values .= $sla_value;
$count_total_charts++;
$title = '<b>'.__('Result').'</b>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.$color."'>".$sla_value.'</span>';
@ -4967,6 +4988,7 @@ function reporting_html_general($table, $item, $pdf=0)
if (!$data_in_same_row) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
$table1->data = [];
$table1->head = [];
$table1->head[0] = __('Agent');
@ -5168,7 +5190,7 @@ function reporting_html_sql($table, $item, $pdf=0)
$first = true;
$table2 = new stdClass();
$table2->class = 'databox';
$table2->class = 'info_table';
$table2->width = '100%';
foreach ($item['data'] as $row) {
@ -6475,7 +6497,7 @@ function reporting_html_permissions($table, $item, $pdf=0)
$table1->width = '100%';
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
$table1->class = 'databox data';
$table1->class = 'info_table';
$table1->cellpadding = 1;
$table1->cellspacing = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;';

View File

@ -727,6 +727,7 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
}
}
$icon = (str_contains($icon, '.svg') === true) ? $icon : $icon.'.svg';
$output .= html_print_image(
'images/'.$icon,
true,
@ -3918,10 +3919,15 @@ function ui_print_datatable(array $parameters)
ordering: '.$ordering.',
initComplete: function(settings, json) {
// Move elements to table_action_buttons bar.
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_length"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dt-buttons"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_filter"));
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers"));
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_length"));
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dt-buttons"));
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_filter"));
},
columns: [';

View File

@ -2402,8 +2402,8 @@ function topFunction() {
}
function menuActionButtonResizing() {
$(".action_buttons_right_content").attr(
$("#principal_action_buttons").attr(
"style",
"left: " + $("#menu_full").width() + "px;"
"width: calc(100% - " + $("#menu_full").width() + "px);"
);
}

View File

@ -54,10 +54,10 @@ class User extends Entity implements PublicLogin
/**
* Initializes a user object.
*
* @param string|null $id_user User id.
* @param mixed $id_user User id.
* - Username
*/
public function __construct(?string $id_user)
public function __construct($id_user)
{
$this->table = 'tusuario';

View File

@ -82,10 +82,12 @@ table.dataTable tbody td {
padding: 8px 10px;
}
/*
th:last-child {
padding-top: 0px !important;
padding-bottom: 0px !important;
}
*/
table#table_events > tbody > tr > td {
padding: 0px !important;

View File

@ -577,7 +577,6 @@ ul li {
#menu_tabs {
height: 49px;
border-bottom: 1px solid #c1ccdc;
padding-bottom: 2px;
}
.div_border_line {

View File

@ -1053,6 +1053,10 @@ select:-internal-list-box {
border-radius: 8px;
}
.box-flat .action-buttons {
flex-direction: row-reverse;
}
.align-top td {
vertical-align: top;
}
@ -1127,7 +1131,6 @@ div#container {
div#main {
display: flex;
background-color: #f6f7fb;
padding-bottom: 3em;
position: relative;
flex-direction: column;
height: 100%;
@ -2102,20 +2105,20 @@ table.rounded_cells td {
.action-buttons {
display: flex;
flex-direction: row-reverse;
align-items: center;
}
.action-buttons > *:not(#backgroundMaskId) {
z-index: 5;
}
#principal_action_buttons {
z-index: 6;
background: #ffffff;
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
}
.action-buttons > button {
#principal_action_buttons.action-buttons > button {
margin-left: 16px;
flex: none;
}
.action-buttons-right-forced {
@ -6138,18 +6141,12 @@ div#status_pie {
padding-left: 15px;
}
/*
.agent_details_graph {
text-align: center;
margin: 0 auto;
}
.agent_details_info {
max-width: 45%;
overflow: hidden;
min-width: 220px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
*/
.agent_details_agent_data {
display: flex;
@ -8137,7 +8134,8 @@ div.graph div.legend table {
min-height: 460px;
position: relative;
overflow: hidden;
background-color: #fafafa;
background-color: var(--secondary-color);
min-height: calc(100vh - 220px);
}
/*
@ -8462,7 +8460,7 @@ div.graph div.legend table {
}
.pandora_logs {
width: 98%;
width: 100%;
float: right;
height: 200px;
margin-bottom: 20px;
@ -10957,24 +10955,28 @@ tr.bring_next_field {
position: fixed;
padding: 0;
bottom: 0;
z-index: 1;
width: -webkit-fill-available;
right: 0;
width: -moz-available;
padding-right: 10px;
left: 0;
height: 62px;
height: auto;
}
.action_buttons_right_content {
position: fixed;
z-index: 10000;
left: 250px;
flex: 1;
height: auto;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin-left: 20px;
}
.action_buttons_right_content div {
#principal_action_buttons > form:first-child,
.action_buttons_right_content > div {
height: 62px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-right: 1em;
margin-left: 1em;
}
@ -10990,14 +10992,14 @@ tr.bring_next_field {
position: absolute;
left: 0;
top: 0;
height: 62px;
height: auto;
border-top: 1px solid #e5e9ed;
background-color: #fff;
}
/*
.fixed_action_buttons_size > .action_buttons_background_mask {
left: -95px !important;
}
}*/
.external_tools_title {
padding: 0 10px;
@ -11232,8 +11234,8 @@ table.table_modal_alternate
}
.subsection_header_title {
font-size: 18px;
font-weight: initial;
font-size: 14px;
font-weight: "lato-bold";
}
span.subsection_header_title {
@ -11453,6 +11455,7 @@ form#satellite_conf_edit > fieldset.full-column {
background-repeat: no-repeat;
background-size: 24px;
background-image: url("../../images/enable.svg");
padding-right: 45px;
}
.orientation-report {
@ -11604,3 +11607,9 @@ ul.tag-editor {
.ui-dialog .ui-dialog-titlebar {
display: block !important;
}
.select2-container--default .select2-search--inline .select2-search__field {
height: 20px;
padding-left: 5px !important;
font-size: 20px !important;
}

View File

@ -309,11 +309,6 @@ table.dataTable.info_table.no-footer {
border-bottom: none;
}
/* Datatables pagination */
.dataTables_paginate.paging_simple_numbers {
margin: 2em 0;
}
a.pandora_pagination {
background-color: #f6f7fb;
padding: 11px;

View File

@ -13,6 +13,10 @@ ul.wizard li {
padding-top: 10px;
}
#principal_action_buttons ul.wizard li {
padding: 0px;
}
ul.wizard.inline li {
display: flex;
flex-direction: row;

View File

@ -1519,7 +1519,6 @@ require 'include/php_to_js_values.php';
<script type="text/javascript" language="javascript">
// Handle the scroll.
$(document).ready(scrollFunction());
$(document).ready(menuActionButtonResizing());
// When there are less than 5 rows, all rows must be white
var theme = "<?php echo $config['style']; ?>";
if (theme === 'pandora') {

View File

@ -1020,33 +1020,29 @@ $tableAgents->class = 'info_table tactical_table';
$tableAgents->head = [];
$tableAgents->head[0] = '<span>'.__('Agent').'</span>';
$tableAgents->head[0] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown);
$tableAgents->size[0] = '12%';
$tableAgents->size[0] = '10%';
$tableAgents->head[1] = '<span>'.__('Description').'</span>';
$tableAgents->head[0] .= ui_get_sorting_arrows($url_up_description, $url_down_description, $selectDescriptionUp, $selectDescriptionDown);
$tableAgents->size[1] = '16%';
$tableAgents->head[10] = '<span>'.__('Remote').'</span>';
$tableAgents->head[10] .= ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown);
$tableAgents->size[10] = '9%';
$tableAgents->head[1] .= ui_get_sorting_arrows($url_up_description, $url_down_description, $selectDescriptionUp, $selectDescriptionDown);
$tableAgents->size[1] = '14%';
$tableAgents->head[2] = '<span>'.__('OS').'</span>';
$tableAgents->head[2] .= ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown);
$tableAgents->size[2] = '8%';
$tableAgents->size[2] = '7%';
$tableAgents->head[3] = '<span>'.__('Interval').'</span>';
$tableAgents->head[3] .= ui_get_sorting_arrows($url_up_interval, $url_down_interval, $selectIntervalUp, $selectIntervalDown);
$tableAgents->size[3] = '10%';
$tableAgents->size[3] = '7%';
$tableAgents->head[4] = '<span>'.__('Group').'</span>';
$tableAgents->head[4] .= ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown);
$tableAgents->size[4] = '8%';
$tableAgents->size[4] = '7%';
$tableAgents->head[5] = '<span>'.__('Type').'</span>';
$tableAgents->size[5] = '8%';
$tableAgents->size[5] = '7%';
$tableAgents->head[6] = '<span>'.__('Modules').'</span>';
$tableAgents->size[6] = '10%';
$tableAgents->size[6] = '7%';
$tableAgents->head[7] = '<span>'.__('Status').'</span>';
$tableAgents->size[7] = '4%';
@ -1056,14 +1052,18 @@ $tableAgents->size[8] = '4%';
$tableAgents->head[9] = '<span>'.__('Last contact').'</span>';
$tableAgents->head[9] .= ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown);
$tableAgents->size[9] = '15%';
$tableAgents->size[9] = '7%';
$tableAgents->head[10] = '<span>'.__('Last status change').'</span>';
$tableAgents->head[10] .= ui_get_sorting_arrows($url_up_last_status_change, $url_down_last_status_change, $selectLastStatusChangeUp, $selectLastStatusChangeDown);
$tableAgents->size[10] = '10%';
$tableAgents->head[11] = '<span>'.__('Agent events').'</span>';
$tableAgents->size[11] = '4%';
$tableAgents->head[11] = '<span>'.__('Remote').'</span>';
$tableAgents->head[11] .= ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown);
$tableAgents->size[11] = '7%';
$tableAgents->head[12] = '<span>'.__('Op').'</span>';
$tableAgents->size[12] = '4%';
$tableAgents->align = [];
@ -1116,9 +1116,22 @@ foreach ($agents as $agent) {
$data[0] = '<div class="left_'.$agent['id_agente'].'">';
if ($agent['id_os'] == CLUSTER_OS_ID) {
$cluster = PandoraFMS\Cluster::loadFromAgentId(
$agent['id_agente']
);
$url = 'index.php?sec=reporting&sec2=';
$url .= 'operation/cluster/cluster';
$url = ui_get_full_url(
$url.'&op=view&id='.$cluster->id()
);
} else {
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'];
}
$data[0] .= html_print_anchor(
[
'href' => ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente']),
'href' => ui_get_full_url($url),
'content' => ui_print_truncate_text($agent['alias'], 'agent_medium', false, true, true),
],
true
@ -1146,61 +1159,12 @@ foreach ($agents as $agent) {
$data[0] .= '</em>';
}
$data[0] .= '<div class="agentleft_'.$agent['id_agente'].'" style="visibility: hidden; clear: left;">';
if ($agent['id_os'] == CLUSTER_OS_ID) {
$cluster = PandoraFMS\Cluster::loadFromAgentId(
$agent['id_agente']
);
$url = 'index.php?sec=reporting&sec2=';
$url .= 'operation/cluster/cluster';
$url = ui_get_full_url(
$url.'&op=view&id='.$cluster->id()
);
$data[0] .= '<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>';
}
if (check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
$data[0] .= ' | ';
if ($agent['id_os'] == CLUSTER_OS_ID) {
$cluster = PandoraFMS\Cluster::loadFromAgentId(
$agent['id_agente']
);
$url = 'index.php?sec=reporting&sec2=';
$url .= 'operation/cluster/cluster';
$url = ui_get_full_url(
$url.'&op=update&id='.$cluster->id()
);
$data[0] .= '<a href="'.$url.'">'.__('Edit').'</a>';
} else {
$data[0] .= '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$agent['id_agente'].'">'.__('Edit').'</a>';
}
}
$data[0] .= '</div></div>';
$data[0] .= '</div>';
$data[1] = '<span class="'.$custom_font_size.'">'.ui_print_truncate_text($agent['description'], 'description', false, true, true, '[&hellip;]').'</span>';
$data[2] = '';
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
$data[10] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1">'.html_print_image(
'images/remote-configuration@svg.svg',
true,
[
'align' => 'middle',
'title' => __('Remote config'),
'class' => 'invert_filter main_menu_icon',
]
).'</a>';
}
}
$data[2] = html_print_div(
[
'class' => 'invert_filter main_menu_icon',
@ -1252,8 +1216,24 @@ foreach ($agents as $agent) {
'status' => -1,
];
$data[11] = '';
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
$data[11] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1">'.html_print_image(
'images/remote-configuration@svg.svg',
true,
[
'align' => 'middle',
'title' => __('Remote config'),
'class' => 'invert_filter main_menu_icon',
]
).'</a>';
}
}
$fb64 = base64_encode(json_encode($agent_event_filter));
$data[11] = '<a href="index.php?sec=eventos&sec2=operation/events/events&fb64='.$fb64.'">'.html_print_image(
$data[12] = '<a href="index.php?sec=eventos&sec2=operation/events/events&fb64='.$fb64.'">'.html_print_image(
'images/event.svg',
true,
[
@ -1263,6 +1243,31 @@ foreach ($agents as $agent) {
]
).'</a>';
if (check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
if ($agent['id_os'] == CLUSTER_OS_ID) {
$cluster = PandoraFMS\Cluster::loadFromAgentId(
$agent['id_agente']
);
$url = 'index.php?sec=reporting&sec2=';
$url .= 'operation/cluster/cluster';
$url = ui_get_full_url(
$url.'&op=update&id='.$cluster->id()
);
} else {
$url = 'index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$agent['id_agente'];
}
$data[12] .= '<a href="'.$url.'">'.html_print_image(
'images/edit.svg',
true,
[
'align' => 'middle',
'title' => __('Edit'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}
array_push($tableAgents->data, $data);
}

View File

@ -176,13 +176,16 @@ if ($total_agentes > 0) {
}
echo '<table width="100%" class="info_table">';
echo '<thead>';
echo '<tr>';
echo "<th colspan=2 class='center'>".__('Summary of the status groups').'</th>';
echo '</tr>';
echo '<tr>';
echo "<th width=50% class='center'>".__('Agents').'</th>';
echo "<th width=50% class='center'>".__('Modules').'</th>';
echo "<th class='center'>".__('Agents').'</th>';
echo "<th class='center'>".__('Modules').'</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
echo "<tr height=70px'>";
echo "<td align='center'>";
echo "<span id='sumary' class='red_background'>".$total_agent_critical.'%</span>';
@ -199,6 +202,7 @@ echo '<table width="100%" class="info_table">';
echo "<span id='sumary' class='bg_4a83f3'>".$total_monitor_not_init.'%</span>';
echo '</td>';
echo '</tr>';
echo '</tbody>';
echo '</table>';
if ($count == 1) {
@ -224,6 +228,7 @@ if (empty($result_groups) === false) {
);
echo '<table class="info_table mrgn_top_10px" border="0" width="100%">';
echo '<thead>';
echo '<tr>';
echo '<th colspan=2 ></th>';
echo '<th colspan=6>'.__('Agents').'</th>';
@ -246,6 +251,7 @@ if (empty($result_groups) === false) {
echo "<th width='10%' class='mw60px center'>".__('Critical').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Alert fired').'</th>';
echo '</tr>';
echo '</thead>';
foreach ($result_groups as $data) {
if ((bool) $config['show_empty_groups'] === false

View File

@ -1448,7 +1448,7 @@ $url_timestamp_down .= '&sort_field=timestamp&sort=down';
if (empty($result) === false) {
if (is_metaconsole() === true) {
html_print_action_buttons(
html_print_div(['style' => 'float:left; height: 55px;', 'class' => 'mrgn_top_15px'], true),
'',
[
'type' => 'form_action',
'right_content' => $tablePagination,
@ -2229,7 +2229,7 @@ if (empty($result) === false) {
if (is_metaconsole() !== true) {
html_print_action_buttons(
html_print_div(['style' => 'float:left; height: 55px;'], true),
'',
[
'type' => 'form_action',
'right_content' => $tablePagination,

View File

@ -1443,10 +1443,10 @@ $alerttab['active'] = ($tab === 'alert');
// Inventory.
$inventoryCount = db_get_num_rows('SELECT id_agent_module_inventory FROM tagent_module_inventory WHERE id_agente = '.$agent['id_agente']);
$inventorytab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
'images/page_white_text.png',
'images/hardware-software-component@svg.svg',
true,
[
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
'title' => __('Inventory'),
]
).'</a>';

View File

@ -34,7 +34,24 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
$action = get_parameter('action', 'listeners');
ui_print_page_header(__('Netflow explorer'));
ui_print_standard_header(
__('Netflow explorer'),
'',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
);
if (netflow_print_check_version_error()) {
include $config['homedir'].'/operation/network/network_report.php';

View File

@ -62,95 +62,172 @@ $style_period = ($is_period) ? '' : 'display: none;';
// Build the table.
$table = new stdClass();
$table->class = 'databox filters';
$table->styleTable = 'width: 100%';
$table->data['0']['0'] = __('Data to show').'&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_select(
network_get_report_actions(false),
'action',
$action,
'',
'',
0,
true
$table->class = 'filter-table-adv';
$table->width = '100%';
$table->data = [];
$table->data[0][] = html_print_label_input_block(
__('Data to show'),
html_print_select(
network_get_report_actions(false),
'action',
$action,
'',
'',
0,
true
)
);
$table->data['0']['1'] = __('Number of result to show').'&nbsp;&nbsp;';
$table->data['0']['1'] .= html_print_select(
[
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'50' => 50,
'100' => 100,
'250' => 250,
],
'top',
$top,
'',
'',
0,
true
$table->data[0][] = html_print_label_input_block(
__('Number of result to show'),
html_print_select(
[
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'50' => 50,
'100' => 100,
'250' => 250,
],
'top',
$top,
'',
'',
0,
true
)
);
$table->data['0']['2'] = '';
$table->data['1']['0'] = '<div class="flex">';
$table->data['1']['0'] .= '<div id="end_date_container" style="'.$style_end.'">';
$table->data['1']['0'] .= __('Start date').'&nbsp;&nbsp;';
$table->data['1']['0'] .= html_print_input_text('date_lower', $date_lower, '', 10, 7, true);
$table->data['1']['0'] .= '&nbsp;&nbsp;';
$table->data['1']['0'] .= html_print_input_text('time_lower', $time_lower, '', 7, 8, true);
$table->data['1']['0'] .= '</div>';
$table->data['1']['0'] .= '<div id="period_container" style="'.$style_period.'">';
$table->data['1']['0'] .= __('Time Period').'&nbsp;&nbsp;';
$table->data['1']['0'] .= html_print_extended_select_for_time('period', $period, '', '', 0, false, true);
$table->data['1']['0'] .= '</div>';
$table->data['1']['0'] .= html_print_checkbox(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'network_report_click_period(event)'
$table->data[1][] = html_print_label_input_block(
__('Start date'),
html_print_div(
[
'id' => 'end_date_container',
'content' => html_print_input_text(
'date_lower',
$date_lower,
'',
10,
10,
true
).html_print_input_text(
'time_lower',
$time_lower,
'',
7,
8,
true
),
],
true
).html_print_div(
[
'id' => 'period_container',
'style' => 'display: none;',
'content' => html_print_label_input_block(
'',
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
false,
true
),
),
],
true
)
);
$table->data['1']['0'] .= ui_print_help_tip(
__('Select this checkbox to write interval instead a date.'),
true
);
$table->data['1']['0'] .= '</div>';
$table->data['1']['1'] = __('End date').'&nbsp;&nbsp;';
$table->data['1']['1'] .= html_print_input_text('date_greater', $date_greater, '', 10, 7, true);
$table->data['1']['1'] .= '&nbsp;&nbsp;';
$table->data['1']['1'] .= html_print_input_text('time_greater', $time_greater, '', 7, 8, true);
$table->data['1']['2'] = html_print_submit_button(
__('Update'),
'update',
false,
'class="sub upd"',
true
$table->data[1][] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'id' => '',
'class' => '',
'content' => html_print_input_text(
'date_greater',
$date_greater,
'',
10,
10,
true
).html_print_input_text(
'time_greater',
$time_greater,
'',
7,
8,
true
),
],
true
)
);
$table->data['1']['2'] .= '&nbsp;&nbsp;';
$table->data['1']['2'] .= html_print_submit_button(
__('Export to CSV'),
'export_csv',
false,
'class="sub next" onclick="blockResumit($(this))"',
true
$table->data[2][] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'network_report_click_period(event)'
)
);
echo '<form method="post">';
html_print_input_hidden('order_by', $order_by);
if (!empty($main_value)) {
if (empty($main_value) === false) {
html_print_input_hidden('main_value', $main_value);
}
html_print_table($table);
$outputTable = html_print_table($table, true);
$outputTable .= html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Filter'),
'update',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
ui_toggle(
$outputTable,
'<span class="subsection_header_title">'.__('Filters').'</span>',
__('Filters'),
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
html_print_action_buttons(
html_print_submit_button(
__('Export to CSV'),
'export_csv',
false,
[
'icon' => 'load',
'onclick' => 'blockResumit($(this))',
],
true
)
);
echo '</form>';
// Print the data.
@ -178,7 +255,8 @@ $hidden_main_link = [
unset($table);
$table = new stdClass();
$table->styleTable = 'width: 60%';
$table->id = '';
$table->width = '100%';
// Print the header.
$table->head = [];
$table->head['main'] = __('IP');
@ -252,20 +330,6 @@ if (get_parameter('export_csv')) {
exit;
}
// Print the filter remove link.
if (!empty($main_value)) {
echo html_print_link_with_params(
in_array($action, ['udp', 'tcp']) ? __('Filtered by port %s. Click here to remove the filter.', $main_value) : __('Filtered by IP %s. Click here to remove the filter.', $main_value),
array_merge(
$hidden_main_link,
[
'main_value' => $main_value,
'remove_filter' => 1,
]
)
);
}
// Print the data and build the chart.
$table->data = [];
$chart_data = [];
@ -277,7 +341,7 @@ foreach ($data as $item) {
$row['main'] .= $item['host'];
if (!$hide_filter) {
$row['main'] .= html_print_link_with_params(
'images/filter.png',
'images/filters@svg.svg',
array_merge($hidden_main_link, ['main_value' => $item['host']]),
'image'
);
@ -316,9 +380,7 @@ foreach ($data as $item) {
if (empty($data)) {
ui_print_info_message(__('No data found'));
} else {
echo '<div class="flex mrgn_top_10px">';
html_print_table($table);
// Pie graph options.
$options = [
'height' => 230,
'legend' => [
@ -328,15 +390,35 @@ if (empty($data)) {
],
'labels' => $labels,
];
// Print the graph.
echo '<div class="mrgn_top_50px w40p">';
echo pie_graph(
$chart_data,
$options
// Pie graph.
html_print_div(
[
'class' => 'databox netflow-pie-graph-container padding-2 white_box',
'content' => pie_graph(
$chart_data,
$options
),
]
);
echo '</div>';
echo '</div>';
// Print the filter remove link.
if (empty($main_value) === false) {
echo html_print_link_with_params(
in_array($action, ['udp', 'tcp']) ? __('Filtered by port %s. Click here to remove the filter.', $main_value) : __('Filtered by IP %s. Click here to remove the filter.', $main_value),
array_merge(
$hidden_main_link,
[
'main_value' => $main_value,
'remove_filter' => 1,
]
),
'text',
'',
'width: 100%; display: flex; justify-content: center;'
);
}
// Print results.
html_print_table($table);
}
?>