'class': 'cbi-checkbox',
'data-update': 'click change',
'type': 'checkbox',
- 'id': 'filter',
+ 'id': 'chkFilter',
+ 'disabled': 'disabled',
'value': 'true'
}),
E('span', { 'style': 'margin-left: .5em;' }, _('Show only Set elements with hits'))
E('button', {
'class': 'btn cbi-button-action',
'click': ui.createHandlerFn(this, function (ev) {
- const checkbox = document.getElementById('filter');
+ const checkbox = document.getElementById('chkFilter');
const isChecked = checkbox.checked;
let set = document.getElementById('set').value;
if (set) {
}, _('Show Content'))
])
]);
+ if (uci.get('banip', 'global', 'ban_nftcount') === '1') {
+ const chk = document.querySelector('#chkFilter');
+ if (chk) {
+ chk.removeAttribute('disabled');
+ }
+ }
document.getElementById('set').focus();
}
if (ev === 'map') {
- let md = ui.showModal(null, [
+ const modal = ui.showModal(null, [
E('div', { id: 'mapModal',
style: 'position: relative;' }, [
E('iframe', {
}, _('Map Reset'))
])
]);
- md.style.maxWidth = '90%';
+ modal.style.maxWidth = '90%';
document.getElementById('mapModal').focus();
}
}
}
cbi_update_table(tblSets, rowSets);
- return E('div', { 'class': 'cbi-map', 'id': 'cbimap' }, [
+ const page = E('div', { 'class': 'cbi-map', 'id': 'cbimap' }, [
E('div', { 'class': 'cbi-section' }, [
E('p', _('This report shows the latest NFT Set statistics, press the \'Refresh\' button to get a new one. \
You can also display the specific content of Sets, search for suspicious IPs and finally, these IPs can also be displayed on a map.')),
E('button', {
'class': 'btn cbi-button cbi-button-apply',
'style': 'float:none;margin-right:.4em;',
+ 'id': 'btnMap',
+ 'disabled': 'disabled',
'click': ui.createHandlerFn(this, function () {
- if (uci.get('banip', 'global', 'ban_nftcount') !== '1' || uci.get('banip', 'global', 'ban_map') !== '1') {
- if (!notMsg) {
- notMsg = true;
- return ui.addNotification(null, E('p', _('GeoIP Map is not enabled!')), 'info');
- }
- }
if (content[1] && content[1].length > 1) {
sessionStorage.setItem('mapData', JSON.stringify(content[1]));
return handleAction(report, 'map');
location.reload();
})
}
- }, [_('Refresh')]),
+ }, [_('Refresh')])
])
]);
+ if (uci.get('banip', 'global', 'ban_nftcount') === '1' && uci.get('banip', 'global', 'ban_map') === '1') {
+ const btn = page.querySelector('#btnMap');
+ if (btn) {
+ btn.removeAttribute('disabled');
+ }
+ }
+ return page;
},
handleSaveApply: null,
handleSave: null,