ntopng/httpdocs/js/pages/import-export-config.js
Simone Mainardi 1dce9e5842 Migrates to Bootstrap 5
Adds bootstrap-5.0.0-beta3-dist

Adds bootstrap-5.0.0

Updates bootstrap-5.0.0-beta3-dist to bootstrap-5.0.0-dist

initial migration to bs v5

porting to bs5

improvements on dropdown menu filter

fixed host map dropdown

removed excessive padding

fix button toggle

re-add blog news

removed text decoration for links

fix button layout (#5348)

remove underscore from href (#5347)
2021-05-18 11:39:59 +02:00

32 lines
942 B
JavaScript

$(function() {
$(`#btn-import-config`).click(function() {
const selectedItem = $(`input[name='item']`).val();
const itemLabel = $(`label[for='radio-${selectedItem}']`).text();
$(`#import-modal span.item`).text(itemLabel);
});
// on item change updates export link
$(`input[name='item']`).change(function() {
// change selected item to export
const item = $(this).val();
const href = $(`#btn-export-config`).attr('href');
const currentURL = new URL(href, window.location.origin);
currentURL.searchParams.set('item', item);
if (item == "all") {
$(`#import-export`).hide();
$(`#backup-restore`).show();
return;
}
$(`#backup-restore`).hide();
$(`#import-export`).show();
// update the new export link
$(`#btn-export-config`).attr('href', currentURL.toString());
});
});