mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 10:41:34 +00:00
add import/export page GUI
This commit is contained in:
parent
a2cfa0ff26
commit
b7b17d9d1c
12 changed files with 197 additions and 18 deletions
32
httpdocs/js/pages/import-export-config.js
Normal file
32
httpdocs/js/pages/import-export-config.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
$(document).ready(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());
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue