Merge branch 'ent-11713-bugs-de-visualizacion-de-los-botones-de-accion-en-metaconsola-y-consola' into 'develop'

Ent 11713 bugs de visualizacion de los botones de accion en metaconsola y consola

See merge request artica/pandorafms!6249
This commit is contained in:
Rafael Ameijeiras 2023-08-04 06:34:35 +00:00
commit b2821c0db3
9 changed files with 90 additions and 43 deletions

View File

@ -807,12 +807,12 @@ foreach ($commands as $command) {
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group. // (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) { if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
if (is_user_admin($config['id_user']) === true) { if (is_user_admin($config['id_user']) === true) {
$data['action'] = '<span class="inline_flex">'; $data['action'] = '<span class="inline_flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'" $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'; onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter ', 'title' => 'Duplicate']).'</a>';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset_delete.'" $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset_delete.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'; onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter', 'title' => 'Delete']).'</a>';
$data['action'] .= '</span>'; $data['action'] .= '</span>';
} }
} }

View File

@ -912,7 +912,10 @@ foreach ($simple_alerts as $alert) {
1, 1,
'padding:0px; width: 22px; height: 22px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] [
'class' => 'invert_filter main_menu_icon',
'title' => __('Enable'),
]
); );
$data[4] .= html_print_input_hidden('enable_alert', 1, true); $data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else { } else {
@ -922,7 +925,10 @@ foreach ($simple_alerts as $alert) {
1, 1,
'padding:0px; width: 22px; height: 22px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'main_menu_icon'] [
'class' => 'invert filter main_menu_icon',
'title' => __('Disable'),
]
); );
$data[4] .= html_print_input_hidden('disable_alert', 1, true); $data[4] .= html_print_input_hidden('disable_alert', 1, true);
} }
@ -940,7 +946,10 @@ foreach ($simple_alerts as $alert) {
1, 1,
'padding:0px; width: 22px; height: 22px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] [
'class' => 'invert_filter main_menu_icon',
'title' => __('Standby off'),
]
); );
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true); $data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
} else { } else {
@ -950,7 +959,10 @@ foreach ($simple_alerts as $alert) {
1, 1,
'padding:0px; width: 22px; height: 22px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] [
'class' => 'invert_filter main_menu_icon',
'title' => __('Standby on'),
]
); );
$data[4] .= html_print_input_hidden('standbyoff_alert', 1, true); $data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
} }
@ -1139,8 +1151,7 @@ if (! $id_agente) {
return false; return false;
}); });
$("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>") $("input[name=disable]").hover (function () {
.hover (function () {
$(this).attr ("src", $(this).attr ("src",
<?php <?php
echo '"'.html_print_image( echo '"'.html_print_image(
@ -1166,8 +1177,7 @@ if (! $id_agente) {
} }
); );
$("input[name=enable]").attr ("title", "<?php echo __('Enable'); ?>") $("input[name=enable]").hover (function () {
.hover (function () {
$(this).attr ("src", $(this).attr ("src",
<?php <?php
echo '"'.html_print_image( echo '"'.html_print_image(
@ -1193,8 +1203,7 @@ if (! $id_agente) {
} }
); );
$("input[name=standby_on]").attr ("title", "<?php echo __('Set off standby'); ?>") $("input[name=standby_on]").hover (function () {
.hover (function () {
$(this).attr ("src", $(this).attr ("src",
<?php <?php
echo '"'.html_print_image( echo '"'.html_print_image(
@ -1220,8 +1229,7 @@ if (! $id_agente) {
} }
); );
$("input[name=standby_off]").attr ("title", "<?php echo __('Set standby'); ?>") $("input[name=standby_off]").hover (function () {
.hover (function () {
$(this).attr ("src", $(this).attr ("src",
<?php <?php
echo '"'.html_print_image( echo '"'.html_print_image(

View File

@ -210,7 +210,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
echo '<td class="'.$tdcolor.' table_action_buttons"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row['id_link'].'&borrar='.$row['id_link'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image( echo '<td class="'.$tdcolor.' table_action_buttons"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row['id_link'].'&borrar='.$row['id_link'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/delete.svg', 'images/delete.svg',
true, true,
['class' => 'invert_filter'] [
'class' => 'invert_filter main_menu_icon',
'title' => __('Delete'),
]
).'</a></td></tr>'; ).'</a></td></tr>';
} }

View File

@ -132,7 +132,15 @@ foreach ($osList as $os) {
$data[] = html_print_anchor( $data[] = html_print_anchor(
[ [
'href' => $hrefDelete, 'href' => $hrefDelete,
'content' => html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']), 'content' => html_print_image(
'images/delete.svg',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'main_menu_icon invert_filter',
]
),
], ],
true true
); );

View File

@ -2006,6 +2006,7 @@ if ($create_alert || $update_alert) {
'alt' => __('Update'), 'alt' => __('Update'),
'border' => 0, 'border' => 0,
'class' => 'main_menu_icon', 'class' => 'main_menu_icon',
'title' => __('Edit'),
] ]
), ),
], ],
@ -2174,24 +2175,11 @@ if ($create_alert || $update_alert) {
echo '</form>'; echo '</form>';
} }
echo '<div class="right">'; $legend = '<table id="legend_snmp_alerts"class="w100p"><td><div class="snmp_view_div w100p legend_white">';
echo '<form name="agente" method="post" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert">'; $legend .= '<div class="display-flex"><div class="flex-50">';
html_print_input_hidden('create_alert', 1); $priorities = get_priorities();
$submitButton = html_print_submit_button( $half = (count($priorities) / 2);
__('Create'), $count = 0;
'alert',
false,
['icon' => 'wand'],
true
);
html_print_action_buttons($submitButton.$deleteButton, ['right_content' => $pagination]);
echo '</form></div>';
$legend = '<table id="legend_snmp_alerts"class="w100p"><td><div class="snmp_view_div w100p legend_white">';
$legend .= '<div class="display-flex"><div class="flex-50">';
$priorities = get_priorities();
$half = (count($priorities) / 2);
$count = 0;
foreach ($priorities as $num => $name) { foreach ($priorities as $num => $name) {
if ($count == $half) { if ($count == $half) {
$legend .= '</div><div class="mrgn_lft_5px flex-50">'; $legend .= '</div><div class="mrgn_lft_5px flex-50">';
@ -2202,11 +2190,24 @@ if ($create_alert || $update_alert) {
$count++; $count++;
} }
$legend .= '</div></div></div></td>'; $legend .= '</div></div></div></td></tr></table>';
ui_toggle($legend, __('Legend')); ui_toggle($legend, __('Legend'));
unset($table); unset($table);
echo '<div class="right">';
echo '<form name="agente" method="post" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert">';
html_print_input_hidden('create_alert', 1);
$submitButton = html_print_submit_button(
__('Create'),
'alert',
false,
['icon' => 'wand'],
true
);
html_print_action_buttons($submitButton.$deleteButton, ['right_content' => $pagination]);
echo '</form></div>';
} }
ui_require_javascript_file('pandora', 'include/javascript/', true); ui_require_javascript_file('pandora', 'include/javascript/', true);

View File

@ -682,6 +682,7 @@ class ManageExtensions extends HTML
[ [
'onclick' => 'if (!confirm(\''.__('Deleting this application will also delete all the discovery tasks using it. Do you want to delete it?').'\')) return false;', 'onclick' => 'if (!confirm(\''.__('Deleting this application will also delete all the discovery tasks using it. Do you want to delete it?').'\')) return false;',
'class' => 'main_menu_icon invert_filter action_button_hidden', 'class' => 'main_menu_icon invert_filter action_button_hidden',
'title' => 'Delete',
] ]
); );
$data[$key]['actions'] .= html_print_input_hidden('short_name', $row['short_name'], true); $data[$key]['actions'] .= html_print_input_hidden('short_name', $row['short_name'], true);
@ -697,6 +698,7 @@ class ManageExtensions extends HTML
[ [
'onclick' => 'if (!confirm(\''.__('Are you sure you want to reapply?').'\')) return false;', 'onclick' => 'if (!confirm(\''.__('Are you sure you want to reapply?').'\')) return false;',
'class' => 'main_menu_icon invert_filter action_button_hidden', 'class' => 'main_menu_icon invert_filter action_button_hidden',
'title' => 'Refresh',
] ]
); );
$data[$key]['actions'] .= html_print_input_hidden('sync_action', 'refresh', true); $data[$key]['actions'] .= html_print_input_hidden('sync_action', 'refresh', true);

View File

@ -766,7 +766,18 @@ function filemanager_file_explorer(
&& ($readOnly === false) && ($readOnly === false)
) { ) {
$data[4] .= '<form method="post" action="'.$url.'" style="">'; $data[4] .= '<form method="post" action="'.$url.'" style="">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter main_menu_icon" src="images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; $data[4] .= html_print_input_image(
'delete',
'images/delete.svg',
1,
'margin-top: 2px;height:21px',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter main_menu_icon',
'onclick' => 'if (!confirm(\' '.__('Are you sure?').'\')) return false;',
]
);
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true); $data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true); $data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true);
$data[4] .= html_print_input_hidden('delete_file', 1, true); $data[4] .= html_print_input_hidden('delete_file', 1, true);

View File

@ -3336,9 +3336,23 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $
'disabled', 'disabled',
]; ];
if (isset($options['title']) && $options['title'] != '') {
if (isset($options['class'])) {
$options['class'] .= ' forced_title';
} else {
$options['class'] = 'forced_title';
}
// New way to show the force_title (cleaner and better performance).
$output .= 'data-title="'.io_safe_input_html($options['title']).'" ';
$output .= 'data-use_title_for_force_title="1" ';
}
foreach ($attrs as $attribute) { foreach ($attrs as $attribute) {
if (isset($options[$attribute])) { if ($attribute !== 'title') {
$output .= ' '.$attribute.'="'.io_safe_input_html($options[$attribute]).'"'; if (isset($options[$attribute])) {
$output .= ' '.$attribute.'="'.io_safe_input_html($options[$attribute]).'"';
}
} }
} }

View File

@ -323,7 +323,7 @@ input[type="radio"] {
input[type="image"] { input[type="image"] {
border: 0px; border: 0px;
background-color: transparent; background-color: transparent !important;
height: auto; height: auto;
padding: 0px; padding: 0px;
} }
@ -4750,7 +4750,7 @@ form ul.form_flex li ul li {
.flex_center > form > input[type="image"] { .flex_center > form > input[type="image"] {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 14px; width: 20px;
padding-left: 5px; padding-left: 5px;
} }