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

View File

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

View File

@ -132,47 +132,37 @@ function dbmgr_extension_main()
echo $warning_message; 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=''>"; echo "<form method='post' action=''>";
$table = new stdClass(); $table = new stdClass();
$table->id = 'db_interface'; $table->id = 'db_interface';
$table->class = 'databox'; $table->class = 'databox no_border filter-table-adv';
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->head = [];
$table->colspan = []; $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->colspan[1][0] = 2;
$table->rowspan[2][0] = 3;
$table->rowclass[0] = 'notify'; $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>";
$table->rowclass[3] = 'pdd_5px'; $data[0][0] = html_print_label_input_block(
$table->rowclass[3] = 'flex-content-right'; __('Some samples of usage:'),
$table->rowclass[4] = 'flex-content-right'; "<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] = __(
"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
); );
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
@ -191,35 +181,57 @@ function dbmgr_extension_main()
$servers = []; $servers = [];
} }
$data[3][2] = html_print_input( $data[0][1] = html_print_label_input_block(
[ __('Select query target'),
'name' => 'node_id', html_print_select(
'type' => 'select', $servers,
'fields' => $servers, 'node_id',
'selected' => $node_id, $node_id,
'nothing' => __('This metaconsole'), '',
'nothing_value' => -1, __('This metaconsole'),
'return' => true, -1,
'label' => _('Select query target'), true,
] false,
false,
'w40p',
false,
'width: 40%;'
)
); );
} }
$data[4][2] = html_print_div( $data[1][0] = html_print_textarea(
[ 'sql',
'class' => 'action-buttons', 3,
'content' => html_print_submit_button( 50,
__('Execute SQL'), html_entity_decode($sql, ENT_QUOTES),
'', 'placeholder="'.__('Type your query here...').'"',
false, true,
[ 'icon' => 'cog' ], 'w100p'
true );
),
] $execute_button = html_print_submit_button(
__('Execute SQL'),
'',
false,
[ 'icon' => 'cog' ],
true
); );
$table->data = $data; $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>'; echo '</form>';
// Processing SQL Code. // Processing SQL Code.
@ -227,10 +239,6 @@ function dbmgr_extension_main()
return; return;
} }
echo '<br />';
echo '<hr />';
echo '<br />';
try { try {
if (\is_metaconsole() === true && $node_id !== -1) { if (\is_metaconsole() === true && $node_id !== -1) {
$node = new Node($node_id); $node = new Node($node_id);

View File

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

View File

@ -25,13 +25,28 @@ function extension_uploader_extensions()
return; return;
} }
ui_print_page_header( // Header.
__('Uploader extension'), ui_print_standard_header(
__('Extensions'),
'images/extensions.png', 'images/extensions.png',
false, false,
'', '',
true, true,
'' [],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Uploader extension'),
],
]
); );
$upload = (bool) get_parameter('upload', 0); $upload = (bool) get_parameter('upload', 0);
@ -77,20 +92,52 @@ function extension_uploader_extensions()
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $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 = [];
$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()) { 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'>"; echo "<form method='post' enctype='multipart/form-data'>";
html_print_table($table); html_print_table($table);
echo "<div class='right' style='width: ".$table->width."'>";
html_print_input_hidden('upload', 1); html_print_input_hidden('upload', 1);
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"'); html_print_action_buttons(
echo '</div>'; html_print_submit_button(
__('Upload'),
'submit',
false,
['icon' => 'wand'],
true
)
);
echo '</form>'; echo '</form>';
} }

View File

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

View File

