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

View File

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

View File

@ -542,7 +542,7 @@ function filemanager_file_explorer(
break; break;
<?php if ($allowCreateText === true) : ?> <?php if ($allowCreateText === true) : ?>
case 'create_text_file': case 'create_text_file':
title_action = "<?php echo __('Create a Text'); ?>"; title_action = "<?php echo __('Create File'); ?>";
break; break;
<?php endif ?> <?php endif ?>
case 'upload_file': case 'upload_file':
@ -791,7 +791,7 @@ function filemanager_file_explorer(
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3) && (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
&& ($readOnly === false) && ($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>'; $data[4] .= '</span>';
@ -830,10 +830,10 @@ function filemanager_file_explorer(
'images/create_file.png', 'images/create_file.png',
true, true,
[ [
'title' => __('Create a Text'), 'title' => __('Create File'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'<span>'.__('Create a Text').'</span> ).'<span>'.__('Create File').'</span>
</a> </a>
</li>'; </li>';
} }
@ -937,40 +937,46 @@ function filemanager_file_explorer(
echo "<div style='width: ".$table->width.";' class='file_table_buttons'>"; echo "<div style='width: ".$table->width.";' class='file_table_buttons'>";
echo "<a href='javascript: show_form_create_folder();'>"; $buttons[] = html_print_button(
echo html_print_image( __('Create directory'),
'images/create_directory.png', 'create_directory',
true, false,
'show_form_create_folder()',
[ [
'title' => __('Create directory'), 'class' => 'margin-right-2 invert_filter secondary',
'class' => 'invert_filter', 'icon' => 'create_directory',
] ],
true,
false
); );
echo '</a>';
if ($allowCreateText === true) { if ($allowCreateText === true) {
echo "<a href='javascript: show_create_text_file();'>"; $buttons[] = html_print_button(
echo html_print_image( __('Create file'),
'images/create_file.png', 'create_text',
true, false,
'show_create_text_file()',
[ [
'title' => __('Create text'), 'class' => 'margin-right-2 invert_filter secondary',
'class' => 'invert_filter', 'icon' => 'create_file',
] ],
true,
false
); );
echo '</a>';
} }
echo "<a href='javascript: show_upload_file();'>"; $buttons[] = html_print_button(
echo html_print_image( __('Upload file/s'),
'images/upload_file.png', 'upload_file',
true, false,
'show_upload_file()',
[ [
'title' => __('Upload file/s'), 'class' => 'margin-right-2 invert_filter secondary',
'class' => 'invert_filter', 'icon' => 'upload_file',
] ],
true,
false
); );
echo '</a>';
// Show Modal Real Path // Show Modal Real Path
$modal_real_path = "<div><b>Real path to plugin execution is:</b></div> $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_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) { if (isset($options['label_class']) === true) {
$label_class = $options['label_class']; $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) { if ($label !== null) {
$output .= '<label class="'.$label_class.'">'.$label.'</label>'; $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; -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 { button div.cog.rotation {
animation: rotation 4s infinite linear; animation: rotation 4s infinite linear;
} }