Firewall/Scrub: Display interface descriptions (#5433)

This commit is contained in:
vnxme 2021-12-28 11:07:41 +03:00 committed by GitHub
parent de3a021dd9
commit aa20ccba4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,6 +205,15 @@ $( document ).ready(function() {
// watch scroll position and set to last known on page load
watchScrollPosition();
// add titles to the fields having long text cut with ellipsis
$('.mightOverflow').on('mouseenter', function(){
var $this = $(this);
if(this.offsetWidth < this.scrollWidth && !$this.attr('title')){
$this.attr('title', $this.text());
}
});
});
</script>
@ -313,6 +322,7 @@ $( document ).ready(function() {
<?php
$special_nets = get_specialnets();
legacy_html_escape_form_data($special_nets);
$configured_interfaces = legacy_config_get_interfaces();
foreach ($a_scrub as $i => $scrubEntry):?>
<tr>
<td>
@ -321,7 +331,14 @@ $( document ).ready(function() {
<span class="fa fa-play fa-fw <?=(empty($scrubEntry['disabled'])) ? "text-success" : "text-muted";?>"></span>
</a>
</td>
<td><?=strtoupper($scrubEntry['interface']);?></td>
<?php
$scrubEntryInterfaceDescrs = [];
foreach (explode(',', $scrubEntry['interface']) as $scrubEntryInterfaceName) {
if (array_key_exists($scrubEntryInterfaceName, $configured_interfaces)) {
$scrubEntryInterfaceDescrs[] = $configured_interfaces[$scrubEntryInterfaceName]['descr'] ?? strtoupper($scrubEntryInterfaceName);
}
}?>
<td class="mightOverflow" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch;"><?=implode(', ', $scrubEntryInterfaceDescrs);?></td>
<td class="hidden-xs hidden-sm">
<?php
if (is_alias($scrubEntry['src'])):?>