@ -11,11 +11,12 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
function view_logfile($file_name) function view_logfile($file_name, $toggle=false)
{ {
global $config; global $config;
$memory_limit = ini_get('memory_limit'); $memory_limit = ini_get('memory_limit');
$code = '';
if (strstr($memory_limit, 'M') !== false) { if (strstr($memory_limit, 'M') !== false) {
$memory_limit = str_replace('M', '', $memory_limit); $memory_limit = str_replace('M', '', $memory_limit);
@ -31,21 +32,37 @@ function view_logfile($file_name)
$file_size = filesize($file_name); $file_size = filesize($file_name);
if ($memory_limit < $file_size) { if ($memory_limit < $file_size) {
echo "<h2>$file_name (".__('File is too large than PHP memory allocated in the system.').')</h2>'; $code .= '<pre><h2>'.$file_name.' ('.__('File is too large than PHP memory allocated in the system.').')</h2>';
echo '<h2>'.__('The preview file is imposible.').'</h2>'; $code .= '<h2>'.__('The preview file is imposible.').'</h2>';
} else if ($file_size > ($config['max_log_size'] * 1000)) { } else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents($file_name, false, null, ($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>'; $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>';
echo "<textarea class='pandora_logs' name='$file_name'>"; $code .= "<textarea class='pandora_logs' name='$file_name'>";
echo '... '; $code .= '... ';
echo $data; $code .= $data;
echo '</textarea><br><br>'; $code .= '</textarea><br><br>';
} else { } else {
$data = file_get_contents($file_name); $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>'; $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>';
echo "<textarea class='pandora_logs' name='$file_name'>"; $code .= "<textarea class='pandora_logs' name='$file_name'>";
echo $data; $code .= $data;
echo '</textarea><br><br>'; $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; 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>'; ui_print_info_message(
__('Use this tool to view your %s logfiles directly on the console', get_product_name()).'<br>
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>'; '.__('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'; $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. // Do not attempt to show console log if disabled.
if ($config['console_log_enabled']) { 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.log', true);
view_logfile($logs_directory.'/pandora_server.error'); view_logfile($logs_directory.'/pandora_server.error', true);
} }

View File

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

View File

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

View File

@ -1070,13 +1070,57 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
); );
echo '</form>'; 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"> <script type="text/javascript">
function create_module_dialog(){ function create_module_dialog(){
$('#modal') console.log('Entra');
.dialog({ $('#modal').dialog({
title: '<?php echo __('Create Module'); ?>', title: '<?php echo __('Create Module'); ?>',
resizable: true, resizable: true,
draggable: true, draggable: true,

View File

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

View File

@ -24,8 +24,29 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
exit; exit;
} }
// Header // Header.
ui_print_page_header(__('Extensions').' &raquo; '.__('Defined extensions'), 'images/extensions.png', false, '', true, ''); 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) { if (count($config['extensions']) == 0) {
$extensions = extensions_get_extension_info(); $extensions = extensions_get_extension_info();
@ -132,7 +153,7 @@ if ($disabled != '') {
$extensions = extensions_get_extension_info(); $extensions = extensions_get_extension_info();
$table = new StdClass; $table = new StdClass;
$table->width = '98%'; $table->width = '100%';
$table->head = []; $table->head = [];
$table->head[] = __('File'); $table->head[] = __('File');
@ -146,7 +167,7 @@ $table->head[] = __('Login Function');
$table->head[] = __('Agent operation tab'); $table->head[] = __('Agent operation tab');
$table->head[] = __('Agent godmode tab'); $table->head[] = __('Agent godmode tab');
$table->head[] = __('Operation'); $table->head[] = __('Operation');
$table->width = '100%';
$table->class = 'info_table'; $table->class = 'info_table';
$table->align = []; $table->align = [];
@ -254,9 +275,39 @@ foreach ($extensions as $file => $extension) {
if ($file != 'update_manager.php') { if ($file != 'update_manager.php') {
$table->cellclass[][10] = 'table_action_buttons'; $table->cellclass[][10] = 'table_action_buttons';
if (!$extension['enabled']) { 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 { } 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 { } else {
$data[] = ''; $data[] = '';

View File

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

View File

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

View File

@ -80,7 +80,7 @@ if (empty($directory) === true) {
$real_directory = realpath($config['homedir'].'/'.$directory); $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'); $upload_file = (bool) get_parameter('upload_file');
$create_text_file = (bool) get_parameter('create_text_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->id = 'news';
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
$table->class = 'databox filters'; $table->class = 'databox filters filter-table-adv';
$table->head = []; $table->head = [];
$table->data = []; $table->data = [];
$table->style[0] = 'font-weight: bold;'; $table->size[0] = '33%';
$table->style[1] = 'font-weight: bold;'; $table->size[1] = '33%';
$table->style[2] = 'font-weight: bold;'; $table->colspan[2][0] = 2;
$table->style[3] = 'font-weight: bold;'; $table->rowclass[2] = 'w100p';
$table->style[4] = 'font-weight: bold;';
$data = []; $data = [];
$data[0] = __('Subject').'<br>'; $data[0] = html_print_label_input_block(
$data[0] .= '<input type="text" class="text_input" name="subject" size="35" value="'.$subject.'" >'; __('Subject'),
html_print_input_text(
'subject',
$subject,
'',
35,
255,
true
)
);
$data[1] = __('Group').'<br>'; $data[1] = html_print_label_input_block(
$data[1] .= '<div class="w250px">'; __('Group'),
$data[1] .= html_print_select_groups($config['id_user'], 'ER', users_can_manage_group_all(), 'id_group', $id_group, '', '', 0, true, false, false, ''); html_print_select_groups(
$data[1] .= '</div>'; $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 = [];
$data[2] .= html_print_checkbox_extended('modal', 1, $modal, false, '', 'class="mrgn_top_5 mrg_btt_7"', true); $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[1] = '<div style="display: inline-flex; flex-direction: row;">'.html_print_label_input_block(
$data[3] .= html_print_checkbox_extended('expire', 1, $expire, false, '', 'class="mrgn_top_5 mrg_btt_7"', true); __('Expire'),
html_print_checkbox_extended(
$data[4] = __('Expiration').'<br>'; 'expire',
$data[4] .= html_print_input_text('expire_date', $expire_date, '', 12, 10, true).' '; 1,
$data[4] .= html_print_input_text('expire_time', $expire_time, '', 10, 7, true).' '; $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->rowclass[] = '';
$table->data[] = $data; $table->data[] = $data;
$data = []; $data = [];
$data[0] = __('Text').'<br>'; $data[0] = html_print_label_input_block(
$data[0] .= html_print_textarea('text', 25, 15, $text, '', true); __('Text'),
$table->rowclass[] = ''; html_print_textarea(
$table->colspan[1][0] = 5; 'text',
25,
100,
$text,
'',
true,
'w100p'
)
);
$table->data[] = $data; $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) { if ($creation_mode == 1) {
echo "<input type='hidden' name='create' value='1'>"; echo "<input type='hidden' name='create' value='1'>";
} else { } else {
@ -228,11 +300,25 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
echo "<table width='".$table->width."'>"; echo "<table width='".$table->width."'>";
echo "<tr><td align='right'>"; echo "<tr><td align='right'>";
if (isset($_GET['form_add'])) { 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 { } 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>'; echo '</form></td></tr></table>';
} else { } else {
$rows = db_get_all_rows_in_table('tnews', 'timestamp'); $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>';
} }
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 "<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')."'>"; html_print_action_buttons(
echo '</form></table>'; 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->rowid[1] = 'save_filter_row1';
$table->size[0] = '50%'; $table->size[0] = '50%';
$table->size[1] = '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] = '<b>'.__('Filter name').'</b>'.$jump;
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); $data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
if (is_metaconsole()) { if (is_metaconsole()) {

View File

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

View File

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

View File

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

View File

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

View File

@ -2618,6 +2618,10 @@ function reporting_agents_inventory($report, $content)
$es_agents_inventory_display_options = []; $es_agents_inventory_display_options = [];
} }
if ($es_agent_custom_fields === '') {
$es_agent_custom_fields = [];
}
$custom_field_sql = ''; $custom_field_sql = '';
$search_sql = ''; $search_sql = '';
$sql_order_by = 'ORDER BY tagente.id_agente ASC'; $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) { if (isset($item['data']) === true) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->align = []; $table1->align = [];
$table1->align[0] = 'left'; $table1->align[0] = 'left';
@ -567,6 +568,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
// Second_table for time globals. // Second_table for time globals.
$table2 = new stdClass(); $table2 = new stdClass();
$table2->width = '99%'; $table2->width = '99%';
$table2->class = 'info_table';
$table2->align = []; $table2->align = [];
$table2->align[0] = 'left'; $table2->align[0] = 'left';
@ -600,6 +602,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
// Third_table for time globals. // Third_table for time globals.
$table3 = new stdClass(); $table3 = new stdClass();
$table3->width = '99%'; $table3->width = '99%';
$table3->class = 'info_table';
$table3->align = []; $table3->align = [];
$table3->align[0] = 'left'; $table3->align[0] = 'left';
@ -926,6 +929,7 @@ function reporting_html_top_n($table, $item, $pdf=0)
} else { } else {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->align = []; $table1->align = [];
$table1->align[0] = 'left'; $table1->align[0] = 'left';
@ -1034,6 +1038,7 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
if ($item['total_events']) { if ($item['total_events']) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->align = []; $table1->align = [];
$table1->align[0] = 'center'; $table1->align[0] = 'center';
@ -1305,6 +1310,7 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
foreach ($item['data'] as $item) { foreach ($item['data'] as $item) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->data = []; $table1->data = [];
$table1->head = []; $table1->head = [];
$table1->align = []; $table1->align = [];
@ -1531,7 +1537,7 @@ function reporting_html_agents_inventory($table, $item, $pdf=0)
$table1->width = '100%'; $table1->width = '100%';
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;'; $table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
$table1->class = 'databox data'; $table1->class = 'info_table';
$table1->cellpadding = 1; $table1->cellpadding = 1;
$table1->cellspacing = 1; $table1->cellspacing = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;'; $table1->styleTable = 'overflow: wrap; table-layout: fixed;';
@ -1749,7 +1755,7 @@ function reporting_html_modules_inventory($table, $item, $pdf=0)
$table1->width = '100%'; $table1->width = '100%';
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;'; $table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
$table1->class = 'databox data'; $table1->class = 'info_table';
$table1->cellpadding = 1; $table1->cellpadding = 1;
$table1->cellspacing = 1; $table1->cellspacing = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;'; $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) { foreach ($item['data'] as $module_item) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->cellstyle = []; $table1->cellstyle = [];
$table1->cellstyle[0][0] = 'background: #373737; color: #FFF;'; $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) { foreach ($type_modules as $key_type_module => $type_module) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->data = []; $table1->data = [];
$table1->head = []; $table1->head = [];
$table1->cellstyle = []; $table1->cellstyle = [];
@ -2103,7 +2111,7 @@ function reporting_html_agent_module($table, $item)
if (!empty($item['failed'])) { if (!empty($item['failed'])) {
$table->data['agent_module']['cell'] = $item['failed']; $table->data['agent_module']['cell'] = $item['failed'];
} else { } 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 .= '<tr class="border_th">';
$table_data .= '<th class="bg_th">'.__('Agents').' / '.__('Modules').'</th>'; $table_data .= '<th class="bg_th">'.__('Agents').' / '.__('Modules').'</th>';
@ -2452,6 +2460,7 @@ function reporting_html_exception($table, $item, $pdf=0)
} else { } else {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->align = []; $table1->align = [];
$table1->align['agent'] = 'left'; $table1->align['agent'] = 'left';
@ -2569,7 +2578,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
$table->colspan['group_report']['cell'] = 3; $table->colspan['group_report']['cell'] = 3;
$table->cellstyle['group_report']['cell'] = 'text-align: center;'; $table->cellstyle['group_report']['cell'] = 'text-align: center;';
$data = "<table class='databox' width='100%'> $data = "<table class='info_table' width='100%'>
<tbody><tr> <tbody><tr>
<td></td> <td></td>
<td colspan='3' class='cellBold cellCenter'>".__('Total')."</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) { if ($item['total_events'] != 0) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->align = []; $table1->align = [];
$table1->align[0] = 'center'; $table1->align[0] = 'center';
$table1->align[1] = 'center'; $table1->align[1] = 'center';
@ -2853,6 +2863,7 @@ function reporting_html_historical_data($table, $item, $pdf=0)
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '100%'; $table1->width = '100%';
$table1->class = 'info_table';
$table1->head = [ $table1->head = [
__('Date'), __('Date'),
__('Data'), __('Data'),
@ -2937,6 +2948,7 @@ function reporting_html_database_serialized($table, $item, $pdf=0)
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '100%'; $table1->width = '100%';
$table1->class = 'info_table';
$table1->head = [ $table1->head = [
__('Date'), __('Date'),
__('Data'), __('Data'),
@ -3005,6 +3017,7 @@ function reporting_html_last_value($table, $item, $pdf=0)
if (empty($item['data']) === false) { if (empty($item['data']) === false) {
$table_data = new stdClass(); $table_data = new stdClass();
$table_data->width = '100%'; $table_data->width = '100%';
$table_data->class = 'info_table';
$table_data->headstyle = []; $table_data->headstyle = [];
$table_data->headstyle[0] = 'text-align: left;'; $table_data->headstyle[0] = 'text-align: left;';
$table_data->style = []; $table_data->style = [];
@ -3167,6 +3180,7 @@ function reporting_html_group_configuration($table, $item, $pdf=0)
if ($pdf === 0) { if ($pdf === 0) {
$table2 = new stdClass(); $table2 = new stdClass();
$table2->width = '100%'; $table2->width = '100%';
$table2->class = 'info_table';
$table2->data = []; $table2->data = [];
reporting_html_agent_configuration( reporting_html_agent_configuration(
$table2, $table2,
@ -3317,6 +3331,7 @@ function reporting_html_network_interfaces_report($table, $item, $pdf=0)
foreach ($item['data'] as $agent) { foreach ($item['data'] as $agent) {
$table_agent = new StdCLass(); $table_agent = new StdCLass();
$table_agent->width = '100%'; $table_agent->width = '100%';
$table_agent->class = 'info_table';
$table_agent->data = []; $table_agent->data = [];
$table_agent->head = []; $table_agent->head = [];
$table_agent->head[0] = __('Agent').' '.$agent['agent']; $table_agent->head[0] = __('Agent').' '.$agent['agent'];
@ -3440,6 +3455,7 @@ function reporting_html_alert_report($table, $item, $pdf=0)
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->head = []; $table1->head = [];
$table1->data = []; $table1->data = [];
$table1->rowspan = []; $table1->rowspan = [];
@ -3564,6 +3580,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->head = []; $table1->head = [];
$table1->data = []; $table1->data = [];
if ($item['data']['unknown'] == 1) { if ($item['data']['unknown'] == 1) {
@ -3663,6 +3680,7 @@ function reporting_html_agent_configuration(
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->head = []; $table1->head = [];
$table1->class = 'info_table';
$table1->head['name'] = __('Agent name'); $table1->head['name'] = __('Agent name');
$table1->head['group'] = __('Group'); $table1->head['group'] = __('Group');
$table1->head['os'] = __('OS'); $table1->head['os'] = __('OS');
@ -3837,6 +3855,7 @@ function reporting_html_value(
) { ) {
$table2 = new stdClass(); $table2 = new stdClass();
$table2->width = '100%'; $table2->width = '100%';
$table2->class = 'info_table';
switch ($item['type']) { switch ($item['type']) {
case 'max_value': case 'max_value':
$table2->head = [ $table2->head = [
@ -4143,6 +4162,7 @@ function reporting_html_availability($table, $item, $pdf=0)
if (empty($item['data']) === false) { if (empty($item['data']) === false) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->data = []; $table1->data = [];
$table1->head = []; $table1->head = [];
@ -4726,6 +4746,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
) { ) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '100%'; $table1->width = '100%';
$table1->class = 'info_table';
$table1->autosize = 1; $table1->autosize = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;'; $table1->styleTable = 'overflow: wrap; table-layout: fixed;';
$table1->data = []; $table1->data = [];
@ -4746,7 +4767,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table1->data[$k_chart][0] .= ' (24 x 7)'; $table1->data[$k_chart][0] .= ' (24 x 7)';
} }
$total_values += $sla_value; $total_values .= $sla_value;
$count_total_charts++; $count_total_charts++;
$table1->data[$k_chart][1] = $chart['chart']; $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/>'; $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': case 'result':
default: default:
$total_values += $sla_value; $total_values .= $sla_value;
$count_total_charts++; $count_total_charts++;
$title = '<b>'.__('Result').'</b>'; $title = '<b>'.__('Result').'</b>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.$color."'>".$sla_value.'</span>'; $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) { if (!$data_in_same_row) {
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->class = 'info_table';
$table1->data = []; $table1->data = [];
$table1->head = []; $table1->head = [];
$table1->head[0] = __('Agent'); $table1->head[0] = __('Agent');
@ -5168,7 +5190,7 @@ function reporting_html_sql($table, $item, $pdf=0)
$first = true; $first = true;
$table2 = new stdClass(); $table2 = new stdClass();
$table2->class = 'databox'; $table2->class = 'info_table';
$table2->width = '100%'; $table2->width = '100%';
foreach ($item['data'] as $row) { foreach ($item['data'] as $row) {
@ -6475,7 +6497,7 @@ function reporting_html_permissions($table, $item, $pdf=0)
$table1->width = '100%'; $table1->width = '100%';
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;'; $table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
$table1->class = 'databox data'; $table1->class = 'info_table';
$table1->cellpadding = 1; $table1->cellpadding = 1;
$table1->cellspacing = 1; $table1->cellspacing = 1;
$table1->styleTable = 'overflow: wrap; table-layout: fixed;'; $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( $output .= html_print_image(
'images/'.$icon, 'images/'.$icon,
true, true,
@ -3918,10 +3919,15 @@ function ui_print_datatable(array $parameters)
ordering: '.$ordering.', ordering: '.$ordering.',
initComplete: function(settings, json) { initComplete: function(settings, json) {
// Move elements to table_action_buttons bar. // Move elements to table_action_buttons bar.
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers")); $(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_length")); $(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dt-buttons")); $(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_filter")); $(".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: ['; columns: [';

View File

@ -2402,8 +2402,8 @@ function topFunction() {
} }
function menuActionButtonResizing() { function menuActionButtonResizing() {
$(".action_buttons_right_content").attr( $("#principal_action_buttons").attr(
"style", "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. * Initializes a user object.
* *
* @param string|null $id_user User id. * @param mixed $id_user User id.
* - Username * - Username
*/ */
public function __construct(?string $id_user) public function __construct($id_user)
{ {
$this->table = 'tusuario'; $this->table = 'tusuario';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1020,33 +1020,29 @@ $tableAgents->class = 'info_table tactical_table';
$tableAgents->head = []; $tableAgents->head = [];
$tableAgents->head[0] = '<span>'.__('Agent').'</span>'; $tableAgents->head[0] = '<span>'.__('Agent').'</span>';
$tableAgents->head[0] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown); $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[1] = '<span>'.__('Description').'</span>';
$tableAgents->head[0] .= ui_get_sorting_arrows($url_up_description, $url_down_description, $selectDescriptionUp, $selectDescriptionDown); $tableAgents->head[1] .= ui_get_sorting_arrows($url_up_description, $url_down_description, $selectDescriptionUp, $selectDescriptionDown);
$tableAgents->size[1] = '16%'; $tableAgents->size[1] = '14%';
$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[2] = '<span>'.__('OS').'</span>'; $tableAgents->head[2] = '<span>'.__('OS').'</span>';
$tableAgents->head[2] .= ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown); $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] = '<span>'.__('Interval').'</span>';
$tableAgents->head[3] .= ui_get_sorting_arrows($url_up_interval, $url_down_interval, $selectIntervalUp, $selectIntervalDown); $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] = '<span>'.__('Group').'</span>';
$tableAgents->head[4] .= ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown); $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->head[5] = '<span>'.__('Type').'</span>';
$tableAgents->size[5] = '8%'; $tableAgents->size[5] = '7%';
$tableAgents->head[6] = '<span>'.__('Modules').'</span>'; $tableAgents->head[6] = '<span>'.__('Modules').'</span>';
$tableAgents->size[6] = '10%'; $tableAgents->size[6] = '7%';
$tableAgents->head[7] = '<span>'.__('Status').'</span>'; $tableAgents->head[7] = '<span>'.__('Status').'</span>';
$tableAgents->size[7] = '4%'; $tableAgents->size[7] = '4%';
@ -1056,14 +1052,18 @@ $tableAgents->size[8] = '4%';
$tableAgents->head[9] = '<span>'.__('Last contact').'</span>'; $tableAgents->head[9] = '<span>'.__('Last contact').'</span>';
$tableAgents->head[9] .= ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown); $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] = '<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->head[10] .= ui_get_sorting_arrows($url_up_last_status_change, $url_down_last_status_change, $selectLastStatusChangeUp, $selectLastStatusChangeDown);
$tableAgents->size[10] = '10%'; $tableAgents->size[10] = '10%';
$tableAgents->head[11] = '<span>'.__('Agent events').'</span>'; $tableAgents->head[11] = '<span>'.__('Remote').'</span>';
$tableAgents->size[11] = '4%'; $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 = []; $tableAgents->align = [];
@ -1116,9 +1116,22 @@ foreach ($agents as $agent) {
$data[0] = '<div class="left_'.$agent['id_agente'].'">'; $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( $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), 'content' => ui_print_truncate_text($agent['alias'], 'agent_medium', false, true, true),
], ],
true true
@ -1146,61 +1159,12 @@ foreach ($agents as $agent) {
$data[0] .= '</em>'; $data[0] .= '</em>';
} }
$data[0] .= '<div class="agentleft_'.$agent['id_agente'].'" style="visibility: hidden; clear: left;">'; $data[0] .= '</div>';
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[1] = '<span class="'.$custom_font_size.'">'.ui_print_truncate_text($agent['description'], 'description', false, true, true, '[&hellip;]').'</span>'; $data[1] = '<span class="'.$custom_font_size.'">'.ui_print_truncate_text($agent['description'], 'description', false, true, true, '[&hellip;]').'</span>';
$data[2] = ''; $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( $data[2] = html_print_div(
[ [
'class' => 'invert_filter main_menu_icon', 'class' => 'invert_filter main_menu_icon',
@ -1252,8 +1216,24 @@ foreach ($agents as $agent) {
'status' => -1, '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)); $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', 'images/event.svg',
true, true,
[ [
@ -1263,6 +1243,31 @@ foreach ($agents as $agent) {
] ]
).'</a>'; ).'</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); array_push($tableAgents->data, $data);
} }

View File

@ -176,13 +176,16 @@ if ($total_agentes > 0) {
} }
echo '<table width="100%" class="info_table">'; echo '<table width="100%" class="info_table">';
echo '<thead>';
echo '<tr>'; echo '<tr>';
echo "<th colspan=2 class='center'>".__('Summary of the status groups').'</th>'; echo "<th colspan=2 class='center'>".__('Summary of the status groups').'</th>';
echo '</tr>'; echo '</tr>';
echo '<tr>'; echo '<tr>';
echo "<th width=50% class='center'>".__('Agents').'</th>'; echo "<th class='center'>".__('Agents').'</th>';
echo "<th width=50% class='center'>".__('Modules').'</th>'; echo "<th class='center'>".__('Modules').'</th>';
echo '</tr>'; echo '</tr>';
echo '</thead>';
echo '<tbody>';
echo "<tr height=70px'>"; echo "<tr height=70px'>";
echo "<td align='center'>"; echo "<td align='center'>";
echo "<span id='sumary' class='red_background'>".$total_agent_critical.'%</span>'; 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 "<span id='sumary' class='bg_4a83f3'>".$total_monitor_not_init.'%</span>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</tbody>';
echo '</table>'; echo '</table>';
if ($count == 1) { 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 '<table class="info_table mrgn_top_10px" border="0" width="100%">';
echo '<thead>';
echo '<tr>'; echo '<tr>';
echo '<th colspan=2 ></th>'; echo '<th colspan=2 ></th>';
echo '<th colspan=6>'.__('Agents').'</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'>".__('Critical').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Alert fired').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Alert fired').'</th>';
echo '</tr>'; echo '</tr>';
echo '</thead>';
foreach ($result_groups as $data) { foreach ($result_groups as $data) {
if ((bool) $config['show_empty_groups'] === false 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 (empty($result) === false) {
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
html_print_action_buttons( html_print_action_buttons(
html_print_div(['style' => 'float:left; height: 55px;', 'class' => 'mrgn_top_15px'], true), '',
[ [
'type' => 'form_action', 'type' => 'form_action',
'right_content' => $tablePagination, 'right_content' => $tablePagination,
@ -2229,7 +2229,7 @@ if (empty($result) === false) {
if (is_metaconsole() !== true) { if (is_metaconsole() !== true) {
html_print_action_buttons( html_print_action_buttons(
html_print_div(['style' => 'float:left; height: 55px;'], true), '',
[ [
'type' => 'form_action', 'type' => 'form_action',
'right_content' => $tablePagination, 'right_content' => $tablePagination,

View File

@ -1443,10 +1443,10 @@ $alerttab['active'] = ($tab === 'alert');
// Inventory. // Inventory.
$inventoryCount = db_get_num_rows('SELECT id_agent_module_inventory FROM tagent_module_inventory WHERE id_agente = '.$agent['id_agente']); $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( $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, true,
[ [
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
'title' => __('Inventory'), 'title' => __('Inventory'),
] ]
).'</a>'; ).'</a>';

View File

@ -34,7 +34,24 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
$action = get_parameter('action', 'listeners'); $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()) { if (netflow_print_check_version_error()) {
include $config['homedir'].'/operation/network/network_report.php'; include $config['homedir'].'/operation/network/network_report.php';

View File

@ -62,95 +62,172 @@ $style_period = ($is_period) ? '' : 'display: none;';
// Build the table. // Build the table.
$table = new stdClass(); $table = new stdClass();
$table->class = 'databox filters'; $table->class = 'filter-table-adv';
$table->styleTable = 'width: 100%'; $table->width = '100%';
$table->data['0']['0'] = __('Data to show').'&nbsp;&nbsp;'; $table->data = [];
$table->data['0']['0'] .= html_print_select(
network_get_report_actions(false), $table->data[0][] = html_print_label_input_block(
'action', __('Data to show'),
$action, html_print_select(
'', network_get_report_actions(false),
'', 'action',
0, $action,
true '',
'',
0,
true
)
); );
$table->data['0']['1'] = __('Number of result to show').'&nbsp;&nbsp;'; $table->data[0][] = html_print_label_input_block(
$table->data['0']['1'] .= html_print_select( __('Number of result to show'),
[ html_print_select(
'5' => 5, [
'10' => 10, '5' => 5,
'15' => 15, '10' => 10,
'20' => 20, '15' => 15,
'25' => 25, '20' => 20,
'50' => 50, '25' => 25,
'100' => 100, '50' => 50,
'250' => 250, '100' => 100,
], '250' => 250,
'top', ],
$top, 'top',
'', $top,
'', '',
0, '',
true 0,
true
)
); );
$table->data['0']['2'] = ''; $table->data[1][] = html_print_label_input_block(
__('Start date'),
$table->data['1']['0'] = '<div class="flex">'; html_print_div(
$table->data['1']['0'] .= '<div id="end_date_container" style="'.$style_end.'">'; [
$table->data['1']['0'] .= __('Start date').'&nbsp;&nbsp;'; 'id' => 'end_date_container',
$table->data['1']['0'] .= html_print_input_text('date_lower', $date_lower, '', 10, 7, true); 'content' => html_print_input_text(
$table->data['1']['0'] .= '&nbsp;&nbsp;'; 'date_lower',
$table->data['1']['0'] .= html_print_input_text('time_lower', $time_lower, '', 7, 8, true); $date_lower,
$table->data['1']['0'] .= '</div>'; '',
10,
$table->data['1']['0'] .= '<div id="period_container" style="'.$style_period.'">'; 10,
$table->data['1']['0'] .= __('Time Period').'&nbsp;&nbsp;'; true
$table->data['1']['0'] .= html_print_extended_select_for_time('period', $period, '', '', 0, false, true); ).html_print_input_text(
$table->data['1']['0'] .= '</div>'; 'time_lower',
$table->data['1']['0'] .= html_print_checkbox( $time_lower,
'is_period', '',
1, 7,
($is_period === true) ? 1 : 0, 8,
true, true
false, ),
'network_report_click_period(event)' ],
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][] = html_print_label_input_block(
$table->data['1']['1'] .= html_print_input_text('date_greater', $date_greater, '', 10, 7, true); __('End date'),
$table->data['1']['1'] .= '&nbsp;&nbsp;'; html_print_div(
$table->data['1']['1'] .= html_print_input_text('time_greater', $time_greater, '', 7, 8, true); [
'id' => '',
$table->data['1']['2'] = html_print_submit_button( 'class' => '',
__('Update'), 'content' => html_print_input_text(
'update', 'date_greater',
false, $date_greater,
'class="sub upd"', '',
true 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( $table->data[2][] = html_print_label_input_block(
__('Export to CSV'), __('Defined period'),
'export_csv', html_print_checkbox_switch(
false, 'is_period',
'class="sub next" onclick="blockResumit($(this))"', 1,
true ($is_period === true) ? 1 : 0,
true,
false,
'network_report_click_period(event)'
)
); );
echo '<form method="post">'; echo '<form method="post">';
html_print_input_hidden('order_by', $order_by); 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_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>'; echo '</form>';
// Print the data. // Print the data.
@ -178,7 +255,8 @@ $hidden_main_link = [
unset($table); unset($table);
$table = new stdClass(); $table = new stdClass();
$table->styleTable = 'width: 60%'; $table->id = '';
$table->width = '100%';
// Print the header. // Print the header.
$table->head = []; $table->head = [];
$table->head['main'] = __('IP'); $table->head['main'] = __('IP');
@ -252,20 +330,6 @@ if (get_parameter('export_csv')) {
exit; 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. // Print the data and build the chart.
$table->data = []; $table->data = [];
$chart_data = []; $chart_data = [];
@ -277,7 +341,7 @@ foreach ($data as $item) {
$row['main'] .= $item['host']; $row['main'] .= $item['host'];
if (!$hide_filter) { if (!$hide_filter) {
$row['main'] .= html_print_link_with_params( $row['main'] .= html_print_link_with_params(
'images/filter.png', 'images/filters@svg.svg',
array_merge($hidden_main_link, ['main_value' => $item['host']]), array_merge($hidden_main_link, ['main_value' => $item['host']]),
'image' 'image'
); );
@ -316,9 +380,7 @@ foreach ($data as $item) {
if (empty($data)) { if (empty($data)) {
ui_print_info_message(__('No data found')); ui_print_info_message(__('No data found'));
} else { } else {
echo '<div class="flex mrgn_top_10px">'; // Pie graph options.
html_print_table($table);
$options = [ $options = [
'height' => 230, 'height' => 230,
'legend' => [ 'legend' => [
@ -328,15 +390,35 @@ if (empty($data)) {
], ],
'labels' => $labels, 'labels' => $labels,
]; ];
// Pie graph.
// Print the graph. html_print_div(
echo '<div class="mrgn_top_50px w40p">'; [
echo pie_graph( 'class' => 'databox netflow-pie-graph-container padding-2 white_box',
$chart_data, 'content' => pie_graph(
$options $chart_data,
$options
),
]
); );
echo '</div>'; // Print the filter remove link.
echo '</div>'; 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);
} }
?> ?>