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,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
$outputForm .= ui_toggle(
@ -753,8 +753,8 @@ $outputForm .= ui_toggle(
true,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
$outputForm .= ui_toggle(
@ -765,8 +765,8 @@ $outputForm .= ui_toggle(
true,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
if ((int) $moduletype !== 13) {
@ -784,8 +784,8 @@ if ((int) $moduletype !== 13) {
true,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'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->rowclass['caption_historical_data'] = 'mrgn_top_10px';
$table_simple->data['caption_historical_data'][0] = __('Historical data');
if ($disabledBecauseInPolicy) {
// 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->id = 'module_new_relations';
$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->style = [];
$table_new_relations->style[0] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[1] = 'width: 25%; text-align: center;';
$table_new_relations->style[2] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[3] = 'width: 25%; text-align: center;';
$table_new_relations->style[4] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[5] = 'width: 25%; text-align: center;';
$table_new_relations->size[0] = '25%';
$table_new_relations->size[1] = '25%';
$table_new_relations->size[2] = '25%';
$table_new_relations->size[3] = '25%';
$table_new_relations->data[0][0] = __('Agent');
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
@ -1473,36 +1471,50 @@ $params['use_hidden_input_idagent'] = true;
$params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent';
$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][2] = __('Module');
$table_new_relations->data[0][3] = "<div id='module_autocomplete'></div>";
$table_new_relations->data[0][0] = html_print_label_input_block(
__('Agent'),
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['direct'] = __('Direct');
$array_rel_type['failover'] = __('Failover');
$table_new_relations->data[0][4] = __('Rel. type');
$table_new_relations->data[0][5] = html_print_select(
$array_rel_type,
'relation_type',
'',
'',
'',
0,
true,
false,
true,
''
$table_new_relations->data[0][2] = html_print_label_input_block(
__('Rel. type'),
html_print_select(
$array_rel_type,
'relation_type',
'',
'',
'',
0,
true,
false,
true,
''
)
);
$table_new_relations->data[0][6] = html_print_button(
__('Add relationship'),
'add_relation',
false,
'javascript: add_new_relation();',
'class="sub add"',
true
$table_new_relations->data[0][3] = html_print_label_input_block(
'&nbsp;',
'<div class="inline_line">'.html_print_button(
__('Add relationship'),
'add_relation',
false,
'javascript: add_new_relation();',
[
'class' => 'w150px secondary',
'icon' => 'plus',
],
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.
$table_relations = new stdClass();

View File

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

View File

@ -42,8 +42,6 @@ if (empty($edit_module)) {
}
$data = [];
$data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
if ($page == 'enterprise/godmode/policies/policy_modules') {
if ($ip_target != 'auto' && $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['custom'] = __('Custom');
$data[1] = html_print_select(
$inputs = html_print_select(
$target_ip_values,
'ip_target',
$ip_target,
@ -72,109 +70,171 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
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 {
if ($ip_target == 'auto') {
$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[3] = html_print_input_text(
'tcp_send',
$tcp_send,
'',
5,
20,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('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,
'',
5,
20,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy.' mrgn_top_10px w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p mrgn_right_20px',
]
);
push_table_simple($data, 'target_ip');
$data = [];
$data[0] = __('Username');
$data[1] = html_print_input_text(
'plugin_user',
$plugin_user,
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('Username'),
html_print_input_text(
'plugin_user',
$plugin_user,
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy.' w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$data[2] = __('Password');
$data[3] = html_print_input_password(
'plugin_pass',
'',
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
$classdisabledBecauseInPolicy,
'new-password'
$data[2] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'plugin_pass',
'',
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
$classdisabledBecauseInPolicy.' w100p',
'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');
$data = [];
$data[0] = __('WMI query');
$data[1] = html_print_input_text(
'snmp_oid',
$snmp_oid,
'',
35,
255,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('WMI query'),
html_print_input_text(
'snmp_oid',
$snmp_oid,
'',
35,
255,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$table_simple->colspan['wmi_query'][1] = 3;
$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),
html_print_input_text(
'snmp_community',
$snmp_community,
'',
20,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$table_simple->rowclass['wmi_query'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'wmi_query');
$data = [];
$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,
'',
20,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$data[2] = __('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true);
$data[3] = html_print_input_text(
'tcp_port',
$tcp_port,
'',
5,
15,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$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,
'',
5,
15,
true,
$disabledBecauseInPolicy,
false,
'',
$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');
?>
<script type="text/javascript">
@ -191,11 +251,6 @@ $(document).ready (function () {
$("#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>

View File

@ -228,11 +228,24 @@ if (isset($_GET['server']) === true) {
$advanced_editor = false;
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>";
echo '<td class="w100p">';
echo __('Dynamic search').'&nbsp;&nbsp;';
html_print_input_text('search_config_token', $search, '', 12);
echo html_print_label_input_block(
__('Dynamic search'),
html_print_input_text(
'search_config_token',
$search,
'',
12,
255,
true,
false,
false,
'',
'w400px'
)
);
echo '</td>';
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] .= html_print_image(
'images/remote_configuration@svg.svg',
'images/remote-configuration@svg.svg',
true,
[
'title' => __('Remote configuration'),

View File

@ -162,7 +162,7 @@ class SatelliteAgent extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $column_names,
'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) {
@ -213,10 +214,7 @@ class SatelliteAgent extends HTML
echo $modal.$msg.$aux;
echo '<div style="display: flex;justify-content: space-between;">';
echo '<div class="flex-content-left">';
html_print_select(
$select = html_print_select(
[
'0' => 'Disable / Enable selected agents',
'1' => 'Delete / Create selected agents',
@ -226,30 +224,32 @@ class SatelliteAgent extends HTML
'',
'',
0,
false,
true,
false,
false
);
html_print_submit_button(
$execute = html_print_submit_button(
__('Execute action'),
'submit_satellite_action',
false,
'class="sub next"'
[
'icon' => 'cog',
'class' => 'secondary',
],
true
);
echo '</div>';
// Create button add host.
echo '<div class="flex-content-right">';
html_print_submit_button(
$add = html_print_submit_button(
__('Add host'),
'create',
false,
'class="sub next"'
['icon' => 'next'],
true
);
echo '</div>';
echo '</div>';
html_print_action_buttons($add.$execute.$select);
// Load own javascript file.
echo $this->loadJS();
@ -503,6 +503,7 @@ class SatelliteAgent extends HTML
'arguments' => [
'name' => 'address',
'type' => 'text',
'class' => 'w100p',
'value' => $values['address'],
'return' => true,
],
@ -514,6 +515,7 @@ class SatelliteAgent extends HTML
'arguments' => [
'name' => 'name',
'type' => 'text',
'class' => 'w100p',
'value' => $values['name'],
'return' => true,
],
@ -1244,7 +1246,7 @@ class SatelliteAgent extends HTML
$('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 action = $('#satellite_action').val();
let agent_delete_error = [];

View File

@ -142,7 +142,7 @@ class SatelliteCollection extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,
@ -164,10 +164,12 @@ class SatelliteCollection extends HTML
'label' => __('Search'),
'type' => 'text',
'name' => 'filter_search',
'class' => 'w400px',
'size' => 12,
],
],
],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
]
);
} catch (Exception $e) {
@ -176,6 +178,7 @@ class SatelliteCollection extends HTML
echo '<div id="aux" class="invisible"></div>';
echo '<div id="msg" class="invisible"></div>';
html_print_action_buttons('');
// Load own javascript file.
echo $this->loadJS();

View File

@ -11462,31 +11462,6 @@ p.trademark-copyright {
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 {
font-size: 8pt;
color: #8a96a6;
@ -11766,3 +11741,7 @@ div.relative > div > div#ui-datepicker-div {
.container-div-input-password:has(.w400px-important) {
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;
}
td[id^="basic_thresholds-"] .switch_radio_button > label[id^="label-radius"] {
line-height: 26px;
}
.mgn_tp_0_imp {
margin-top: 0px !important;
}
@ -823,3 +827,13 @@ div[id^="auto-os-"] > img {
.w22px {
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%;
}