mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
Firewall: Diagnostics: States Dump - refactor to MVC.
o fix minor regression duplicating records (only flush on last content line) o add link to firewall / rules page
This commit is contained in:
parent
63bdff8cf3
commit
43b7f1eb7f
@ -124,8 +124,10 @@ def query_states(rule_label, filter_str):
|
||||
elif filter_str != "" and search_line.lower().find(filter_str.lower()) == -1:
|
||||
# apply filter when provided
|
||||
continue
|
||||
# append to response
|
||||
result.append(record)
|
||||
|
||||
if parts[0] == "id:":
|
||||
# append to response
|
||||
result.append(record)
|
||||
elif len(parts) >= 6:
|
||||
record = {
|
||||
'label': '',
|
||||
|
||||
@ -713,7 +713,12 @@ $( document ).ready(function() {
|
||||
</td>
|
||||
<td class="view-info hidden-xs hidden-sm">*</td>
|
||||
<td class="view-stats hidden-xs hidden-sm"><?= !empty($rule_stats) ? $rule_stats['evaluations'] : gettext('N/A') ?></td>
|
||||
<td class="view-stats hidden-xs hidden-sm"><?= !empty($rule_stats) ? $rule_stats['states'] : gettext('N/A') ?></td>
|
||||
<td class="view-stats hidden-xs hidden-sm">
|
||||
<?php if (!empty($rule_stats) && !empty($rule->getRef())):?>
|
||||
<a href="/ui/diagnostics/firewall/states#<?=html_safe($rule->getLabel());?>" data-toggle="tooltip" title="<?=html_safe("open states view");?>" ><?= $rule_stats['states'];?></a>
|
||||
<?php else: ?>
|
||||
<?= !empty($rule_stats) ? $rule_stats['states'] : gettext('N/A') ?></td>
|
||||
<?php endif ?>
|
||||
<td class="view-stats"><?= !empty($rule_stats) ? $rule_stats['packets'] : gettext('N/A') ?></td>
|
||||
<td class="view-stats"><?= !empty($rule_stats) ? format_bytes($rule_stats['bytes']) : gettext('N/A') ?></td>
|
||||
<td><?=$rule->getDescr();?></td>
|
||||
@ -854,7 +859,14 @@ $( document ).ready(function() {
|
||||
endif;?>
|
||||
</td>
|
||||
<td class="view-stats hidden-xs hidden-sm"><?= !empty($all_rule_stats[$rule_hash]) ? $all_rule_stats[$rule_hash]['evaluations'] : gettext('N/A') ?></td>
|
||||
<td class="view-stats hidden-xs hidden-sm"><?= !empty($all_rule_stats[$rule_hash]) ? $all_rule_stats[$rule_hash]['states'] : gettext('N/A') ?></td>
|
||||
<td class="view-stats hidden-xs hidden-sm">
|
||||
<?php if (!empty($all_rule_stats[$rule_hash])):?>
|
||||
<a href="/ui/diagnostics/firewall/states#<?=html_safe($rule_hash);?>" data-toggle="tooltip" title="<?=html_safe("open states view");?>" ><?= $all_rule_stats[$rule_hash]['states'];?></a>
|
||||
<?php else: ?>
|
||||
<?= gettext('N/A') ?>
|
||||
<?php endif ?>
|
||||
|
||||
</td>
|
||||
<td class="view-stats"><?= !empty($all_rule_stats[$rule_hash]) ? $all_rule_stats[$rule_hash]['packets'] : gettext('N/A') ?></td>
|
||||
<td class="view-stats"><?= !empty($all_rule_stats[$rule_hash]) ? format_bytes($all_rule_stats[$rule_hash]['bytes']) : gettext('N/A') ?></td>
|
||||
<td class="rule-description">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user