Minor patches

This commit is contained in:
Jose Gonzalez 2023-02-13 17:35:54 +01:00
parent 2f673487f5
commit 31f6c9a9d9
2 changed files with 145 additions and 86 deletions

View File

@ -41,12 +41,24 @@ if (is_metaconsole() === true) {
}
} else {
$sec = 'gmodules';
ui_print_page_header(
__('Module management').' » '.__('Inventory modules'),
ui_print_standard_header(
__('Inventory modules'),
'images/page_white_text.png',
false,
'',
true
true,
[],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Inventory modules'),
],
]
);
if ($management_allowed === false) {
@ -266,7 +278,7 @@ if ($create_module_inventory === true) {
$total_modules = db_get_sql('SELECT COUNT(*) FROM tmodule_inventory');
$table = new stdClass();
$table->width = '100%';
$table->styleTable = 'margin: 10px 10px 0; width: -webkit-fill-available';
$table->class = 'info_table';
$table->size = [];
$table->size[0] = '140px';
@ -302,9 +314,15 @@ if ($result === false) {
$data[1] = $row['description'];
if ($row['os_name'] == null) {
$data[2] = html_print_image('images/agent.png', true, ['border' => '0', 'alt' => __('Agent'), 'title' => __('Agent'), 'height' => '18', 'class' => 'invert_filter']);
$data[2] = html_print_image('images/agents@svg.svg', true, ['border' => '0', 'alt' => __('Agent'), 'title' => __('Agent'), 'height' => '18', 'class' => 'invert_filter main_menu_icon']);
} else {
$data[2] = ui_print_os_icon($row['id_os'], false, true);
$data[2] = html_print_div(
[
'class' => 'invert_filter main_menu_icon',
'content' => ui_print_os_icon($row['id_os'], false, true),
],
true
);
}
if ($row['interpreter'] == '') {
@ -328,30 +346,34 @@ if ($result === false) {
array_push($table->data, $data);
}
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_inventory_modules'>";
echo '<form id="form_delete" method="POST" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules">';
html_print_input_hidden('multiple_delete', 1);
ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset);
html_print_table($table);
ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, false, 'offset', true, 'pagination-bottom');
echo "<div class='pdd_l_5px float-right'>";
echo '</form>';
$tablePagination = ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, true, 'offset', false);
$actionButtons = [];
if ($management_allowed === true) {
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
$actionButtons[] = html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'form_delete'], true);
$actionButtons[] = html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand', 'form' => 'form_create'], true);
$actionButtons[] = '<form id="form_create" method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">';
$actionButtons[] = html_print_input_hidden('create_module_inventory', 1, true);
$actionButtons[] = '<form>';
}
echo '</div>';
echo '</form>';
}
if ($management_allowed === true) {
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">';
echo '<div class="float-right mrgn_btn_15px">';
html_print_input_hidden('create_module_inventory', 1);
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"');
echo '</div>';
echo '</form>';
html_print_action_buttons(
implode('', $actionButtons),
[
'type' => 'form_action',
'right_content' => $tablePagination,
],
false
);
}
if (is_metaconsole() === true) {
enterprise_hook('close_meta_frame');
echo '<div id="deploy_messages" class="invisible">';

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -287,16 +287,25 @@ if (is_metaconsole() === true) {
$help_header = 'network_component_tab';
}
ui_print_page_header(
__('Module management').' &raquo; '.__('Remote component management'),
ui_print_standard_header(
__('Remote component management'),
'',
false,
$help_header,
true,
'',
false,
'modulemodal'
[],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Templates'),
],
]
);
$sec = 'gmodules';
}
@ -712,7 +721,6 @@ $total_components = network_components_get_network_components(
'COUNT(*) AS total'
);
$total_components = $total_components[0]['total'];
ui_pagination($total_components, $url);
$filter['offset'] = (int) get_parameter('offset');
$filter['limit'] = (int) $config['block_size'];
$components = network_components_get_network_components(
@ -735,7 +743,7 @@ if ($components === false) {
}
$table = new stdClass();
$table->width = '100%';
$table->styleTable = 'margin: 10px 10px 0; width: -webkit-fill-available';
$table->head = [];
$table->class = 'info_table';
if ($is_management_allowed === true) {
@ -807,58 +815,60 @@ foreach ($components as $component) {
if ($is_management_allowed === true) {
$table->cellclass[][6] = 'table_action_buttons';
$data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image(
'images/copy.png',
$data[6] = html_print_anchor(
[
'href' => $url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'],
'content' => html_print_image(
'images/copy.svg',
true,
[
'alt' => __('Duplicate'),
'title' => __('Duplicate'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>';
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
'images/cross.png',
),
],
true
);
$data[6] .= html_print_anchor(
[
'href' => $url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string,
'onClick' => 'if (! confirm (\''.__('Are you sure?').'\')) return false',
'content' => html_print_image(
'images/delete.svg',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>';
),
],
true
);
}
array_push($table->data, $data);
}
if (isset($data) === true) {
if ($is_management_allowed === true) {
echo "<form method='post' action='index.php?sec=".$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure."'>";
html_print_input_hidden('multiple_delete', 1);
}
html_print_table($table);
ui_pagination(
$tablePagination = ui_pagination(
$total_components,
$url,
0,
0,
false,
'offset',
true,
'pagination-bottom'
);
if ($is_management_allowed === true) {
echo "<div id='btn_delete_5' class='float-right'>";
html_print_submit_button(
__('Delete'),
'delete_btn',
false,
'class="sub delete"'
);
echo '</div>';
echo '</form>';
}
} else {
'offset',
false
);
echo '<form id="form_delete" method="POST" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure.'">';
html_print_table($table);
html_print_input_hidden('multiple_delete', 1);
echo '</form>';
$actionButtons = [];
if (isset($data) === false) {
ui_print_info_message(
[
'no_close' => true,
@ -868,10 +878,31 @@ if (isset($data) === true) {
}
if ($is_management_allowed === true) {
echo '<form method="post" action="'.$url.'">';
echo '<div class="right_align mrgn_btn_15px">';
html_print_input_hidden('new_component', 1);
html_print_select(
$actionButtons[] = html_print_submit_button(
__('Create'),
'crt',
false,
[
'icon' => 'wand',
'form' => 'form_create',
],
true
);
$actionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'icon' => 'delete',
'mode' => 'secondary',
'form' => 'form_delete',
],
true
);
// Create.
$actionButtons[] = '<form style="z-index: 10" id="form_create" method="post" action="'.$url.'">';
$actionButtons[] = html_print_input_hidden('new_component', 1, true);
$actionButtons[] = html_print_select(
[
COMPONENT_TYPE_NETWORK => __('Create a new network component'),
COMPONENT_TYPE_PLUGIN => __('Create a new plugin component'),
@ -883,18 +914,24 @@ if ($is_management_allowed === true) {
'',
'',
'',
''
);
html_print_submit_button(
__('Create'),
'crt',
true,
false,
'class="sub next mrgn_lft_5px"'
true,
'',
false,
'z-index: 10'
);
echo '</div>';
echo '</form>';
$actionButtons[] = '</form>';
}
html_print_action_buttons(
implode('', $actionButtons),
[
'type' => 'form_action',
'right_content' => $tablePagination,
]
);
enterprise_hook('close_meta_frame');
?>