wux and wmi

This commit is contained in:
Pablo Aragon 2023-03-27 17:03:38 +02:00
parent abf9fcf200
commit 55ff0e0597
10 changed files with 249 additions and 173 deletions

View File

@ -741,8 +741,8 @@ $outputForm .= ui_toggle(
false, false,
true, true,
'', '',
'', 'white-box-content no_border',
'box-flat white_table_flex white_table_graph_fixed' 'filter-datatable-main box-flat white_table_graph'
); );
$outputForm .= ui_toggle( $outputForm .= ui_toggle(
@ -753,8 +753,8 @@ $outputForm .= ui_toggle(
true, true,
true, true,
'', '',
'', 'white-box-content no_border',
'box-flat white_table_flex white_table_graph_fixed' 'filter-datatable-main box-flat white_table_graph'
); );
$outputForm .= ui_toggle( $outputForm .= ui_toggle(
@ -765,8 +765,8 @@ $outputForm .= ui_toggle(
true, true,
true, true,
'', '',
'', 'white-box-content no_border',
'box-flat white_table_flex white_table_graph_fixed' 'filter-datatable-main box-flat white_table_graph'
); );
if ((int) $moduletype !== 13) { if ((int) $moduletype !== 13) {
@ -784,8 +784,8 @@ if ((int) $moduletype !== 13) {
true, true,
true, true,
'', '',
'', 'white-box-content no_border',
'box-flat white_table_flex white_table_graph_fixed' 'filter-datatable-main box-flat white_table_graph'
); );
} }

View File

@ -615,6 +615,7 @@ if (modules_is_string_type($id_module_type) === false || (bool) $edit === true)
$table_simple->data['thresholds_table'][1] = '<svg id="svg_dinamic" width="500" height="300"> </svg>'; $table_simple->data['thresholds_table'][1] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
} }
$table_simple->rowclass['caption_historical_data'] = 'mrgn_top_10px';
$table_simple->data['caption_historical_data'][0] = __('Historical data'); $table_simple->data['caption_historical_data'][0] = __('Historical data');
if ($disabledBecauseInPolicy) { if ($disabledBecauseInPolicy) {
// If is disabled, we send a hidden in his place and print a false // If is disabled, we send a hidden in his place and print a false
@ -1454,17 +1455,14 @@ html_print_input_hidden('module_macro_count', $macro_count);
$table_new_relations = new stdClass(); $table_new_relations = new stdClass();
$table_new_relations->id = 'module_new_relations'; $table_new_relations->id = 'module_new_relations';
$table_new_relations->width = '100%'; $table_new_relations->width = '100%';
$table_new_relations->class = 'no-class'; $table_new_relations->class = 'no-class filter-table-adv';
$table_new_relations->data = []; $table_new_relations->data = [];
$table_new_relations->style = []; $table_new_relations->style = [];
$table_new_relations->style[0] = 'width: 10%; font-weight: bold;'; $table_new_relations->size[0] = '25%';
$table_new_relations->style[1] = 'width: 25%; text-align: center;'; $table_new_relations->size[1] = '25%';
$table_new_relations->style[2] = 'width: 10%; font-weight: bold;'; $table_new_relations->size[2] = '25%';
$table_new_relations->style[3] = 'width: 25%; text-align: center;'; $table_new_relations->size[3] = '25%';
$table_new_relations->style[4] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[5] = 'width: 25%; text-align: center;';
$table_new_relations->data[0][0] = __('Agent');
$params = []; $params = [];
$params['return'] = true; $params['return'] = true;
$params['show_helptip'] = true; $params['show_helptip'] = true;
@ -1473,15 +1471,23 @@ $params['use_hidden_input_idagent'] = true;
$params['print_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent'; $params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent';
$params['javascript_function_action_after_select_js_call'] = 'change_modules_autocomplete_input();'; $params['javascript_function_action_after_select_js_call'] = 'change_modules_autocomplete_input();';
$table_new_relations->data[0][1] = ui_print_agent_autocomplete_input($params); $table_new_relations->data[0][0] = html_print_label_input_block(
$table_new_relations->data[0][2] = __('Module'); __('Agent'),
$table_new_relations->data[0][3] = "<div id='module_autocomplete'></div>"; ui_print_agent_autocomplete_input($params)
);
$table_new_relations->data[0][1] = html_print_label_input_block(
__('Module'),
"<div id='module_autocomplete'></div>"
);
$array_rel_type = []; $array_rel_type = [];
$array_rel_type['direct'] = __('Direct'); $array_rel_type['direct'] = __('Direct');
$array_rel_type['failover'] = __('Failover'); $array_rel_type['failover'] = __('Failover');
$table_new_relations->data[0][4] = __('Rel. type');
$table_new_relations->data[0][5] = html_print_select( $table_new_relations->data[0][2] = html_print_label_input_block(
__('Rel. type'),
html_print_select(
$array_rel_type, $array_rel_type,
'relation_type', 'relation_type',
'', '',
@ -1492,17 +1498,23 @@ $table_new_relations->data[0][5] = html_print_select(
false, false,
true, true,
'' ''
)
); );
$table_new_relations->data[0][6] = html_print_button( $table_new_relations->data[0][3] = html_print_label_input_block(
'&nbsp;',
'<div class="inline_line">'.html_print_button(
__('Add relationship'), __('Add relationship'),
'add_relation', 'add_relation',
false, false,
'javascript: add_new_relation();', 'javascript: add_new_relation();',
'class="sub add"', [
'class' => 'w150px secondary',
'icon' => 'plus',
],
true true
)."<div id='add_relation_status' class='inline_line'></div></div>"
); );
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' class='inline_line'></div>";
// Relationship list. // Relationship list.
$table_relations = new stdClass(); $table_relations = new stdClass();

View File

@ -152,9 +152,7 @@ foreach ($password_fields as $k => $p) {
load_plugin_macros_fields('simple-macro'); load_plugin_macros_fields('simple-macro');
forced_title_callback(); forced_title_callback();
}
$(document).ready(function () { $('select#id_plugin').select2('close');
observerInputPassword(); }
});
</script> </script>

View File

@ -42,8 +42,6 @@ if (empty($edit_module)) {
} }
$data = []; $data = [];
$data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
if ($page == 'enterprise/godmode/policies/policy_modules') { if ($page == 'enterprise/godmode/policies/policy_modules') {
if ($ip_target != 'auto' && $ip_target != '') { if ($ip_target != 'auto' && $ip_target != '') {
$custom_ip_target = $ip_target; $custom_ip_target = $ip_target;
@ -60,7 +58,7 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
$target_ip_values['force_pri'] = __('Force primary key'); $target_ip_values['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom'); $target_ip_values['custom'] = __('Custom');
$data[1] = html_print_select( $inputs = html_print_select(
$target_ip_values, $target_ip_values,
'ip_target', 'ip_target',
$ip_target, $ip_target,
@ -72,20 +70,41 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
false, false,
'', '',
false, false,
'width:200px;' 'width: 100%; margin-top: 10px;'
); );
$data[1] .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 15, 60, true); $inputs .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 15, 60, true);
} else { } else {
if ($ip_target == 'auto') { if ($ip_target == 'auto') {
$ip_target = agents_get_address($id_agente); $ip_target = agents_get_address($id_agente);
} }
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true); $inputs = html_print_input_text(
'ip_target',
$ip_target,
'',
15,
60,
true,
false,
false,
'',
'mrgn_top_10px w100p'
);
} }
$data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true); $data[0] = html_print_label_input_block(
$data[3] = html_print_input_text( __('Target IP').' <span class="help_icon_15px">'.ui_print_help_icon('wmi_module_tab', true),
$inputs,
[
'label_class' => 'font-title-font',
'div_class' => 'w100p mrgn_right_20px',
]
);
$data[2] = html_print_label_input_block(
__('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true),
html_print_input_text(
'tcp_send', 'tcp_send',
$tcp_send, $tcp_send,
'', '',
@ -95,13 +114,19 @@ $data[3] = html_print_input_text(
$disabledBecauseInPolicy, $disabledBecauseInPolicy,
false, false,
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy.' mrgn_top_10px w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p mrgn_right_20px',
]
); );
push_table_simple($data, 'target_ip'); push_table_simple($data, 'target_ip');
$data = []; $data = [];
$data[0] = __('Username'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('Username'),
html_print_input_text(
'plugin_user', 'plugin_user',
$plugin_user, $plugin_user,
'', '',
@ -111,10 +136,17 @@ $data[1] = html_print_input_text(
$disabledBecauseInPolicy, $disabledBecauseInPolicy,
false, false,
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy.' w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
); );
$data[2] = __('Password');
$data[3] = html_print_input_password( $data[2] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'plugin_pass', 'plugin_pass',
'', '',
'', '',
@ -123,15 +155,23 @@ $data[3] = html_print_input_password(
true, true,
$disabledBecauseInPolicy, $disabledBecauseInPolicy,
false, false,
$classdisabledBecauseInPolicy, $classdisabledBecauseInPolicy.' w100p',
'new-password' 'new-password',
true
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
); );
$table_simple->rowclass['user_pass'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'user_pass'); push_table_simple($data, 'user_pass');
$data = []; $data = [];
$data[0] = __('WMI query'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('WMI query'),
html_print_input_text(
'snmp_oid', 'snmp_oid',
$snmp_oid, $snmp_oid,
'', '',
@ -142,14 +182,16 @@ $data[1] = html_print_input_text(
false, false,
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
); );
$table_simple->colspan['wmi_query'][1] = 3;
push_table_simple($data, 'wmi_query'); $data[2] = html_print_label_input_block(
__('Key string').ui_print_help_tip(__('Optional. Substring to look for in the WQL query result. The module returns 1 if found, 0 if not.'), true),
$data = []; html_print_input_text(
$data[0] = __('Key string').ui_print_help_tip(__('Optional. Substring to look for in the WQL query result. The module returns 1 if found, 0 if not.'), true);
$data[1] = html_print_input_text(
'snmp_community', 'snmp_community',
$snmp_community, $snmp_community,
'', '',
@ -160,9 +202,20 @@ $data[1] = html_print_input_text(
false, false,
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
); );
$data[2] = __('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true); $table_simple->rowclass['wmi_query'] = 'w100p mrgn_top_10px';
$data[3] = html_print_input_text(
push_table_simple($data, 'wmi_query');
$data = [];
$data[0] = html_print_label_input_block(
__('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true),
html_print_input_text(
'tcp_port', 'tcp_port',
$tcp_port, $tcp_port,
'', '',
@ -172,9 +225,16 @@ $data[3] = html_print_input_text(
$disabledBecauseInPolicy, $disabledBecauseInPolicy,
false, false,
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy.' mrgn_right_20px'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w50p display-grid',
]
); );
$table_simple->rowclass['key_field'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'key_field'); push_table_simple($data, 'key_field');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
@ -191,11 +251,6 @@ $(document).ready (function () {
$("#text-custom_ip_target").hide(); $("#text-custom_ip_target").hide();
} }
}); });
// Add input password values with js to hide it in browser inspector.
$('#password-plugin_pass').val('<?php echo $plugin_pass; ?>');
observerInputPassword();
}); });
</script> </script>

View File

@ -228,11 +228,24 @@ if (isset($_GET['server']) === true) {
$advanced_editor = false; $advanced_editor = false;
if ($server_type === 13) { if ($server_type === 13) {
echo "<table cellpadding='4' cellspacing='4' class='databox filters font_bold margin-bottom-10' width='100%'> echo "<table cellpadding='4' cellspacing='4' class='databox filters margin-bottom-10 max_floating_element_size filter-table-adv'>
<tr>"; <tr>";
echo '<td class="w100p">'; echo '<td class="w100p">';
echo __('Dynamic search').'&nbsp;&nbsp;'; echo html_print_label_input_block(
html_print_input_text('search_config_token', $search, '', 12); __('Dynamic search'),
html_print_input_text(
'search_config_token',
$search,
'',
12,
255,
true,
false,
false,
'',
'w400px'
)
);
echo '</td>'; echo '</td>';
echo '</tr></table>'; echo '</tr></table>';
} }

View File

@ -254,7 +254,7 @@ foreach ($servers as $server) {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">'; $data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/remote_configuration@svg.svg', 'images/remote-configuration@svg.svg',
true, true,
[ [
'title' => __('Remote configuration'), 'title' => __('Remote configuration'),

View File

@ -162,7 +162,7 @@ class SatelliteAgent 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,
@ -200,6 +200,7 @@ class SatelliteAgent extends HTML
], ],
], ],
], ],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
] ]
); );
} catch (Exception $e) { } catch (Exception $e) {
@ -213,10 +214,7 @@ class SatelliteAgent extends HTML
echo $modal.$msg.$aux; echo $modal.$msg.$aux;
echo '<div style="display: flex;justify-content: space-between;">'; $select = html_print_select(
echo '<div class="flex-content-left">';
html_print_select(
[ [
'0' => 'Disable / Enable selected agents', '0' => 'Disable / Enable selected agents',
'1' => 'Delete / Create selected agents', '1' => 'Delete / Create selected agents',
@ -226,30 +224,32 @@ class SatelliteAgent extends HTML
'', '',
'', '',
0, 0,
false, true,
false, false,
false false
); );
html_print_submit_button( $execute = html_print_submit_button(
__('Execute action'), __('Execute action'),
'submit_satellite_action', 'submit_satellite_action',
false, false,
'class="sub next"' [
'icon' => 'cog',
'class' => 'secondary',
],
true
); );
echo '</div>';
// Create button add host. // Create button add host.
echo '<div class="flex-content-right">'; $add = html_print_submit_button(
html_print_submit_button(
__('Add host'), __('Add host'),
'create', 'create',
false, false,
'class="sub next"' ['icon' => 'next'],
true
); );
echo '</div>';
echo '</div>'; html_print_action_buttons($add.$execute.$select);
// Load own javascript file. // Load own javascript file.
echo $this->loadJS(); echo $this->loadJS();
@ -503,6 +503,7 @@ class SatelliteAgent extends HTML
'arguments' => [ 'arguments' => [
'name' => 'address', 'name' => 'address',
'type' => 'text', 'type' => 'text',
'class' => 'w100p',
'value' => $values['address'], 'value' => $values['address'],
'return' => true, 'return' => true,
], ],
@ -514,6 +515,7 @@ class SatelliteAgent extends HTML
'arguments' => [ 'arguments' => [
'name' => 'name', 'name' => 'name',
'type' => 'text', 'type' => 'text',
'class' => 'w100p',
'value' => $values['name'], 'value' => $values['name'],
'return' => true, 'return' => true,
], ],
@ -1244,7 +1246,7 @@ class SatelliteAgent extends HTML
$('input[name*=check_]').prop('checked', check); $('input[name*=check_]').prop('checked', check);
}); });
$('#submit-submit_satellite_action').click(function() { $('#button-submit_satellite_action').click(function() {
const checks = $('input[name*=check_]:checked'); const checks = $('input[name*=check_]:checked');
const action = $('#satellite_action').val(); const action = $('#satellite_action').val();
let agent_delete_error = []; let agent_delete_error = [];

View File

@ -142,7 +142,7 @@ class SatelliteCollection 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,
@ -164,10 +164,12 @@ class SatelliteCollection extends HTML
'label' => __('Search'), 'label' => __('Search'),
'type' => 'text', 'type' => 'text',
'name' => 'filter_search', 'name' => 'filter_search',
'class' => 'w400px',
'size' => 12, 'size' => 12,
], ],
], ],
], ],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
] ]
); );
} catch (Exception $e) { } catch (Exception $e) {
@ -176,6 +178,7 @@ class SatelliteCollection extends HTML
echo '<div id="aux" class="invisible"></div>'; echo '<div id="aux" class="invisible"></div>';
echo '<div id="msg" class="invisible"></div>'; echo '<div id="msg" class="invisible"></div>';
html_print_action_buttons('');
// Load own javascript file. // Load own javascript file.
echo $this->loadJS(); echo $this->loadJS();

View File

@ -11462,31 +11462,6 @@ p.trademark-copyright {
height: 24px; height: 24px;
} }
form#satellite_conf_edit {
display: flex;
flex-direction: row;
justify-items: baseline;
justify-content: space-between;
flex-wrap: wrap;
}
form#satellite_conf_edit > fieldset {
background-color: #fff;
// border: 1px solid #e2e2e2;
padding: 0.5em;
margin: 0px 1em;
margin-bottom: 20px;
position: relative;
border-radius: 5px;
flex: 1 1 700px;
}
form#satellite_conf_edit > fieldset.full-column {
width: 100%;
flex: none;
margin: 0 0 20px;
}
.input_sub_placeholder { .input_sub_placeholder {
font-size: 8pt; font-size: 8pt;
color: #8a96a6; color: #8a96a6;
@ -11766,3 +11741,7 @@ div.relative > div > div#ui-datepicker-div {
.container-div-input-password:has(.w400px-important) { .container-div-input-password:has(.w400px-important) {
width: 400px; width: 400px;
} }
span.help_icon_15px > img {
height: 15px !important;
}

View File

@ -741,6 +741,10 @@ tr.datos2 > td.datos2 > div > div > label {
line-height: 16px; line-height: 16px;
} }
td[id^="basic_thresholds-"] .switch_radio_button > label[id^="label-radius"] {
line-height: 26px;
}
.mgn_tp_0_imp { .mgn_tp_0_imp {
margin-top: 0px !important; margin-top: 0px !important;
} }
@ -823,3 +827,13 @@ div[id^="auto-os-"] > img {
.w22px { .w22px {
width: 22px; width: 22px;
} }
table#simple.floating_form tr[id^="simple-plugin_"],
table#simple.floating_form tr[id^="simple-macro_field"] {
display: grid;
margin-bottom: 10px;
}
table#simple.floating_form tr[id^="simple-macro_field"] > td > input {
width: 50%;
}