SNMP and reporting visual changes

This commit is contained in:
Jonathan 2023-02-27 16:33:54 +01:00
parent 87f17890f9
commit dcdf0a5188
5 changed files with 96 additions and 63 deletions

View File

@ -134,7 +134,7 @@ $table->data[1][2] = html_print_label_input_block(
)
);
$table->data[2][1] = html_print_label_input_block(
$table->data[2][0] = html_print_label_input_block(
__('SNMP Agent'),
html_print_input_text(
'snmp_agent',
@ -155,7 +155,7 @@ $types = [
5 => 'EGP neighbor loss (5)',
6 => 'Enterprise (6)',
];
$table->data[2][2] = html_print_label_input_block(
$table->data[2][1] = html_print_label_input_block(
__('SNMP Type'),
html_print_select(
$types,

View File

@ -532,7 +532,7 @@ class SnmpConsole extends HTML
[
'icon' => 'delete',
'mode' => 'secondary',
'onClick' => "javascript:return confirm(\''.__('Are you sure?').'\')",
'onClick' => "javascript:return confirm('".__('Are you sure?')."')",
],
true
);
@ -542,45 +542,47 @@ class SnmpConsole extends HTML
['type' => 'form_action']
);
echo '<table id="legend_snmp_browser"><td><div class="snmp_view_div w100p">';
echo '<h3 style="position: relative;left: 50%;">'.__('Severity').'</h3>';
echo '<div class="display-flex"><div class="flex-50">';
$legend = '<table id="legend_snmp_browser"class="w100p"><td><div class="snmp_view_div w100p legend_white">';
$legend .= '<h3 style="position: relative;left: 50%;">'.__('Severity').'</h3>';
$legend .= '<div class="display-flex"><div class="flex-50">';
$priorities = get_priorities();
$half = (count($priorities) / 2);
$count = 0;
foreach ($priorities as $num => $name) {
if ($count == $half) {
echo '</div><div class="mrgn_lft_5px flex-50">';
$legend .= '</div><div class="mrgn_lft_5px flex-50">';
}
echo '<span class="'.get_priority_class($num).'">'.$name.'</span>';
echo '<br />';
$legend .= '<span class="'.get_priority_class($num).'">'.$name.'</span>';
$legend .= '<br />';
$count++;
}
echo '</div></div></div></td>';
echo '<td><div class="snmp_view_div">';
echo '<h3>'.__('Status').'</h3>';
echo '<span class="datos_green">'.__('Validated').'</span>';
echo '<br />';
echo '<span class="datos_red">'.__('Not validated').'</span>';
echo '</div></td>';
echo '<td><div class="snmp_view_div">';
echo '<h3>'.__('Alert').'</h3>';
echo '<span class="datos_yellow">'.__('Alert').'</span>';
echo '<br />';
echo '<span class="datos_grey">'.__('Not fired').'</span>';
echo '</div></td>';
echo '<td><div class="snmp_view_div">';
echo '<h3>'.__('Action').'</h3>';
echo '<div style=" display : flex;align-items : center;">';
echo html_print_image('images/validate.svg', true, ['class' => 'main_menu_icon invert_filter']).' - '.__('Validate');
echo '</div>';
echo '<br />';
echo '<div style=" display : flex;align-items : center;">';
echo html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).' - '.__('Delete');
echo '</div>';
echo '</div></div></td>';
$legend .= '</div></div></div></td>';
$legend .= '<td><div class="snmp_view_div">';
$legend .= '<h3>'.__('Status').'</h3>';
$legend .= '<span class="datos_green">'.__('Validated').'</span>';
$legend .= '<br />';
$legend .= '<span class="datos_red">'.__('Not validated').'</span>';
$legend .= '</div></td>';
$legend .= '<td><div class="snmp_view_div">';
$legend .= '<h3>'.__('Alert').'</h3>';
$legend .= '<span class="datos_yellow">'.__('Alert').'</span>';
$legend .= '<br />';
$legend .= '<span class="datos_grey">'.__('Not fired').'</span>';
$legend .= '</div></td>';
$legend .= '<td><div class="snmp_view_div">';
$legend .= '<h3>'.__('Action').'</h3>';
$legend .= '<div style=" display : flex;align-items : center;">';
$legend .= html_print_image('images/validate.svg', true, ['class' => 'main_menu_icon invert_filter']).' - '.__('Validate');
$legend .= '</div>';
$legend .= '<br />';
$legend .= '<div style=" display : flex;align-items : center;">';
$legend .= html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).' - '.__('Delete');
$legend .= '</div>';
$legend .= '</div></div></td>';
ui_toggle($legend, __('Legend'));
// Load own javascript file.
echo $this->loadJS();
@ -1493,7 +1495,7 @@ class SnmpConsole extends HTML
}
});
$('#submit-updatebt').click(function() {
$('#button-updatebt').click(function() {
let array = [];
$('input[name="snmptrapid[]"]:checked').each(function() {
array.push(this.value);
@ -1520,7 +1522,7 @@ class SnmpConsole extends HTML
}
});
$('#submit-deletebt').click(function() {
$('#button-deletebt').click(function() {
let array = [];
$('input[name="snmptrapid[]"]:checked').each(function() {
array.push(this.value);

View File

@ -542,7 +542,7 @@ function filemanager_file_explorer(
break;
<?php if ($allowCreateText === true) : ?>
case 'create_text_file':
title_action = "<?php echo __('Create a Text'); ?>";
title_action = "<?php echo __('Create File'); ?>";
break;
<?php endif ?>
case 'upload_file':
@ -791,7 +791,7 @@ function filemanager_file_explorer(
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
&& ($readOnly === false)
) {
$data[4] .= '<a href="javascript: show_modal_real_path(`'.$fileinfo['realpath'].'`);">'.html_print_image('images/book_edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Real path'), 'class' => 'invert_filter']).'</a>';
$data[4] .= '<a href="javascript: show_modal_real_path(`'.$fileinfo['realpath'].'`);">'.html_print_image('images/enable.svg', true, ['style' => 'margin-top: 2px;', 'title' => __('Real path'), 'class' => 'invert_filter main_menu_icon']).'</a>';
}
$data[4] .= '</span>';
@ -830,10 +830,10 @@ function filemanager_file_explorer(
'images/create_file.png',
true,
[
'title' => __('Create a Text'),
'title' => __('Create File'),
'class' => 'invert_filter',
]
).'<span>'.__('Create a Text').'</span>
).'<span>'.__('Create File').'</span>
</a>
</li>';
}
@ -937,40 +937,46 @@ function filemanager_file_explorer(
echo "<div style='width: ".$table->width.";' class='file_table_buttons'>";
echo "<a href='javascript: show_form_create_folder();'>";
echo html_print_image(
'images/create_directory.png',
true,
$buttons[] = html_print_button(
__('Create directory'),
'create_directory',
false,
'show_form_create_folder()',
[
'title' => __('Create directory'),
'class' => 'invert_filter',
]
'class' => 'margin-right-2 invert_filter secondary',
'icon' => 'create_directory',
],
true,
false
);
echo '</a>';
if ($allowCreateText === true) {
echo "<a href='javascript: show_create_text_file();'>";
echo html_print_image(
'images/create_file.png',
true,
$buttons[] = html_print_button(
__('Create file'),
'create_text',
false,
'show_create_text_file()',
[
'title' => __('Create text'),
'class' => 'invert_filter',
]
'class' => 'margin-right-2 invert_filter secondary',
'icon' => 'create_file',
],
true,
false
);
echo '</a>';
}
echo "<a href='javascript: show_upload_file();'>";
echo html_print_image(
'images/upload_file.png',
true,
$buttons[] = html_print_button(
__('Upload file/s'),
'upload_file',
false,
'show_upload_file()',
[
'title' => __('Upload file/s'),
'class' => 'invert_filter',
]
'class' => 'margin-right-2 invert_filter secondary',
'icon' => 'upload_file',
],
true,
false
);
echo '</a>';
// Show Modal Real Path
$modal_real_path = "<div><b>Real path to plugin execution is:</b></div>
@ -997,6 +1003,11 @@ function filemanager_file_explorer(
}
html_print_table($table);
html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
}

View File

@ -6754,9 +6754,13 @@ function html_print_label_input_block(
if (isset($options['label_class']) === true) {
$label_class = $options['label_class'];
}
if (isset($options['div_id']) === true) {
$div_id = 'id="'.$options['div_id'].'"';
}
}
$output = '<div class="'.$div_class.'">';
$output = '<div class="'.$div_class.'" '.$div_id.'>';
if ($label !== null) {
$output .= '<label class="'.$label_class.'">'.$label.'</label>';
}

View File

@ -10415,6 +10415,22 @@ button div.fail {
-webkit-mask: url(../../images/fail@svg.svg) no-repeat center / contain;
}
button div.upload_file {
mask: url(../../images/upload_file.png) no-repeat center / contain;
-webkit-mask: url(../../images/upload_file.png) no-repeat center / contain;
}
button div.create_file {
mask: url(../../images/create_file.png) no-repeat center / contain;
-webkit-mask: url(../../images/create_file.png) no-repeat center / contain;
}
button div.create_directory {
mask: url(../../images/create_directory.png) no-repeat center / contain;
-webkit-mask: url(../../images/create_directory.png) no-repeat center /
contain;
}
button div.cog.rotation {
animation: rotation 4s infinite linear;
}