firewall: open dialog with uuid link, for https://github.com/opnsense/plugins/issues/1720

This commit is contained in:
Ad Schellevis
2020-03-10 15:17:52 +01:00
committed by Ad Schellevis
parent 455518faa0
commit 00e242f068
2 changed files with 8 additions and 2 deletions
@@ -78,7 +78,6 @@ class Filter extends BaseModel
$rule->source_net->__reference
));
}
}
}
return $messages;
@@ -1,6 +1,6 @@
<script>
$( document ).ready(function() {
$("#grid-rules").UIBootgrid({
let grid = $("#grid-rules").UIBootgrid({
search:'/api/firewall/filter/searchItem/',
get:'/api/firewall/filter/getItem/',
set:'/api/firewall/filter/setItem/',
@@ -8,6 +8,13 @@
del:'/api/firewall/filter/delItem/',
toggle:'/api/firewall/filter/toggleItem/'
});
// open edit dialog when opened with a uuid reference
if (window.location.hash !== "" && window.location.hash.split("-").length >= 4) {
grid.on('loaded.rs.jquery.bootgrid', function(){
$(".command-edit:eq(0)").clone(true).data('row-id', window.location.hash).click();
});
}
});
</script>