Browse Source

Fix the issue that IPv6 address can't be banned

The ban action doesn't depend on ipfilter.
adaptive-webui-19844
brvphoenix 4 years ago
parent
commit
799ad0feff
  1. 2
      src/webui/api/synccontroller.cpp
  2. 14
      src/webui/www/private/views/preferences.html

2
src/webui/api/synccontroller.cpp

@ -550,7 +550,7 @@ void SyncController::torrentPeersAction()
peer[KEY_PEER_COUNTRY] = Net::GeoIPManager::CountryName(pi.country()); peer[KEY_PEER_COUNTRY] = Net::GeoIPManager::CountryName(pi.country());
} }
peers[pi.address().ip.toString() + ':' + QString::number(pi.address().port)] = peer; peers[pi.address().toString()] = peer;
} }
data["peers"] = peers; data["peers"] = peers;

14
src/webui/www/private/views/preferences.html

@ -356,11 +356,11 @@
<fieldset class="settings"> <fieldset class="settings">
<legend> <legend>
<input type="checkbox" id="ipfilter_enabled_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" /> <label>QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
<label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
</legend> </legend>
<div class="formRow"> <div class="formRow">
<label for="ipfilter_text">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label> <input type="checkbox" id="ipfilter_text_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" />
<label for="ipfilter_text_checkbox">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="text" id="ipfilter_text" /> <input type="text" id="ipfilter_text" />
</div> </div>
<div class="formRow"> <div class="formRow">
@ -1423,10 +1423,8 @@
}; };
const updateFilterSettings = function() { const updateFilterSettings = function() {
const isIPFilterEnabled = $('ipfilter_enabled_checkbox').getProperty('checked'); const isIPFilterEnabled = $('ipfilter_text_checkbox').getProperty('checked');
$('ipfilter_text').setProperty('disabled', !isIPFilterEnabled); $('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
$('ipfilter_trackers_checkbox').setProperty('disabled', !isIPFilterEnabled);
$('banned_IPs_textarea').setProperty('disabled', !isIPFilterEnabled);
}; };
// Speed tab // Speed tab
@ -1736,7 +1734,7 @@
$('peer_proxy_password_text').setProperty('value', pref.proxy_password); $('peer_proxy_password_text').setProperty('value', pref.proxy_password);
// IP Filtering // IP Filtering
$('ipfilter_enabled_checkbox').setProperty('checked', pref.ip_filter_enabled); $('ipfilter_text_checkbox').setProperty('checked', pref.ip_filter_enabled);
$('ipfilter_text').setProperty('value', pref.ip_filter_path); $('ipfilter_text').setProperty('value', pref.ip_filter_path);
$('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers); $('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers);
$('banned_IPs_textarea').setProperty('value', pref.banned_IPs); $('banned_IPs_textarea').setProperty('value', pref.banned_IPs);
@ -2050,7 +2048,7 @@
settings.set('proxy_password', $('peer_proxy_password_text').getProperty('value')); settings.set('proxy_password', $('peer_proxy_password_text').getProperty('value'));
// IP Filtering // IP Filtering
settings.set('ip_filter_enabled', $('ipfilter_enabled_checkbox').getProperty('checked')); settings.set('ip_filter_enabled', $('ipfilter_text_checkbox').getProperty('checked'));
settings.set('ip_filter_path', $('ipfilter_text').getProperty('value')); settings.set('ip_filter_path', $('ipfilter_text').getProperty('value'));
settings.set('ip_filter_trackers', $('ipfilter_trackers_checkbox').getProperty('checked')); settings.set('ip_filter_trackers', $('ipfilter_trackers_checkbox').getProperty('checked'));
settings.set('banned_IPs', $('banned_IPs_textarea').getProperty('value')); settings.set('banned_IPs', $('banned_IPs_textarea').getProperty('value'));

Loading…
Cancel
Save