mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
ervices: Unbound DNS: Overrides - Make selected row "sticky" when there are items available, always make sure one is selected and reload the aliases grid when hosts are loaded. closes https://github.com/opnsense/core/issues/6920
This commit is contained in:
parent
5003ce8f05
commit
8d71ea0f64
@ -71,25 +71,17 @@ $( document ).ready(function() {
|
||||
}).on("selected.rs.jquery.bootgrid", function (e, rows) {
|
||||
$("#grid-aliases").bootgrid('reload');
|
||||
}).on("deselected.rs.jquery.bootgrid", function (e, rows) {
|
||||
// de-select not allowed, make sure always one items is selected. (sticky selected)
|
||||
if ($("#grid-hosts").bootgrid("getSelectedRows").length == 0) {
|
||||
$("#grid-hosts").bootgrid('select', [rows[0].uuid]);
|
||||
}
|
||||
$("#grid-aliases").bootgrid('reload');
|
||||
}).on("loaded.rs.jquery.bootgrid", function (e) {
|
||||
let ids = $("#grid-hosts").bootgrid("getCurrentRows");
|
||||
if (ids.length > 0) {
|
||||
$("#grid-hosts").bootgrid('select', [ids[0].uuid]);
|
||||
}
|
||||
|
||||
/* Hide/unhide input fields based on selected RR (Type) value */
|
||||
$('select[id="host.rr"]').on('change', function(e) {
|
||||
if (this.value == "A" || this.value == "AAAA") {
|
||||
$('tr[id="row_host.mx"]').addClass('hidden');
|
||||
$('tr[id="row_host.mxprio"]').addClass('hidden');
|
||||
$('tr[id="row_host.server"]').removeClass('hidden');
|
||||
} else if (this.value == "MX") {
|
||||
$('tr[id="row_host.server"]').addClass('hidden');
|
||||
$('tr[id="row_host.mx"]').removeClass('hidden');
|
||||
$('tr[id="row_host.mxprio"]').removeClass('hidden');
|
||||
}
|
||||
});
|
||||
$("#grid-aliases").bootgrid('reload');
|
||||
});
|
||||
|
||||
let grid_aliases = $("#grid-aliases").UIBootgrid({
|
||||
@ -152,6 +144,20 @@ $( document ).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
/* Hide/unhide input fields based on selected RR (Type) value */
|
||||
$('select[id="host.rr"]').on('change', function(e) {
|
||||
if (this.value == "A" || this.value == "AAAA") {
|
||||
$('tr[id="row_host.mx"]').addClass('hidden');
|
||||
$('tr[id="row_host.mxprio"]').addClass('hidden');
|
||||
$('tr[id="row_host.server"]').removeClass('hidden');
|
||||
} else if (this.value == "MX") {
|
||||
$('tr[id="row_host.server"]').addClass('hidden');
|
||||
$('tr[id="row_host.mx"]').removeClass('hidden');
|
||||
$('tr[id="row_host.mxprio"]').removeClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (window.location.hash != "") {
|
||||
$('a[href="' + window.location.hash + '"]').click();
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user