restyling

This commit is contained in:
daniel 2023-02-23 16:30:18 +01:00
parent 929680eb17
commit 1be0fb94b0
2 changed files with 109 additions and 98 deletions

View File

@ -21,111 +21,128 @@
*/ */
function print_filters($sec) function print_filters($sec)
{ {
global $config;
$table = new StdClass(); $table = new StdClass();
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 0; $table->rowspan = [];
$table->cellpadding = 0; $table->size = [];
$table->class = 'databox filters'; $table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[2] = '33%';
$table->class = 'filter-table-adv';
if ($sec === 'view') { if ($sec === 'view') {
$table->style[0] = 'font-weight: bold;'; $table->data[0][0] = html_print_label_input_block(
$table->style[1] = 'font-weight: bold;'; __('Group'),
$table->style[2] = 'font-weight: bold;'; html_print_select_groups(
$table->style[3] = 'font-weight: bold;'; $config['id_user'],
$table->style[4] = 'font-weight: bold;'; 'AR',
true,
$table->data[0][0] = __('Group'); 'group_id',
$table->data[0][1] .= html_print_select_groups( '',
$config['id_user'], '',
'AR', '',
true, '0',
'group_id', true,
$ag_group, false,
'', false,
'', '',
'0', false,
true, '',
false, false,
false, false,
'', 'id_grupo',
false, false
'', )
false,
false,
'id_grupo',
false
); );
$table->data[0][2] = __('Recursion'); $table->data[0][0] .= html_print_label_input_block(
__('Recursion'),
$table->data[0][2] .= html_print_input( html_print_input(
[
'type' => 'switch',
'name' => 'recursion',
'return' => true,
'checked' => false,
'value' => 1,
]
),
[ [
'type' => 'checkbox', 'div_class' => 'add-input-reverse',
'name' => 'recursion', 'label_class' => 'label-thin',
'return' => true,
'checked' => $recursion,
'value' => 1,
] ]
); );
$table->rowspan[0][1] = 2;
$table->data[1][0] = __('Filter Agents'); $table->data[0][1] = html_print_label_input_block(
$table->data[1][1] = html_print_input_text('filter_agents', '', '', 20, 255, true); __('Agents'),
html_print_select(
$table->data[2][0] = __('Agents'); [],
'selected_agents[]',
if (empty($agents) === true || $agents == -1) { '',
$agents = []; '',
} '',
0,
$table->data[2][1] = html_print_select( true,
[], true,
'selected_agents[]', true,
'', '',
'', false,
'', 'width:100%'
0, )
true,
true,
true,
'',
false,
'min-width: 180px; max-width: 200px;'
); );
// Interfaces. $table->rowspan[0][2] = 2;
$table->data[2][3] = '<b>'.__('Interfaces').'</b>'; $table->data[0][2] = html_print_label_input_block(
$table->data[2][4] = html_print_select( __('Interfaces'),
[], html_print_select(
'selected_interfaces[]', [],
$selected_interfaces, 'selected_interfaces[]',
'', '',
'', '',
0, '',
true, 0,
true, true,
true, true,
'', true,
false, '',
'min-width: 180px; max-width: 200px;' false,
'width:100%'
)
); );
$filters = '<form method="post" action="'.ui_get_url_refresh( $table->data[1][0] = html_print_label_input_block(
[ __('Filter Agents'),
'selected_agents' => $selected_agents, html_print_input_text(
'selected_interfaces' => $selected_interfaces, 'filter_agents',
'selected_group_id' => $selected_group_id, '',
] '',
).'">'; 20,
255,
true
)
);
$filters = '<form method="post" action="'.ui_get_url_refresh().'">';
$filters .= html_print_table($table, true); $filters .= html_print_table($table, true);
$filters .= "<div class='height_100p right'>".html_print_submit_button( $filters .= html_print_div(
__('Show'), [
'uptbutton', 'class' => 'action-buttons',
false, 'content' => html_print_submit_button(
'class="sub search mgn_tp_0"', __('Filter'),
'srcbutton',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true true
).'</div>'; );
$filters .= '</form>'; $filters .= '</form>';
} else { } else {
@ -135,7 +152,7 @@ function print_filters($sec)
$table->data[0][1] = html_print_select( $table->data[0][1] = html_print_select(
[], [],
'selected_interfaces[]', 'selected_interfaces[]',
$selected_interfaces, '',
'', '',
'', '',
0, 0,
@ -147,13 +164,7 @@ function print_filters($sec)
'min-width: 180px; max-width: 200px;' 'min-width: 180px; max-width: 200px;'
); );
$filters = '<form method="post" action="'.ui_get_url_refresh( $filters = '<form method="post" action="'.ui_get_url_refresh().'">';
[
'selected_agents' => $selected_agents,
'selected_interfaces' => $selected_interfaces,
'selected_group_id' => $selected_group_id,
]
).'">';
$filters .= html_print_table($table, true); $filters .= html_print_table($table, true);
@ -170,7 +181,7 @@ function print_filters($sec)
ui_toggle( ui_toggle(
$filters, $filters,
__('Interface filter'), '<span class="subsection_header_title">'.__('Interface filter').'</span>',
__('Interface filter'), __('Interface filter'),
'ui_toggle_if_filter', 'ui_toggle_if_filter',
true, true,

View File

@ -99,7 +99,7 @@ if ($autosearch === true) {
$result = agents_get_network_interfaces($selected_agents); $result = agents_get_network_interfaces($selected_agents);
} }
if ($result === false) { if ($result === false || empty($result) === true) {
$result = []; $result = [];
} else { } else {
ui_pagination( ui_pagination(